From 823098279935c628f4c684a4d22eb2fe94701d89 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 18 Apr 2018 15:18:48 +0200 Subject: Bug 1334904 - Add test for when rIC timeouts doesn't need timeout --- .../html/webappapis/idle-callbacks/callback-timeout.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html index 823d5f5db..cc2660a19 100644 --- a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-timeout.html @@ -25,4 +25,19 @@ } window.requestIdleCallback(t.step_func(f)); }, "requestIdleCallback callback should time out"); + + async_test(function (t) { + assert_false(document.hidden, "document.hidden must exist and be false to run this test properly"); + function g(deadline) { + assert_false(deadline.didTimeout) + t.done(); + } + + function f(deadline) { + assert_false(deadline.didTimeout); + window.requestIdleCallback(t.step_func(g), {timeout:100000}); + } + window.requestIdleCallback(t.step_func(f)); + }, "requestIdleCallback callback should not time out"); + -- cgit v1.2.3