From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../tests/requestidlecallback/META.yml | 4 + .../tests/requestidlecallback/basic.html | 53 ++++++++++++ .../requestidlecallback/callback-exception.html | 22 +++++ .../requestidlecallback/callback-idle-periods.html | 44 ++++++++++ .../tests/requestidlecallback/callback-iframe.html | 18 +++++ .../requestidlecallback/callback-invoked.html | 13 +++ .../callback-multiple-calls.html | 46 +++++++++++ .../callback-removed-frame.html | 30 +++++++ .../requestidlecallback/callback-suspended.html | 94 ++++++++++++++++++++++ .../callback-timeRemaining-cross-realm-method.html | 25 ++++++ .../callback-timeout-when-busy.html | 70 ++++++++++++++++ .../requestidlecallback/callback-timeout.html | 44 ++++++++++ .../requestidlecallback/callback-xhr-sync.html | 17 ++++ .../tests/requestidlecallback/cancel-invoked.html | 32 ++++++++ .../deadline-after-expired-timer.html | 22 +++++ .../deadline-max-rAF-dynamic.html | 31 +++++++ .../requestidlecallback/deadline-max-rAF.html | 21 +++++ .../deadline-max-timeout-dynamic.html | 31 +++++++ .../tests/requestidlecallback/deadline-max.html | 20 +++++ .../tests/requestidlecallback/idlharness.window.js | 24 ++++++ .../resources/post_name_on_load.html | 7 ++ .../requestidlecallback/resources/ric-utils.js | 14 ++++ 22 files changed, 682 insertions(+) create mode 100644 testing/web-platform/tests/requestidlecallback/META.yml create mode 100644 testing/web-platform/tests/requestidlecallback/basic.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-exception.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-idle-periods.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-iframe.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-invoked.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-multiple-calls.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-removed-frame.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-suspended.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-timeout-when-busy.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-timeout.html create mode 100644 testing/web-platform/tests/requestidlecallback/callback-xhr-sync.html create mode 100644 testing/web-platform/tests/requestidlecallback/cancel-invoked.html create mode 100644 testing/web-platform/tests/requestidlecallback/deadline-after-expired-timer.html create mode 100644 testing/web-platform/tests/requestidlecallback/deadline-max-rAF-dynamic.html create mode 100644 testing/web-platform/tests/requestidlecallback/deadline-max-rAF.html create mode 100644 testing/web-platform/tests/requestidlecallback/deadline-max-timeout-dynamic.html create mode 100644 testing/web-platform/tests/requestidlecallback/deadline-max.html create mode 100644 testing/web-platform/tests/requestidlecallback/idlharness.window.js create mode 100644 testing/web-platform/tests/requestidlecallback/resources/post_name_on_load.html create mode 100644 testing/web-platform/tests/requestidlecallback/resources/ric-utils.js (limited to 'testing/web-platform/tests/requestidlecallback') diff --git a/testing/web-platform/tests/requestidlecallback/META.yml b/testing/web-platform/tests/requestidlecallback/META.yml new file mode 100644 index 0000000000..9c829d3c88 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/META.yml @@ -0,0 +1,4 @@ +spec: https://w3c.github.io/requestidlecallback/ +suggested_reviewers: + - farre + - rmcilroy diff --git a/testing/web-platform/tests/requestidlecallback/basic.html b/testing/web-platform/tests/requestidlecallback/basic.html new file mode 100644 index 0000000000..df9c9ef977 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/basic.html @@ -0,0 +1,53 @@ + +window.requestIdleCallback exists + + + + +

Basic requestIdleCallback Tests

+
diff --git a/testing/web-platform/tests/requestidlecallback/callback-exception.html b/testing/web-platform/tests/requestidlecallback/callback-exception.html new file mode 100644 index 0000000000..fecda221de --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-exception.html @@ -0,0 +1,22 @@ + + +requestIdleCallback callback exception reported to error handler + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/callback-idle-periods.html b/testing/web-platform/tests/requestidlecallback/callback-idle-periods.html new file mode 100644 index 0000000000..3c2de61bfe --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-idle-periods.html @@ -0,0 +1,44 @@ + +window.requestIdleCallback callback behavior during idle periods. + + + + + +

Test of requestIdleCallback idle period behavior

+

This test validates that window.requestIdleCallback deals with callbacks during idle periods correctly.

+
diff --git a/testing/web-platform/tests/requestidlecallback/callback-iframe.html b/testing/web-platform/tests/requestidlecallback/callback-iframe.html new file mode 100644 index 0000000000..8ec08a804a --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-iframe.html @@ -0,0 +1,18 @@ + + + + + + +
+ + diff --git a/testing/web-platform/tests/requestidlecallback/callback-invoked.html b/testing/web-platform/tests/requestidlecallback/callback-invoked.html new file mode 100644 index 0000000000..dc52f1422b --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-invoked.html @@ -0,0 +1,13 @@ + + + +requestIdleCallback callback must be called eventually + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/callback-multiple-calls.html b/testing/web-platform/tests/requestidlecallback/callback-multiple-calls.html new file mode 100644 index 0000000000..7bb524beb4 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-multiple-calls.html @@ -0,0 +1,46 @@ + + +multiple calls to requestIdleCallback + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/callback-removed-frame.html b/testing/web-platform/tests/requestidlecallback/callback-removed-frame.html new file mode 100644 index 0000000000..ca63f68f8a --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-removed-frame.html @@ -0,0 +1,30 @@ + + +requestIdleCallback on removed frame shouldn't call back + + + diff --git a/testing/web-platform/tests/requestidlecallback/callback-suspended.html b/testing/web-platform/tests/requestidlecallback/callback-suspended.html new file mode 100644 index 0000000000..511ec128d6 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-suspended.html @@ -0,0 +1,94 @@ + + +Dispatching idle callbacks should be able to be suspended and then resumed + + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html b/testing/web-platform/tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html new file mode 100644 index 0000000000..383479d64a --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-timeRemaining-cross-realm-method.html @@ -0,0 +1,25 @@ + + + +IdleDeadline::timeRemaining() uses relevant global object as a high-res timestamp origin + + + + + + diff --git a/testing/web-platform/tests/requestidlecallback/callback-timeout-when-busy.html b/testing/web-platform/tests/requestidlecallback/callback-timeout-when-busy.html new file mode 100644 index 0000000000..39e17f7b73 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-timeout-when-busy.html @@ -0,0 +1,70 @@ + +window.requestIdleCallback deals with timeouts correctly + + + + + +

Test of requestIdleCallback timeout behavior

+
diff --git a/testing/web-platform/tests/requestidlecallback/callback-timeout.html b/testing/web-platform/tests/requestidlecallback/callback-timeout.html new file mode 100644 index 0000000000..248864f3a1 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-timeout.html @@ -0,0 +1,44 @@ + + +requestIdleCallback timeout callback must be called with didTimeout equal to true + + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/callback-xhr-sync.html b/testing/web-platform/tests/requestidlecallback/callback-xhr-sync.html new file mode 100644 index 0000000000..d0aa5d28d6 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/callback-xhr-sync.html @@ -0,0 +1,17 @@ + + + + + + + diff --git a/testing/web-platform/tests/requestidlecallback/cancel-invoked.html b/testing/web-platform/tests/requestidlecallback/cancel-invoked.html new file mode 100644 index 0000000000..9fb77d65dc --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/cancel-invoked.html @@ -0,0 +1,32 @@ + + +cancelling idle requests + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/deadline-after-expired-timer.html b/testing/web-platform/tests/requestidlecallback/deadline-after-expired-timer.html new file mode 100644 index 0000000000..47396ea5ed --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/deadline-after-expired-timer.html @@ -0,0 +1,22 @@ + + +The deadline after an expired timer must not be negative + + +
+ diff --git a/testing/web-platform/tests/requestidlecallback/deadline-max-rAF-dynamic.html b/testing/web-platform/tests/requestidlecallback/deadline-max-rAF-dynamic.html new file mode 100644 index 0000000000..43eebd7641 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/deadline-max-rAF-dynamic.html @@ -0,0 +1,31 @@ + +window.requestIdleCallback max idle period deadline (requestAnimationFrame). + + + + + + +

Test of requestIdleCallback deadline behavior

+

The test can pass accidentally as idle deadlines have a maximum but they can always be shorter. +It runs multiple times to expose potential failures.

+
diff --git a/testing/web-platform/tests/requestidlecallback/deadline-max-rAF.html b/testing/web-platform/tests/requestidlecallback/deadline-max-rAF.html new file mode 100644 index 0000000000..314f250254 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/deadline-max-rAF.html @@ -0,0 +1,21 @@ + +window.requestIdleCallback max idle period deadline (requestAnimationFrame). + + + + + + +

Test of requestIdleCallback deadline behavior

+

The test can pass accidentally as idle deadlines have a maximum but they can always be shorter. +It runs multiple times to expose potential failures.

+
diff --git a/testing/web-platform/tests/requestidlecallback/deadline-max-timeout-dynamic.html b/testing/web-platform/tests/requestidlecallback/deadline-max-timeout-dynamic.html new file mode 100644 index 0000000000..169e6db548 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/deadline-max-timeout-dynamic.html @@ -0,0 +1,31 @@ + +window.requestIdleCallback max idle period deadline (dynamic timoeout). + + + + + + +

Test of requestIdleCallback deadline behavior

+

The test can pass accidentally as idle deadlines have a maximum but they can always be shorter. +It runs multiple times to expose potential failures.

+
diff --git a/testing/web-platform/tests/requestidlecallback/deadline-max.html b/testing/web-platform/tests/requestidlecallback/deadline-max.html new file mode 100644 index 0000000000..e33341ac9d --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/deadline-max.html @@ -0,0 +1,20 @@ + +window.requestIdleCallback max idle period deadline. + + + + + + +

Test of requestIdleCallback deadline behavior

+

This test validates that deadlines returned for requestIdleCallback are less than 50ms.

+

The test can pass accidentally as idle deadlines have a maximum but they can always be shorter. +It runs multiple times to expose potential failures.

+
diff --git a/testing/web-platform/tests/requestidlecallback/idlharness.window.js b/testing/web-platform/tests/requestidlecallback/idlharness.window.js new file mode 100644 index 0000000000..69cd5a49b0 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/idlharness.window.js @@ -0,0 +1,24 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +// https://w3c.github.io/requestidlecallback/ + +'use strict'; + +idl_test( + ['requestidlecallback'], + ['html', 'dom'], + async idl_array => { + idl_array.add_objects({ + IdleDeadline: ['deadline'], + Window: ['window'], + }); + + await new Promise(resolve => { + requestIdleCallback(d => { + self.deadline = d; + resolve(); + }, { timeout: 100 }); + }); + } +); diff --git a/testing/web-platform/tests/requestidlecallback/resources/post_name_on_load.html b/testing/web-platform/tests/requestidlecallback/resources/post_name_on_load.html new file mode 100644 index 0000000000..4679a6e6ec --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/resources/post_name_on_load.html @@ -0,0 +1,7 @@ + + diff --git a/testing/web-platform/tests/requestidlecallback/resources/ric-utils.js b/testing/web-platform/tests/requestidlecallback/resources/ric-utils.js new file mode 100644 index 0000000000..d6d22767a9 --- /dev/null +++ b/testing/web-platform/tests/requestidlecallback/resources/ric-utils.js @@ -0,0 +1,14 @@ +function getDeadlineForNextIdleCallback() { + return new Promise( + resolve => + requestIdleCallback(deadline => resolve(deadline.timeRemaining())) + ); +} + +function getPendingRenderDeadlineCap() { + return 1000 / 60; +} + +function getRICRetryCount() { + return 10; +} \ No newline at end of file -- cgit v1.2.3