Bug 1539614 [wpt PR 16077] - HTML: move textarea tests together, a=testonly
[gecko.git] / testing / web-platform / tests / idle-detection / idle-detection-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
blob6129ba12fa45090a8da80b27cecd3bd28232547c
1 <!DOCTYPE html>
2 <body>
3 <script src=/resources/testharness.js></script>
4 <script src=/resources/testharnessreport.js></script>
5 <script src=/feature-policy/resources/featurepolicy.js></script>
6 <script>
7 'use strict';
9 const base_src = '/feature-policy/resources/redirect-on-load.html#';
10 const sub = 'https://{{domains[www]}}:{{ports[https][0]}}';
11 const relative_path =
12 '/feature-policy/resources/feature-policy-idle-detection.html';
13 const relative_worker_frame_path =
14 '/feature-policy/resources/feature-policy-idle-detection-worker.html';
15 const same_origin_src = base_src + relative_path;
16 const same_origin_worker_frame_src = base_src + relative_worker_frame_path;
17 const cross_origin_src = base_src + sub + relative_path;
18 const cross_origin_worker_frame_src = base_src + sub +
19 relative_worker_frame_path;
21 async_test(t => {
22 test_feature_availability('new IdleDetector().start()', t, same_origin_src,
23 expect_feature_available_default, 'idle-detection');
24 }, 'Attribute allow="idle-detection" in top-level frame ' +
25 'allows same-origin relocation.');
27 async_test(t => {
28 test_feature_availability('new IdleDetector().start()', t, same_origin_worker_frame_src,
29 expect_feature_available_default, 'idle-detection');
30 }, 'Attribute allow="idle-detection" in top-level frame ' +
31 'allows workers in same-origin relocation.');
33 async_test(t => {
34 test_feature_availability('new IdleDetector().start()', t, cross_origin_src,
35 expect_feature_unavailable_default, 'idle-detection');
36 }, 'Attribute allow="idle-detection" in top-level frame ' +
37 'disallows cross-origin relocation.');
39 async_test(t => {
40 test_feature_availability('new IdleDetector().start()', t, cross_origin_worker_frame_src,
41 expect_feature_unavailable_default, 'idle-detection');
42 }, 'Attribute allow="idle-detection" in top-level frame ' +
43 'disallows workers in cross-origin relocation.');
45 </script>
46 </body>