throttling-webrtc.window.js (1266B)
1 // META: script=resources/throttling.js 2 3 setup(() => waitForLoad() 4 .then(() => "setup done")); 5 6 promise_test(t => addRTCPeerConnection(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 are open RTCPeerConnections."); 12 13 promise_test(t => inFrame(t) 14 .then(win => win.addRTCPeerConnection(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 are open RTCPeerConnections in iframe."); 20 21 promise_test(t => inFrame(t) 22 .then(win => addRTCPeerConnection(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 are open RTCPeerConnections in parent."); 28 29 promise_test(t => inFrame(t) 30 .then(win => win.addRTCPeerConnection(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 are open RTCPeerConnections in iframe.");