LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
[WebKit-https.git] / LayoutTests / webrtc / video-receivers.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         <script src ="routines.js"></script>
11         <script>
12 var firstConnection, secondConnection;
13 promise_test((test) => {
14     if (window.testRunner)
15         testRunner.setUserMediaPermission(true);
16
17     return navigator.mediaDevices.getUserMedia({ video: true}).then((stream) => {
18         return new Promise((resolve, reject) => {
19             createConnections((connection) => {
20                 firstConnection = connection;
21                 var track = stream.getVideoTracks()[0];
22                 firstConnection.addTrack(stream.getVideoTracks()[0], stream);
23                 assert_equals(firstConnection.getSenders()[0].track, track, "first connection track");
24             }, (connection) => {
25                 secondConnection = connection;
26                 secondConnection.ontrack = (trackEvent) => {
27                     assert_equals(secondConnection.getReceivers()[0].track, trackEvent.track, "second connection track");
28                     resolve(trackEvent.streams[0]);
29                 };
30             });
31             setTimeout(() => reject("Test timed out"), 5000);
32         });
33     });
34 }, "Basic video exchange checking getReceivers");
35         </script>
36     </body>
37 </html>