idle-detection-allowed-by-permissions-policy-attribute.https.sub.html (2148B)
1 <!DOCTYPE html> 2 <body> 3 <script src=/resources/testdriver.js></script> 4 <script src=/resources/testdriver-vendor.js></script> 5 <script src=/resources/testharness.js></script> 6 <script src=/resources/testharnessreport.js></script> 7 <script src=/permissions-policy/resources/permissions-policy.js></script> 8 <script> 9 'use strict'; 10 11 const sub = 'https://{{domains[www]}}:{{ports[https][0]}}'; 12 const same_origin_src = 13 '/permissions-policy/resources/permissions-policy-idle-detection.html' 14 const same_origin_worker_frame_src = 15 '/permissions-policy/resources/permissions-policy-idle-detection-worker.html'; 16 const cross_origin_src = sub + same_origin_src; 17 const cross_origin_worker_frame_src = sub + same_origin_worker_frame_src; 18 19 promise_setup(async () => { 20 await test_driver.set_permission({ name: 'idle-detection' }, 'granted'); 21 }); 22 23 promise_test(async t => { 24 test_feature_availability('new IdleDetector().start()', t, same_origin_src, 25 expect_feature_available_default, 'idle-detection'); 26 }, 'Attribute allow="idle-detection" in top-level frame can be enabled ' + 27 'in same-origin iframe using Permissions Policy "idle-detection".'); 28 29 promise_test(async t => { 30 test_feature_availability('new IdleDetector().start()', t, same_origin_worker_frame_src, 31 expect_feature_available_default, 'idle-detection'); 32 }, 'Attribute allow="idle-detection" in top-level frame can be enabled ' + 33 'in a worker in same-origin iframe using Permissions Policy "idle-detection".'); 34 35 promise_test(async t => { 36 test_feature_availability('new IdleDetector().start()', t, cross_origin_src, 37 expect_feature_available_default, 'idle-detection'); 38 }, 'Attribute allow="idle-detection" in top-level frame can be enabled ' + 39 'in cross-origin iframe using Permissions Policy "idle-detection".'); 40 41 promise_test(async t => { 42 test_feature_availability('new IdleDetector().start()', t, cross_origin_worker_frame_src, 43 expect_feature_available_default, 'idle-detection'); 44 }, 'Attribute allow="idle-detection" in top-level frame can be enabled ' + 45 'in a worker in cross-origin iframe using Permissions Policy "idle-detection".'); 46 47 </script> 48 </body>