From c559e3e30f79843f0096332334c81ee0d93029f8 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 18 Apr 2018 15:15:49 +0200 Subject: moebius#73: DOM - window.requestIdleCallback - improvements (basic) https://github.com/MoonchildProductions/moebius/pull/73 --- .../idle-callbacks/callback-suspended.html | 93 ++++++++++++++++++++++ .../resources/post_name_on_load.html | 7 ++ 2 files changed, 100 insertions(+) create mode 100644 testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html create mode 100644 testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html (limited to 'testing/web-platform/tests') diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html new file mode 100644 index 000000000..6040de922 --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/callback-suspended.html @@ -0,0 +1,93 @@ + + +Dispatching idle callbacks should be able to be suspended and then resumed + + +
+ diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html new file mode 100644 index 000000000..4679a6e6e --- /dev/null +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/resources/post_name_on_load.html @@ -0,0 +1,7 @@ + + -- cgit v1.2.3 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(+) (limited to 'testing/web-platform/tests') 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 From 718874cf11a06fb2a1d1b51952f24b23c24600ff Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 18 Apr 2018 15:19:52 +0200 Subject: Bug 1337814 - Add test for cancelling currently executing rIC callback --- .../tests/html/webappapis/idle-callbacks/cancel-invoked.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testing/web-platform/tests') diff --git a/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html b/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html index 8956b8709..9fb77d65d 100644 --- a/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html +++ b/testing/web-platform/tests/html/webappapis/idle-callbacks/cancel-invoked.html @@ -23,4 +23,10 @@ t.done(); }, 2000); }, "A cancelled callback is never invoked"); + + async_test(function (t) { + var handle = requestIdleCallback(t.step_func_done(function () { + cancelIdleCallback(handle); + })); + }, "Cancelling the currently executing idle callback should be allowed"); -- cgit v1.2.3 From 27e021136b6e58143f95ff3df37b58ed699e8b06 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Tue, 24 Apr 2018 11:47:08 +0200 Subject: moebius#312: DOM - Fix incorrect TypeError: Response body is given with a null body status https://github.com/MoonchildProductions/moebius/issues/312 --- testing/web-platform/tests/fetch/api/response/response-init-002.html | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'testing/web-platform/tests') diff --git a/testing/web-platform/tests/fetch/api/response/response-init-002.html b/testing/web-platform/tests/fetch/api/response/response-init-002.html index 0bb2e8d0b..a48af8336 100644 --- a/testing/web-platform/tests/fetch/api/response/response-init-002.html +++ b/testing/web-platform/tests/fetch/api/response/response-init-002.html @@ -65,6 +65,11 @@ }); }, "Testing empty Response Content-Type header"); + test(function() { + var response = new Response(null, {status: 204}); + assert_equals(response.body, null); + }, "Testing null Response body"); + -- cgit v1.2.3