[wake-lock] Rename wpt/wake-lock to wpt/screen-wake-lock
WPT test directories should named after the shortname of the spec,
this CL renames wpt/wake-lock to wpt/screen-wake-lock and moves
system wake lock related tests to web_tests/wake-lock since
there's no w3c spec for system wake lock at present.
This CL also moves the idlharness tests for system wake lock
to wpt_internal/system-wake-lock to use wptserve.
Relevant spec issue: https://github.com/w3c/screen-wake-lock/issues/257
Bug: 1064685
Change-Id: I77939065ca82257fc261dcdfd07c9e7608fc9c92
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147352
Commit-Queue: Wanming Lin <wanming.lin@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Robert Ma <robertma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760380}
diff --git a/interfaces/wake-lock.idl b/interfaces/screen-wake-lock.idl
similarity index 88%
rename from interfaces/wake-lock.idl
rename to interfaces/screen-wake-lock.idl
index 429b80e..1eb30a0 100644
--- a/interfaces/wake-lock.idl
+++ b/interfaces/screen-wake-lock.idl
@@ -1,7 +1,7 @@
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into reffy-reports
// (https://github.com/tidoust/reffy-reports)
-// Source: Screen Wake Lock API (https://w3c.github.io/wake-lock/)
+// Source: Screen Wake Lock API (https://w3c.github.io/screen-wake-lock/)
[SecureContext]
partial interface Navigator {
diff --git a/wake-lock/META.yml b/screen-wake-lock/META.yml
similarity index 61%
rename from wake-lock/META.yml
rename to screen-wake-lock/META.yml
index 0123cce..b311993 100644
--- a/wake-lock/META.yml
+++ b/screen-wake-lock/META.yml
@@ -1,4 +1,4 @@
-spec: https://w3c.github.io/wake-lock/
+spec: https://w3c.github.io/screen-wake-lock/
suggested_reviewers:
- Honry
- marcoscaceres
diff --git a/wake-lock/idlharness.https.window.js b/screen-wake-lock/idlharness.https.window.js
similarity index 92%
rename from wake-lock/idlharness.https.window.js
rename to screen-wake-lock/idlharness.https.window.js
index 60c25f3..370696e 100644
--- a/wake-lock/idlharness.https.window.js
+++ b/screen-wake-lock/idlharness.https.window.js
@@ -8,8 +8,8 @@
'use strict';
idl_test(
- ['wake-lock'],
- ['dom', 'html', 'permissions'],
+ ['screen-wake-lock'],
+ ['dom', 'html'],
async idl_array => {
idl_array.add_objects({ Navigator: ['navigator'] });
diff --git a/wake-lock/resources/page1.html b/screen-wake-lock/resources/page1.html
similarity index 100%
rename from wake-lock/resources/page1.html
rename to screen-wake-lock/resources/page1.html
diff --git a/wake-lock/resources/page2.html b/screen-wake-lock/resources/page2.html
similarity index 100%
rename from wake-lock/resources/page2.html
rename to screen-wake-lock/resources/page2.html
diff --git a/wake-lock/wakelock-active-document.https.window.js b/screen-wake-lock/wakelock-active-document.https.window.js
similarity index 91%
rename from wake-lock/wakelock-active-document.https.window.js
rename to screen-wake-lock/wakelock-active-document.https.window.js
index 53745ea..724ce09 100644
--- a/wake-lock/wakelock-active-document.https.window.js
+++ b/screen-wake-lock/wakelock-active-document.https.window.js
@@ -18,14 +18,14 @@
// We first got to page1.html, grab a WakeLock object.
const wakeLock1 = await getWakeLockObject(
iframe,
- "/wake-lock/resources/page1.html"
+ "/screen-wake-lock/resources/page1.html"
);
// Save the DOMException of page1.html before navigating away.
const frameDOMException1 = iframe.contentWindow.DOMException;
// We navigate the iframe again, putting wakeLock1's document into an inactive state.
const wakeLock2 = await getWakeLockObject(
iframe,
- "/wake-lock/resources/page2.html"
+ "/screen-wake-lock/resources/page2.html"
);
// Now, wakeLock1's relevant global object's document is no longer active.
// So, call .request(), and make sure it rejects appropriately.
@@ -47,7 +47,7 @@
// Load the outer iframe (we don't care about the awaited request)
await getWakeLockObject(
outerIframe,
- "/wake-lock/resources/page1.html"
+ "/screen-wake-lock/resources/page1.html"
);
// Now we create the inner iframe
@@ -59,7 +59,7 @@
// load innerIframe, and get the WakeLock instance
const wakeLock = await getWakeLockObject(
innerIframe,
- "/wake-lock/resources/page2.html"
+ "/screen-wake-lock/resources/page2.html"
);
// Save DOMException from innerIframe before navigating away.
const innerIframeDOMException = innerIframe.contentWindow.DOMException;
@@ -68,7 +68,7 @@
// Wait for the load event to fire.
await new Promise(resolve => {
outerIframe.addEventListener("load", resolve);
- outerIframe.src = "/wake-lock/resources/page2.html";
+ outerIframe.src = "/screen-wake-lock/resources/page2.html";
});
// Now, request's relevant global object's document is still active
diff --git a/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html b/screen-wake-lock/wakelock-disabled-by-feature-policy.https.sub.html
similarity index 100%
rename from wake-lock/wakelock-disabled-by-feature-policy.https.sub.html
rename to screen-wake-lock/wakelock-disabled-by-feature-policy.https.sub.html
diff --git a/wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers b/screen-wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers
similarity index 100%
rename from wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers
rename to screen-wake-lock/wakelock-disabled-by-feature-policy.https.sub.html.headers
diff --git a/wake-lock/wakelock-document-hidden-manual.https.html b/screen-wake-lock/wakelock-document-hidden-manual.https.html
similarity index 91%
rename from wake-lock/wakelock-document-hidden-manual.https.html
rename to screen-wake-lock/wakelock-document-hidden-manual.https.html
index 2ac6bce..550dc83 100644
--- a/wake-lock/wakelock-document-hidden-manual.https.html
+++ b/screen-wake-lock/wakelock-document-hidden-manual.https.html
@@ -2,7 +2,7 @@
<meta charset="utf-8">
<meta name="timeout" content="long">
<title>Screen wake locks respect page visibility changes</title>
-<link rel="help" href="https://w3c.github.io/wake-lock/#dfn-requesting-the-wake-lock">
+<link rel="help" href="https://w3c.github.io/screen-wake-lock/#handling-document-loss-of-visibility">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
diff --git a/wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html b/screen-wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html
similarity index 100%
rename from wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html
rename to screen-wake-lock/wakelock-enabled-by-feature-policy-attribute-redirect-on-load.https.sub.html
diff --git a/wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html b/screen-wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html
similarity index 100%
rename from wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html
rename to screen-wake-lock/wakelock-enabled-by-feature-policy-attribute.https.sub.html
diff --git a/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html b/screen-wake-lock/wakelock-enabled-by-feature-policy.https.sub.html
similarity index 100%
rename from wake-lock/wakelock-enabled-by-feature-policy.https.sub.html
rename to screen-wake-lock/wakelock-enabled-by-feature-policy.https.sub.html
diff --git a/wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers b/screen-wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers
similarity index 100%
rename from wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers
rename to screen-wake-lock/wakelock-enabled-by-feature-policy.https.sub.html.headers
diff --git a/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html b/screen-wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html
similarity index 100%
rename from wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html
rename to screen-wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html
diff --git a/wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers b/screen-wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers
similarity index 100%
rename from wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers
rename to screen-wake-lock/wakelock-enabled-on-self-origin-by-feature-policy.https.sub.html.headers
diff --git a/wake-lock/wakelock-insecure-context.any.js b/screen-wake-lock/wakelock-insecure-context.any.js
similarity index 100%
rename from wake-lock/wakelock-insecure-context.any.js
rename to screen-wake-lock/wakelock-insecure-context.any.js
diff --git a/wake-lock/wakelock-onrelease.https.html b/screen-wake-lock/wakelock-onrelease.https.html
similarity index 100%
rename from wake-lock/wakelock-onrelease.https.html
rename to screen-wake-lock/wakelock-onrelease.https.html
diff --git a/wake-lock/wakelock-request-denied.https.html b/screen-wake-lock/wakelock-request-denied.https.html
similarity index 100%
rename from wake-lock/wakelock-request-denied.https.html
rename to screen-wake-lock/wakelock-request-denied.https.html
diff --git a/wake-lock/wakelock-screen-type-on-worker.https.worker.js b/screen-wake-lock/wakelock-screen-type-on-worker.https.worker.js
similarity index 100%
rename from wake-lock/wakelock-screen-type-on-worker.https.worker.js
rename to screen-wake-lock/wakelock-screen-type-on-worker.https.worker.js
diff --git a/wake-lock/wakelock-supported-by-feature-policy.html b/screen-wake-lock/wakelock-supported-by-feature-policy.html
similarity index 100%
rename from wake-lock/wakelock-supported-by-feature-policy.html
rename to screen-wake-lock/wakelock-supported-by-feature-policy.html
diff --git a/wake-lock/wakelock-type.https.any.js b/screen-wake-lock/wakelock-type.https.any.js
similarity index 100%
rename from wake-lock/wakelock-type.https.any.js
rename to screen-wake-lock/wakelock-type.https.any.js
diff --git a/screen-wake-lock/wakelockpermissiondescriptor.https.html b/screen-wake-lock/wakelockpermissiondescriptor.https.html
new file mode 100644
index 0000000..e6d0d0b
--- /dev/null
+++ b/screen-wake-lock/wakelockpermissiondescriptor.https.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<link rel="help" href="https://w3c.github.io/screen-wake-lock/#the-screen-wake-lock-powerful-feature">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script>
+promise_test(async t => {
+ await test_driver.set_permission({name: 'screen-wake-lock'}, 'denied', false);
+
+ return navigator.permissions.query({name:'screen-wake-lock'}).then(status => {
+ assert_class_string(status, "PermissionStatus");
+ assert_equals(status.state, "denied");
+ });
+}, "PermissionDescriptor with name='screen-wake-lock' works");
+</script>
diff --git a/wake-lock/idlharness-worker.https.window.js b/wake-lock/idlharness-worker.https.window.js
deleted file mode 100644
index 76f5352..0000000
--- a/wake-lock/idlharness-worker.https.window.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// META: script=/resources/testdriver.js
-// META: script=/resources/testdriver-vendor.js
-
-// https://w3c.github.io/wake-lock/
-
-'use strict';
-
-promise_test(async t => {
- await test_driver.set_permission(
- { name: 'system-wake-lock' }, 'granted', false);
-
- await fetch_tests_from_worker(new Worker('resources/idlharness-worker.js'));
-}, 'Run idlharness tests in a worker.');
diff --git a/wake-lock/resources/idlharness-worker.js b/wake-lock/resources/idlharness-worker.js
deleted file mode 100644
index b84ed44..0000000
--- a/wake-lock/resources/idlharness-worker.js
+++ /dev/null
@@ -1,24 +0,0 @@
-'use strict';
-
-// https://w3c.github.io/wake-lock/
-
-importScripts("/resources/testharness.js");
-importScripts("/resources/WebIDLParser.js", "/resources/idlharness.js");
-
-idl_test(
- ['wake-lock'],
- ['dom', 'html', 'permissions'],
- async idl_array => {
- idl_array.add_objects({ WorkerNavigator: ['navigator'] });
-
- idl_array.add_objects({
- WakeLock: ['navigator.wakeLock'],
- WakeLockSentinel: ['sentinel'],
- });
-
- self.sentinel = await navigator.wakeLock.request('system');
- self.sentinel.release();
- }
-);
-
-done();
diff --git a/wake-lock/wakelockpermissiondescriptor.https.html b/wake-lock/wakelockpermissiondescriptor.https.html
deleted file mode 100644
index 88c9598..0000000
--- a/wake-lock/wakelockpermissiondescriptor.https.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<link rel="help" href="https://w3c.github.io/wake-lock/#the-wakelockpermissiondescriptor-dictionary">
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/resources/testdriver.js"></script>
-<script src="/resources/testdriver-vendor.js"></script>
-<script>
-promise_test(async t => {
- await test_driver.set_permission({name: 'screen-wake-lock'}, 'denied', false);
-
- return navigator.permissions.query({name:'screen-wake-lock'}).then(status => {
- assert_class_string(status, "PermissionStatus");
- assert_equals(status.state, "denied");
- });
-}, "PermissionDescriptor with name='screen-wake-lock' works");
-
-promise_test(async t => {
- await test_driver.set_permission({name: 'system-wake-lock'}, 'denied', false);
-
- return navigator.permissions.query({ name: 'system-wake-lock' }).then(status => {
- assert_class_string(status, "PermissionStatus");
- assert_equals(status.state, "denied");
- });
-}, "PermissionDescriptor with name='system-wake-lock' works");
-</script>