blob: 8fa201273830615aa5fdd4e44a358713514c52b6 [file] [edit]
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Testing basic video exchange from offerer to receiver</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
</head>
<body>
<script src ="routines.js"></script>
<script>
promise_test(async (test) => {
let firstConnection, secondConnection;
await new Promise((resolve, reject) => {
createConnections((connection) => {
firstConnection = connection;
localChannel = connection.createDataChannel('sendDataChannel');
}, (connection) => {
secondConnection = connection;
connection.ondatachannel = resolve;
});
setTimeout(() => { reject("Test timed out"); }, 5000);
});
let stats = await getTypedStats(firstConnection, "local-candidate");
assert_true(!stats.address, "address is not exposed");
assert_true(!stats.networkType, "networkType is not exposed");
assert_array_equals(Object.keys(stats), ["id","timestamp","type","candidateType","foundation", "port","priority","protocol","transportId", "usernameFragment"], "local");
stats = await getTypedStats(firstConnection, "remote-candidate");
if (stats.protocol === "tcp") {
assert_equals(stats.tcpType, "active");
// We delete the key so that we can check udp and tcp remote candidate stats in the same way.
delete stats.tcpType;
}
// For now, we do not want to expose address or networkType.
assert_true(!stats.address, "address is not exposed");
assert_true(!stats.networkType, "networkType is not exposed");
assert_array_equals(Object.keys(stats), ["id","timestamp","type","candidateType","foundation", "port","priority","protocol","transportId", "usernameFragment"], "remote");
}, "ICE candidate data channel stats");
</script>
</body>
</html>