Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / media-elements / autoplay-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
1 <!DOCTYPE html>
2 <body>
3   <script src=/resources/testharness.js></script>
4   <script src=/resources/testharnessreport.js></script>
5   <script src=/resources/testdriver.js></script>
6   <script src=/resources/testdriver-vendor.js></script>
7   <script src=/common/media.js></script>
8   <script src=/feature-policy/resources/featurepolicy.js></script>
9   <script src=/feature-policy/resources/autoplay.js></script>
10   <script>
11   'use strict';
12   const relative_path = '/feature-policy/resources/feature-policy-autoplay.html';
13   const base_src = '/feature-policy/resources/redirect-on-load.html#';
14   const same_origin_src = base_src + relative_path;
15   const cross_origin_src = base_src + 'https://{{domains[www]}}:{{ports[https][0]}}' +
16     relative_path;
17   const header = 'Feature-Policy allow="autoplay"';
18
19   async_test(t => {
20     simulateGesture(t, () => {
21       test_feature_availability(
22           'autoplay', t, same_origin_src,
23           expect_feature_available_default, 'autoplay');
24     });
25   }, header + ' allows same-origin navigation in an iframe.');
26
27   async_test(t => {
28     simulateGesture(t, () => {
29       test_feature_availability(
30           'autoplay', t, cross_origin_src,
31           expect_feature_unavailable_default, 'autoplay');
32     });
33   }, header + ' disallows cross-origin navigation in an iframe.');
34   </script>
35 </body>