LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
[WebKit-https.git] / LayoutTests / webrtc / release-after-getting-track.html
1 <!doctype html>
2 <html>
3     <head>
4         <meta charset="utf-8">
5         <title>Testing garbage collection after getting tracks</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 promise_test((test) => {
13     if (window.testRunner)
14         testRunner.setUserMediaPermission(true);
15
16     return navigator.mediaDevices.getUserMedia({ video: true, audio: true}).then((stream) => {
17         return new Promise((resolve, reject) => {
18             createConnections((firstConnection) => {
19                 firstConnection.addTrack(stream.getVideoTracks()[0], stream);
20                 firstConnection.addTrack(stream.getAudioTracks()[0], stream);
21             }, (secondConnection) => {
22                 secondConnection.ontrack = resolve;
23             });
24             setTimeout(() => reject("Test timed out"), 5000);
25         });
26     }).then(() => {
27         if (window.GCController)
28             window.GCController.collect();
29         waitFor(1000);
30     });
31 }, "Ensuring collecting tracks does not lead to crashing");
32         </script>
33     </body>
34 </html>