AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
[WebKit-https.git] / LayoutTests / webrtc / peer-connection-createMediaStreamDestination.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4     <meta charset="utf-8">
5     <title>Testing createMediaStreamDestination piped to peer connection</title>
6     <script src="../resources/testharness.js"></script>
7     <script src="../resources/testharnessreport.js"></script>
8     <script src ="routines.js"></script>
9     <script>
10     const noiseContext = new webkitAudioContext();
11     const oscillator = noiseContext.createOscillator();
12     const audioStreamDestination = noiseContext.createMediaStreamDestination();
13     const audioStream = audioStreamDestination.stream;
14     oscillator.connect(audioStreamDestination);
15     oscillator.start();
16     const audioTrack = audioStream.getAudioTracks()[0];
17
18     var context = new webkitAudioContext();
19     var remoteStream;
20
21     async function checkForHumBipBop(stream, previousResults, counter)
22     {
23         if (!previousResults)
24             previousResults = { heardHum : false, heardBip : false, heardBop : false };
25         if (!counter)
26             counter = 1;
27         if (++counter > 20)
28             return Promise.resolve(false);
29
30         results = await analyseAudio(stream, 500, context);
31         previousResults.heardHum |= results.heardHum;
32         previousResults.heardBip |= results.heardBip;
33         previousResults.heardBop |= results.heardBop;
34         if (previousResults.heardHum || previousResults.heardBip || previousResults.heardBop)
35             return Promise.resolve(true);
36
37         return await checkForHumBipBop(stream, previousResults, counter);
38     }
39
40     promise_test(async (test) => {
41         const stream = await new Promise((resolve, reject) => {
42             createConnections((firstConnection) => {
43                 firstConnection.addTrack(audioTrack, audioStream);
44             }, (secondConnection) => {
45                 secondConnection.ontrack = (event) => { resolve(event.streams[0]); };
46             });
47             setTimeout(() => reject("Test timed out"), 5000);
48         });
49         const results = await checkForHumBipBop(stream);
50         await  context.close();
51         await  noiseContext.close();
52         assert_true(results, "heard hum bip bop");
53     }, "Web audio generated content through a peer connection");
54     </script>
55 </head>
56 <body>
57 </body>
58 </html>