3 <script src=/resources/testharness.js
></script>
4 <script src=/resources/testharnessreport.js
></script>
5 <script src=/feature-policy/resources/featurepolicy.js
></script>
9 const base_src
= '/feature-policy/resources/redirect-on-load.html#';
10 const sub
= 'https://{{domains[www]}}:{{ports[https][0]}}';
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
;
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.');
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.');
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.');
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.');