| OLD | NEW |
| (Empty) | |
| 1 <!doctype html> |
| 2 <meta charset=utf-8> |
| 3 <title>requestIdleCallback timeout callback must be called with didTimeout equal
to true</title> |
| 4 <script src=/resources/testharness.js></script> |
| 5 <script src=/resources/testharnessreport.js></script> |
| 6 <div id="log"></div> |
| 7 <script> |
| 8 async_test(function (t) { |
| 9 assert_false(document.hidden, "document.hidden must exist and be false to ru
n this test properly"); |
| 10 var counter = 0; |
| 11 |
| 12 function g(deadline) { |
| 13 assert_true(deadline.didTimeout) |
| 14 t.done(); |
| 15 } |
| 16 |
| 17 function f(deadline) { |
| 18 assert_false(deadline.didTimeout); |
| 19 window.requestIdleCallback(t.step_func(g), {timeout:300}); |
| 20 |
| 21 var d = Date.now() + 500; |
| 22 while (Date.now() < d) { |
| 23 |
| 24 } |
| 25 } |
| 26 window.requestIdleCallback(t.step_func(f)); |
| 27 }, "requestIdleCallback callback should time out"); |
| 28 </script> |
| OLD | NEW |