Debian Codegraph @

testing/web-platform/mozilla/tests/dom/throttling/throttling-webaudio.window.js

raw
1 // META: script=resources/throttling.js
2
3 setup(() => waitForLoad()
4 .then(() => "setup done"));
5
6 promise_test(t => addWebAudio(t)
7 .then(() => busy(100))
8 .then(() => getThrottlingRate(100))
9 .then(rate => {
10 assert_less_than(rate, 10, "Timeout was throttled");
11 }), "Don't throttle when there is active WebAudio.");
12
13 promise_test(t => inFrame(t)
14 .then(win => win.addWebAudio(t))
15 .then(() => busy(100))
16 .then(() => getThrottlingRate(100))
17 .then(rate => {
18 assert_less_than(rate, 10, "Timeout was throttled");
19 }), "Don't throttle when there is active WebAudio in iframe.");
20
21 promise_test(t => inFrame(t)
22 .then(win => addWebAudio(t)
23 .then(() => win.busy(100))
24 .then(() => win.getThrottlingRate(100)))
25 .then(rate => {
26 assert_less_than(rate, 10, "Timeout was throttled");
27 }), "Don't throttle iframe when there is active WebAudio in parent.");
28
29 promise_test(t => inFrame(t)
30 .then(win => win.addWebAudio(t)
31 .then(() => win.busy(100))
32 .then(() => win.getThrottlingRate(100)))
33 .then(rate => {
34 assert_less_than(rate, 10, "Timeout was throttled");
35 }), "Don't throttle iframe when there is active WebAudio in iframe.");