operator==(Vector, Vector) should work with different inline capacities
[WebKit-https.git] / LayoutTests / webrtc / video-replace-muted-track.html
1 <!doctype html>
2 <html>
3     <head>
4         <meta charset="utf-8">
5         <title>Testing basic video exchange from offerer to receiver</title>
6         <script src="../resources/testharness.js"></script>
7         <script src="../resources/testharnessreport.js"></script>
8     </head>
9     <body>
10 <div id="log"></div>
11         <video id="video" autoplay=""></video>
12         <canvas id="canvas" width="640" height="480"></canvas>
13         <script src ="routines.js"></script>
14         <script>
15 promise_test((test) => {
16     if (window.testRunner)
17         testRunner.setUserMediaPermission(true);
18
19     var sender;
20     var firstTrack;
21     return navigator.mediaDevices.getUserMedia({ video: { facingMode: { exact: ["user"] } } }).then((stream) => {
22         frontStream = stream;
23         return new Promise((resolve, reject) => {
24             createConnections((firstConnection) => {
25                 firstTrack = frontStream.getVideoTracks()[0];
26                 sender = firstConnection.addTrack(firstTrack, frontStream);
27            }, (secondConnection) => {
28                 secondConnection.ontrack = (trackEvent) => {
29                     resolve(trackEvent.streams[0]);
30                 };
31             });
32             setTimeout(() => reject("Test timed out"), 5000);
33         });
34     }).then((remoteStream) => {
35         video.srcObject = remoteStream;
36         return video.play();
37     }).then(() => {
38         firstTrack.enabled = false;
39         return checkVideoBlack(true, canvas, video, "Check we receive black frames after disabling the track");
40     }).then(() => {
41         return navigator.mediaDevices.getUserMedia({ video: { facingMode: { exact: ["environment"] } } });
42     }).then((stream) => {
43         return sender.replaceTrack(stream.getVideoTracks()[0]);
44     }).then(() => {
45         return checkVideoBlack(false, canvas, video, "Check we receive some non black frames");
46     }).then(() => {
47         return checkVideoBlack(true, canvas, video, "Check we do not receive any black frame", 40).then(assert_unreached, () => { });
48     });
49 }, "Switching from disabled to enabled track");
50         </script>
51     </body>
52 </html>