Bug 1625182 [wpt PR 22472] - [wakelock] Rename feature policy, a=testonly
authorWanming Lin <wanming.lin@intel.com>
Tue, 31 Mar 2020 12:21:40 +0000
changeset 521768 29ef17e194d1fa9d85e52a5d002eb0a10ed5e2ec
parent 521767 eea1a227072f69c8cab9d462e26f5ad6943a9ce0
child 521769 a08a9099aececc4d7a534506410999f0a9b341a1
push id37275
push usershindli@mozilla.com
push dateFri, 03 Apr 2020 01:02:14 +0000
treeherdermozilla-central@cc22d5fa870b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1625182, 22472, 1064685, 2119886, 754385
milestone76.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 1625182 [wpt PR 22472] - [wakelock] Rename feature policy, a=testonly Automatic update from web-platform-tests [wakelock] Rename feature policy This CL renames "wake-lock" to "screen-wake-lock" in policy-controlled feature specific for screen wake lock, and leaves system wake lock's policy control as allowed by default because its associated feature policy is not defined yet. Spec changes at: https://github.com/w3c/wake-lock/pull/255 Bug: 1064685 Change-Id: I7701a532a7688d708a75aedafc8713d671da6e2b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2119886 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Commit-Queue: Wanming Lin <wanming.lin@intel.com> Cr-Commit-Position: refs/heads/master@{#754385} -- wpt-commits: c84b772463db711a9913594f17c7e3407841aece wpt-pr: 22472
testing/web-platform/tests/feature-policy/resources/feature-policy-screen-wakelock.html
testing/web-platform/tests/feature-policy/resources/feature-policy-wakelock.html
testing/web-platform/tests/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html
testing/web-platform/tests/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers
testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html
testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html
testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html
testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers
testing/web-platform/tests/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html
testing/web-platform/tests/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers
testing/web-platform/tests/wake-lock/wakelock-supported-by-feature-policy.html
rename from testing/web-platform/tests/feature-policy/resources/feature-policy-wakelock.html
rename to testing/web-platform/tests/feature-policy/resources/feature-policy-screen-wakelock.html
--- a/testing/web-platform/tests/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html
@@ -2,35 +2,35 @@
 <body>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/feature-policy/resources/featurepolicy.js"></script>
 <script>
   "use strict";
 
   const same_origin_src =
-    "/feature-policy/resources/feature-policy-wakelock.html";
+    "/feature-policy/resources/feature-policy-screen-wakelock.html";
   const cross_origin_src =
     "https://{{domains[www]}}:{{ports[https][0]}}" + same_origin_src;
 
   promise_test(t => {
     return promise_rejects_dom(t, "NotAllowedError", navigator.wakeLock.request("screen"));
-  }, 'Feature-Policy header {"wake-lock" : []} disallows the top-level document.');
+  }, 'Feature-Policy header {"screen-wake-lock" : []} disallows the top-level document.');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       same_origin_src,
       expect_feature_unavailable_default
     );
-  }, 'Feature-Policy header {"wake-lock" : []} disallows same-origin iframes.');
+  }, 'Feature-Policy header {"screen-wake-lock" : []} disallows same-origin iframes.');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       cross_origin_src,
       expect_feature_unavailable_default
     );
-  }, 'Feature-Policy header {"wake-lock" : []} disallows cross-origin iframes.');
+  }, 'Feature-Policy header {"screen-wake-lock" : []} disallows cross-origin iframes.');
 </script>
 </body>
--- a/testing/web-platform/tests/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers
+++ b/testing/web-platform/tests/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers
@@ -1,1 +1,1 @@
-Feature-Policy: wake-lock 'none'
+Feature-Policy: screen-wake-lock 'none'
--- a/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html
@@ -1,36 +1,36 @@
 <!DOCTYPE html>
 <body>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/feature-policy/resources/featurepolicy.js"></script>
 <script>
   "use strict";
 
-  const relative_path = "/feature-policy/resources/feature-policy-wakelock.html";
+  const relative_path = "/feature-policy/resources/feature-policy-screen-wakelock.html";
   const base_src = "/feature-policy/resources/redirect-on-load.html#";
   const same_origin_src = base_src + relative_path;
   const cross_origin_src =
     base_src + "https://{{domains[www]}}:{{ports[https][0]}}" + relative_path;
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       same_origin_src,
       expect_feature_available_default,
-      "wake-lock"
+      "screen-wake-lock"
     );
-  }, 'Feature-Policy allow="wake-lock" allows same-origin relocation');
+  }, 'Feature-Policy allow="screen-wake-lock" allows same-origin relocation');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       cross_origin_src,
       expect_feature_unavailable_default,
-      "wake-lock"
+      "screen-wake-lock"
     );
-  }, 'Feature-Policy allow="wake-lock" disallows cross-origin relocation');
+  }, 'Feature-Policy allow="screen-wake-lock" disallows cross-origin relocation');
 
 </script>
 </body>
--- a/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html
@@ -2,33 +2,33 @@
 <body>
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script src="/feature-policy/resources/featurepolicy.js"></script>
 <script>
   "use strict";
 
   const same_origin_src =
-    "/feature-policy/resources/feature-policy-wakelock.html";
+    "/feature-policy/resources/feature-policy-screen-wakelock.html";
   const cross_origin_src =
     "https://{{domains[www]}}:{{ports[https][0]}}" + same_origin_src;
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       same_origin_src,
       expect_feature_available_default,
-      "wake-lock"
+      "screen-wake-lock"
     );
-  }, 'Feature policy "wake-lock" can be enabled in same-origin iframe using allow="wake-lock" attribute');
+  }, 'Feature policy "screen-wake-lock" can be enabled in same-origin iframe using allow="screen-wake-lock" attribute');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       cross_origin_src,
       expect_feature_available_default,
-      "wake-lock"
+      "screen-wake-lock"
     );
-  }, 'Feature policy "wake-lock" can be enabled in cross-origin iframe using allow="wake-lock" attribute');
+  }, 'Feature policy "screen-wake-lock" can be enabled in cross-origin iframe using allow="screen-wake-lock" attribute');
 </script>
 </body>
--- a/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html
@@ -4,38 +4,38 @@
 <script src="/resources/testharnessreport.js"></script>
 <script src="/resources/testdriver.js"></script>
 <script src="/resources/testdriver-vendor.js"></script>
 <script src="/feature-policy/resources/featurepolicy.js"></script>
 <script>
   "use strict";
 
   const same_origin_src =
-    "/feature-policy/resources/feature-policy-wakelock.html";
+    "/feature-policy/resources/feature-policy-screen-wakelock.html";
   const cross_origin_src =
     "https://{{domains[www]}}:{{ports[https][0]}}" + same_origin_src;
 
   promise_test(async t => {
     await test_driver.set_permission(
         { name: 'wake-lock', type: 'screen' }, 'granted', false);
     await navigator.wakeLock.request('screen').then(lock => lock.release());
-  }, 'Feature-Policy header {"wake-lock" : ["*"]} allows the top-level document.');
+  }, 'Feature-Policy header {"screen-wake-lock" : ["*"]} allows the top-level document.');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       same_origin_src,
       expect_feature_available_default
     );
-  }, 'Feature-Policy header {"wake-lock" : ["*"]} allows same-origin iframes.');
+  }, 'Feature-Policy header {"screen-wake-lock" : ["*"]} allows same-origin iframes.');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       cross_origin_src,
       expect_feature_available_default
     );
-  }, 'Feature-Policy header {"wake-lock" : ["*"]} allows cross-origin iframes.');
+  }, 'Feature-Policy header {"screen-wake-lock" : ["*"]} allows cross-origin iframes.');
 
 </script>
 </body>
--- a/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers
+++ b/testing/web-platform/tests/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers
@@ -1,1 +1,1 @@
-Feature-Policy: wake-lock *
+Feature-Policy: screen-wake-lock *
--- a/testing/web-platform/tests/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html
@@ -5,37 +5,37 @@
 <script src="/resources/testdriver.js"></script>
 <script src="/resources/testdriver-vendor.js"></script>
 <script src="/feature-policy/resources/featurepolicy.js"></script>
 
 <script>
   "use strict";
 
   const same_origin_src =
-    "/feature-policy/resources/feature-policy-wakelock.html";
+    "/feature-policy/resources/feature-policy-screen-wakelock.html";
   const cross_origin_src =
     "https://{{domains[www]}}:{{ports[https][0]}}" + same_origin_src;
 
   promise_test(async t => {
     await test_driver.set_permission(
         { name: 'wake-lock', type: 'screen' }, 'granted', false);
     await navigator.wakeLock.request('screen').then(lock => lock.release());
-  }, 'Feature-Policy header wake-lock "self" allows the top-level document.');
+  }, 'Feature-Policy header screen-wake-lock "self" allows the top-level document.');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       same_origin_src,
       expect_feature_available_default
     );
-  }, 'Feature-Policy header wake-lock "self" allows same-origin iframes.');
+  }, 'Feature-Policy header screen-wake-lock "self" allows same-origin iframes.');
 
   async_test(t => {
     test_feature_availability(
       'navigator.wakeLock.request("screen")',
       t,
       cross_origin_src,
       expect_feature_unavailable_default
     );
-  }, 'Feature-Policy header wake-lock "self" disallows cross-origin iframes.');
+  }, 'Feature-Policy header screen-wake-lock "self" disallows cross-origin iframes.');
 </script>
 </body>
--- a/testing/web-platform/tests/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers
+++ b/testing/web-platform/tests/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers
@@ -1,1 +1,1 @@
-Feature-Policy: wake-lock 'self'
+Feature-Policy: screen-wake-lock 'self'
--- a/testing/web-platform/tests/wake-lock/wakelock-supported-by-feature-policy.html
+++ b/testing/web-platform/tests/wake-lock/wakelock-supported-by-feature-policy.html
@@ -1,11 +1,11 @@
 <!DOCTYPE html>
 <title>Test that wake-lock is advertised in the feature list</title>
 <link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features">
 <link rel="help" href="https://w3c.github.io/wake-lock/#dfn-wake-lock-feature">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 <script>
 test(() => {
-    assert_in_array('wake-lock', document.featurePolicy.features());
-}, 'document.featurePolicy.features should advertise wake-lock.');
+    assert_in_array('screen-wake-lock', document.featurePolicy.features());
+}, 'document.featurePolicy.features should advertise screen-wake-lock.');
 </script>