aboutsummaryrefslogtreecommitdiffstats
path: root/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js')
-rw-r--r--tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js b/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js
index df547570a78..c31faff8fcb 100644
--- a/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js
+++ b/tests/wpt/web-platform-tests/idle-detection/basics.tentative.https.any.js
@@ -24,7 +24,7 @@ promise_test(async t => {
new IdleDetector({
get threshold() {
used = true;
- return 1;
+ return 60;
}
});
@@ -34,7 +34,7 @@ promise_test(async t => {
promise_test(async t => {
try {
new IdleDetector({threshold: 0});
- assert_unreached('Threshold of 0 should reject');
+ assert_unreached('Threshold under 60 should reject');
} catch (error) {
assert_equals(error.name, 'TypeError');
}
@@ -42,6 +42,23 @@ promise_test(async t => {
promise_test(async t => {
try {
+ new IdleDetector({threshold: 59});
+ assert_unreached('Threshold under 60 should reject');
+ } catch (error) {
+ assert_equals(error.name, 'TypeError');
+ }
+}, 'constructor throws with threshold below minimum (59)');
+
+promise_test(async t => {
+ new IdleDetector({threshold: 60});
+}, 'constructor allows threshold (60)');
+
+promise_test(async t => {
+ new IdleDetector({threshold: 61});
+}, 'constructor allows threshold (61)');
+
+promise_test(async t => {
+ try {
new IdleDetector({threshold: null});
assert_unreached('Threshold of null should reject');
} catch (error) {
@@ -75,4 +92,3 @@ promise_test(async t => {
new IdleDetector({threshold: undefined});
}, 'constructor uses a default value for the threshold');
-