Bug 1634807 [wpt PR 23344] - Split feature-policy-frame-policy-allowed-for-some.https.sub.html, a=testonly
authorCharlie Hu <chenleihu@google.com>
Wed, 13 May 2020 03:59:20 +0000
changeset 531030 a39a67bd0d28fd8e0416b9ec1727a0eef56023ae
parent 531029 1b85f5c60a6eb8ee5ea294056847e84001feba87
child 531031 948917a5d1c6ab09635f83729bb26521607907a0
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1634807, 23344, 1067391, 2169757, 764788
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1634807 [wpt PR 23344] - Split feature-policy-frame-policy-allowed-for-some.https.sub.html, a=testonly Automatic update from web-platform-tests Split feature-policy-frame-policy-allowed-for-some.https.sub.html The wpt test was flaky because it has too much content: all 108 subtests live in a single test file, which causes the test sometimes exceed the timeout limit(30s). The solution to resolve this flakiness is to split this big test file into smaller ones, so that each of them can have less content. Bug: 1067391 Change-Id: Ib6ed1469895a76cff43c7e33dd24809242859044 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2169757 Reviewed-by: Ian Clelland <iclelland@chromium.org> Commit-Queue: Charlie Hu <chenleihu@google.com> Cr-Commit-Position: refs/heads/master@{#764788} -- wpt-commits: 795e198205d20d865622e35f59c9e7d93e85601b wpt-pr: 23344
testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some-override.https.sub.html
testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some-override.https.sub.html.sub.headers
testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some.https.sub.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some-override.https.sub.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta name="timeout" content="long">
+  <script src=/resources/testharness.js></script>
+  <script src=/resources/testharnessreport.js></script>
+</head>
+<body>
+  <script src=/feature-policy/resources/featurepolicy.js></script>
+  <!-- Feature-Policy: fullscreen 'self' cross_origin https://www.example.com; -->
+  <script>
+  'use strict';
+  var same_origin = 'https://{{domains[]}}:{{ports[https][0]}}';
+  var cross_origin = 'https://{{domains[www]}}:{{ports[https][0]}}';
+  var cross_origin1 = 'https://{{domains[www1]}}:{{ports[https][0]}}';
+  var same_origin_src = '/feature-policy/resources/feature-policy-allowedfeatures.html';
+  var cross_origin_src = cross_origin + same_origin_src;
+  var cross_origin_src1 = cross_origin1 + same_origin_src;
+  var data_src = 'data:text/html,<h1>data: URL</h1>';
+  // Test feature policy with same_origin_src and cross_origin_src.
+  var policies = [
+    {allow: "*", sameOriginTestExpect: true, crossOriginTestExpect: true, crossOrigin1TestExpect: true, dataOriginTestExpect: false},
+    {allow: "'self'", sameOriginTestExpect: true, crossOriginTestExpect: false, crossOrigin1TestExpect: false, dataOriginTestExpect: false},
+    {allow: "'none'", sameOriginTestExpect: false, crossOriginTestExpect: false, crossOrigin1TestExpect: false, dataOriginTestExpect: false},
+    {allow: "'self' " + cross_origin + " https://www.example.com", sameOriginTestExpect: true, crossOriginTestExpect: true, crossOrigin1TestExpect: false, dataOriginTestExpect: false}];
+
+  // Test that the allow attribute overrides allowfullscreen.
+  for (var i = 0; i < policies.length; i++) {
+    test(function() {
+      test_frame_policy(
+        'fullscreen', same_origin_src, undefined,
+        policies[i].sameOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on same origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', cross_origin_src, undefined,
+        policies[i].crossOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on cross origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', cross_origin_src1, undefined,
+        policies[i].crossOrigin1TestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on another cross origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', undefined, true, policies[i].sameOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on srcdoc iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', same_origin_src, true, policies[i].sameOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on srcdoc + same origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', cross_origin_src, true, policies[i].sameOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on srcdoc + cross origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', cross_origin_src1, true, policies[i].sameOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on srcdoc + another cross origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+    test(function() {
+      test_frame_policy(
+        'fullscreen', data_src, undefined, policies[i].dataOriginTestExpect,
+        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
+    }, 'Test frame policy on data: URL cross origin iframe with allow = "' + policies[i].allow +
+       '" and allowfullscreen.');
+  }
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some-override.https.sub.html.sub.headers
@@ -0,0 +1,1 @@
+Feature-Policy: fullscreen 'self' https://{{domains[www]}}:{{ports[https][0]}} https://www.example.com;
--- a/testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some.https.sub.html
+++ b/testing/web-platform/tests/feature-policy/feature-policy-frame-policy-allowed-for-some.https.sub.html
@@ -126,66 +126,11 @@
           'fullscreen',
           cross_origin_src1 + pipe_front + header_policies[j] + pipe_end,
           undefined, policies[i].crossOrigin1TestExpect,
           'fullscreen ' + policies[i].allow + ';');
       }, 'Test frame policy on another cross origin iframe with allow = "' + policies[i].allow +
          '" and header policy = "Feature-Policy: fullscreen ' + header_policies[j] + ';".');
     }
   }
-
-  // Test that the allow attribute overrides allowfullscreen.
-  for (var i = 0; i < policies.length; i++) {
-    test(function() {
-      test_frame_policy(
-        'fullscreen', same_origin_src, undefined,
-        policies[i].sameOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on same origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', cross_origin_src, undefined,
-        policies[i].crossOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on cross origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', cross_origin_src1, undefined,
-        policies[i].crossOrigin1TestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on another cross origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', undefined, true, policies[i].sameOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on srcdoc iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', same_origin_src, true, policies[i].sameOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on srcdoc + same origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', cross_origin_src, true, policies[i].sameOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on srcdoc + cross origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', cross_origin_src1, true, policies[i].sameOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on srcdoc + another cross origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-    test(function() {
-      test_frame_policy(
-        'fullscreen', data_src, undefined, policies[i].dataOriginTestExpect,
-        'fullscreen ' + policies[i].allow + ';', /*allowfullscreen*/true);
-    }, 'Test frame policy on data: URL cross origin iframe with allow = "' + policies[i].allow +
-       '" and allowfullscreen.');
-  }
   </script>
 </body>
 </html>