forked from mirrors/gecko-dev
Automatic update from web-platform-tests [idle] Port to the IdleDetector API This is a minimal/incomplete/incremental port from the existing API to the IdleDetector API under consideration. https://github.com/w3ctag/design-reviews/issues/336#issuecomment-470077151 I'm trying to keep this baseline deliberately small, so we can introduce the other parts of the API incrementally. Change-Id: I4db6c67c561d397f1b027bc7c5524c5f8af17715 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1512681 Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Sam Goto <goto@chromium.org> Cr-Commit-Position: refs/heads/master@{#642648} -- wpt-commits: 6e129aedfa10bbd9801fe25f8e401d251964afe2 wpt-pr: 15829
42 lines
1.8 KiB
HTML
42 lines
1.8 KiB
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/feature-policy/resources/featurepolicy.js></script>
|
|
<script>
|
|
'use strict';
|
|
|
|
const sub = 'https://{{domains[www]}}:{{ports[https][0]}}';
|
|
const same_origin_src =
|
|
'/feature-policy/resources/feature-policy-idle-detection.html'
|
|
const same_origin_worker_frame_src =
|
|
'/feature-policy/resources/feature-policy-idle-detection-worker.html';
|
|
const cross_origin_src = sub + same_origin_src;
|
|
const cross_origin_worker_frame_src = sub + same_origin_worker_frame_src;
|
|
|
|
async_test(t => {
|
|
test_feature_availability('new IdleDetector().start()', t, same_origin_src,
|
|
expect_feature_available_default, 'idle-detection');
|
|
}, 'Attribute allow="idle-detection" in top-level frame can be enabled ' +
|
|
'in same-origin iframe using Feature policy "idle-detection".');
|
|
|
|
async_test(t => {
|
|
test_feature_availability('new IdleDetector().start()', t, same_origin_worker_frame_src,
|
|
expect_feature_available_default, 'idle-detection');
|
|
}, 'Attribute allow="idle-detection" in top-level frame can be enabled ' +
|
|
'in a worker in same-origin iframe using Feature policy "idle-detection".');
|
|
|
|
async_test(t => {
|
|
test_feature_availability('new IdleDetector().start()', t, cross_origin_src,
|
|
expect_feature_available_default, 'idle-detection');
|
|
}, 'Attribute allow="idle-detection" in top-level frame can be enabled ' +
|
|
'in cross-origin iframe using Feature policy "idle-detection".');
|
|
|
|
async_test(t => {
|
|
test_feature_availability('new IdleDetector().start()', t, cross_origin_worker_frame_src,
|
|
expect_feature_available_default, 'idle-detection');
|
|
}, 'Attribute allow="idle-detection" in top-level frame can be enabled ' +
|
|
'in a worker in cross-origin iframe using Feature policy "idle-detection".');
|
|
|
|
</script>
|
|
</body>
|