| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../resources/testharness.js"></script> | |
| 3 <script src="../../resources/testharnessreport.js"></script> | |
| 4 <style> | |
| 5 #frame { | |
| 6 position: absolute; | |
| 7 top: -1000px; | |
| 8 } | |
| 9 </style> | |
| 10 | |
| 11 <iframe id="frame" sandbox="allow-scripts" src="resources/timer-throttling-frame
.html"></iframe> | |
| 12 | |
| 13 <script> | |
| 14 if (window.testRunner) | |
| 15 testRunner.dumpAsText(); | |
| 16 let throttlingTest = async_test("Test timer throttling in out-of-view cross orig
in frames"); | |
| 17 | |
| 18 addEventListener('load', () => { | |
| 19 // Throttling only happens after the first layout, so start the test after | |
| 20 // that. | |
| 21 requestAnimationFrame(() => { | |
| 22 var frame = document.querySelector('#frame'); | |
| 23 frame.contentWindow.postMessage(null, '*'); | |
| 24 }); | |
| 25 }); | |
| 26 | |
| 27 addEventListener('message', (e) => { | |
| 28 let timerDelay = e.data; | |
| 29 assert_greater_than(timerDelay, 900, "Timer interval") | |
| 30 throttlingTest.done(); | |
| 31 }); | |
| 32 </script> | |
| OLD | NEW |