Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(634)

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/html/webappapis/idle-callbacks/callback-timeout.html

Issue 2665073003: Import wpt@cd5cce9780f84cee679919679b8199084ea96d54 (Closed)
Patch Set: Update test expectations and baselines. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <meta charset=utf-8> 2 <meta charset=utf-8>
3 <title>requestIdleCallback timeout callback must be called with didTimeout equal to true</title> 3 <title>requestIdleCallback timeout callback must be called with didTimeout equal to true</title>
4 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharness.js></script>
5 <script src=/resources/testharnessreport.js></script> 5 <script src=/resources/testharnessreport.js></script>
6 <div id="log"></div> 6 <div id="log"></div>
7 <script> 7 <script>
8 async_test(function (t) { 8 async_test(function (t) {
9 assert_false(document.hidden, "document.hidden must exist and be false to ru n this test properly"); 9 assert_false(document.hidden, "document.hidden must exist and be false to ru n this test properly");
10 var counter = 0; 10 var counter = 0;
11 11
12 function g(deadline) { 12 function g(deadline) {
13 assert_true(deadline.didTimeout) 13 assert_true(deadline.didTimeout)
14 t.done(); 14 t.done();
15 } 15 }
16 16
17 function f(deadline) { 17 function f(deadline) {
18 assert_false(deadline.didTimeout); 18 assert_false(deadline.didTimeout);
19 window.requestIdleCallback(t.step_func(g), {timeout:300}); 19 window.requestIdleCallback(t.step_func(g), {timeout:300});
20 20
21 var d = Date.now() + 500; 21 var d = Date.now() + 500;
22 while (Date.now() < d) { 22 while (Date.now() < d) {
23 23
24 } 24 }
25 } 25 }
26 window.requestIdleCallback(t.step_func(f)); 26 window.requestIdleCallback(t.step_func(f));
27 }, "requestIdleCallback callback should time out"); 27 }, "requestIdleCallback callback should time out");
28
29 async_test(function (t) {
30 assert_false(document.hidden, "document.hidden must exist and be false to ru n this test properly");
31 function g(deadline) {
32 assert_false(deadline.didTimeout)
33 t.done();
34 }
35
36 function f(deadline) {
37 assert_false(deadline.didTimeout);
38 window.requestIdleCallback(t.step_func(g), {timeout:100000});
39 }
40 window.requestIdleCallback(t.step_func(f));
41 }, "requestIdleCallback callback should not time out");
42
28 </script> 43 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698