Testing support for "browser" value of display member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-fullscreen-manual.html b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-fullscreen-manual.html
new file mode 100644
index 0000000000..a6db66679c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-fullscreen-manual.html
@@ -0,0 +1,36 @@
+
+Test "fullscreen" value of display member + media feature
+
+
+
+
+
+
+
Testing support for "fullscreen" value of display member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-minimal-ui-manual.html b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-minimal-ui-manual.html
new file mode 100644
index 0000000000..b645d6cd7f
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-minimal-ui-manual.html
@@ -0,0 +1,36 @@
+
+Test "minimal-ui" value of display member + media feature
+
+
+
+
+
+
+
Testing support for "minimal-ui" value of display member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-service-worker.js b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-service-worker.js
new file mode 100644
index 0000000000..5720e3cbc3
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-service-worker.js
@@ -0,0 +1,55 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "display-member-media-feature-browser-manual.html",
+ "display-member-media-feature-fullscreen-manual.html",
+ "display-member-media-feature-minimal-ui-manual.html",
+ "display-member-media-feature-standalone-manual.html",
+ "display-member-media-feature-service-worker.js",
+ "resources/display-member-media-feature-manual.js",
+ "resources/icon.png",
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-standalone-manual.html b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-standalone-manual.html
new file mode 100644
index 0000000000..c820091f0f
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/display-member-media-feature-standalone-manual.html
@@ -0,0 +1,36 @@
+
+Test "standalone" value of display member + media feature
+
+
+
+
+
+
+
Testing support for "standalone" value of display member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-browser.webmanifest b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-browser.webmanifest
new file mode 100644
index 0000000000..9e1f6a3350
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-browser.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "Display member media feature WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../display-member-media-feature-browser-manual.html",
+ "display": "browser"
+}
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-browser.webmanifest.headers b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-browser.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-browser.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-fullscreen.webmanifest b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-fullscreen.webmanifest
new file mode 100644
index 0000000000..3954538e50
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-fullscreen.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "Display member media feature WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../display-member-media-feature-fullscreen-manual.html",
+ "display": "fullscreen"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-fullscreen.webmanifest.headers b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-fullscreen.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-fullscreen.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-manual.js b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-manual.js
new file mode 100644
index 0000000000..60723d5afe
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'display-member-media-feature-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-minimal-ui.webmanifest b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-minimal-ui.webmanifest
new file mode 100644
index 0000000000..9463941aa4
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-minimal-ui.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "Display member media feature WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../display-member-media-feature-minimal-ui-manual.html",
+ "display": "minimal-ui"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-minimal-ui.webmanifest.headers b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-minimal-ui.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-minimal-ui.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-standalone.webmanifest b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-standalone.webmanifest
new file mode 100644
index 0000000000..a8269e977c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-standalone.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "Display member media feature WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../display-member-media-feature-standalone-manual.html",
+ "display": "standalone"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-standalone.webmanifest.headers b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-standalone.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-member/resources/display-member-media-feature-standalone.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/display-member/resources/icon.png b/testing/web-platform/tests/appmanifest/display-member/resources/icon.png
new file mode 100644
index 0000000000..267cba8d1e
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/display-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-app-region-window-controls-overlay-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-app-region-window-controls-overlay-manual.tentative.html
new file mode 100644
index 0000000000..c802ba67fa
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-app-region-window-controls-overlay-manual.tentative.html
@@ -0,0 +1,73 @@
+
+
+
+
+ Test app-region CSS property when "window-controls-overlay" in display-override member
+
+
+
Test app-region CSS property when "window-controls-overlay" in display-override member
+
+
+
+
+
+
+
+
+
+
+
Description
+
This test validates that an element will drag the window around when running in "window-controls-overlay" mode.
+
Manual Test Steps:
+
+
+
Install this app, and toggle into "window-controls-overlay" mode.
+
Click and drag the blue rectangle containing the text "Drag Me". This element has the app-region:drag CSS property set.
+
If the app window moves around as you drag the blue rectangle, .
+
+
+
+
+ Drag Me
+
Not Draggable
+
+
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-css-environment-variables-window-controls-overlay-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-css-environment-variables-window-controls-overlay-manual.tentative.html
new file mode 100644
index 0000000000..a49b4f6f98
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-css-environment-variables-window-controls-overlay-manual.tentative.html
@@ -0,0 +1,67 @@
+
+
+
+
+ Test CSS environment variables when "window-controls-overlay" in display-override member
+
+
+
Test CSS environment variables when "window-controls-overlay" in display-override member
+
+
+
+
+
+
+
+
+
+
+
Description
+
This test validates that when in "window-controls-overlay" mode, the 'titlebar-area-*' CSS environment variables
+ match the values returned by navigator.windowControlsOverlay.getTitlebarAreaRect().
+
Manual Test Steps:
+
+
+
Install this app, and toggle into "window-controls-overlay" mode.
+
Upon toggling into "window-controls-overlay" mode, the test will validate that the CSS enviroment variable
+ values match the JavaScript API.
+
+ Note: This test will automatically timeout and fail if not completed within 60 seconds.
+
+
+
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-browser-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-browser-manual.tentative.html
new file mode 100644
index 0000000000..d13d0986ad
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-browser-manual.tentative.html
@@ -0,0 +1,35 @@
+
+Test "browser" in display-override member + media feature
+
+
+
+
+
+
Test "browser" in display-override member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-fullscreen-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-fullscreen-manual.tentative.html
new file mode 100644
index 0000000000..0b9923f8bd
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-fullscreen-manual.tentative.html
@@ -0,0 +1,35 @@
+
+Test "fullscreen" in display-override member + media feature
+
+
+
+
+
+
Test "fullscreen" in display-override member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-minimal-ui-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-minimal-ui-manual.tentative.html
new file mode 100644
index 0000000000..5b9d63977d
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-minimal-ui-manual.tentative.html
@@ -0,0 +1,35 @@
+
+Test "minimal-ui" in display-override member + media feature
+
+
+
+
+
+
Test "minimal-ui" in display-override member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-service-worker.js b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-service-worker.js
new file mode 100644
index 0000000000..02818dc665
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-service-worker.js
@@ -0,0 +1,59 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "display-override-member-app-region-window-controls-overlay-manual.tentative.html",
+ "display-override-member-css-environment-variables-window-controls-overlay-manual.tentative.html",
+ "display-override-member-media-feature-browser-manual.tentative.html",
+ "display-override-member-media-feature-fullscreen-manual.tentative.html",
+ "display-override-member-media-feature-minimal-ui-manual.tentative.html",
+ "display-override-member-media-feature-standalone-manual.tentative.html",
+ "display-override-member-media-feature-standalone-overrides-browser-manual.tentative.html",
+ "display-override-member-media-feature-window-controls-overlay-overrides-browser-manual.tentative.html",
+ "display-override-member-media-feature-service-worker.js",
+ "resources/display-override-member-media-feature-manual.js",
+ "resources/icon.png",
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-standalone-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-standalone-manual.tentative.html
new file mode 100644
index 0000000000..db1ed38929
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-standalone-manual.tentative.html
@@ -0,0 +1,35 @@
+
+Test "standalone" in display-override member + media feature
+
+
+
+
+
+
Test "standalone" in display-override member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-standalone-overrides-browser-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-standalone-overrides-browser-manual.tentative.html
new file mode 100644
index 0000000000..d42feb3fe2
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-standalone-overrides-browser-manual.tentative.html
@@ -0,0 +1,37 @@
+
+Test "standalone" in display-override member + "browser" in display member + media feature
+
+
+
+
+
+
+
+
Test "standalone" in display-override member + "browser" in display member + media feature
+
+
+
+ To pass, the background color must be green after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-window-controls-overlay-overrides-browser-manual.tentative.html b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-window-controls-overlay-overrides-browser-manual.tentative.html
new file mode 100644
index 0000000000..0929b43dec
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/display-override-member/display-override-member-media-feature-window-controls-overlay-overrides-browser-manual.tentative.html
@@ -0,0 +1,43 @@
+
+Test "window-controls-overlay" in display-override member + "browser" in display member + media feature
+
+
+
+
+
+
+
Test "window-controls-overlay" in display-override member + "browser" in display member + media feature
+
+
+
+
This test validates that the display-mode property is 'standalone' when the
+ installed app is running in "window-controls-overlay" mode.
+
Manual Test Steps:
+
+
+
Install this app, and toggle into "window-controls-overlay" mode.
+
The background will be green if the test pases, otherwise red.
+ Launch the app from OS. The page should be launched to start_url v1.
+
+
+ Close the app window.
+
+
+ Trigger a manifest update event.
+
+ This step is specific to each browser implementation.
+ On Chrome, trigger the update by restarting the browser through chrome://restart.
+
+
+
+ Launch the app from OS again, start_url should be updated to v2.
+
+
+`;
+
+ document.body.appendChild(instruction);
+};
+async function main() {
+ await navigator.serviceWorker.register("id-member-service-worker.js");
+ await navigator.serviceWorker.ready;
+}
+main();
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-service-worker.js b/testing/web-platform/tests/appmanifest/id-member/id-member-service-worker.js
new file mode 100644
index 0000000000..c0a16c4a46
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-service-worker.js
@@ -0,0 +1,8 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+self.addEventListener("fetch", e => {
+ e.respondWith(fetch(e.request).catch(_ => {
+ return new Response('Offline test.');
+ }));
+});
diff --git a/testing/web-platform/tests/appmanifest/name-member/name-member-manual.html b/testing/web-platform/tests/appmanifest/name-member/name-member-manual.html
new file mode 100644
index 0000000000..577c821c3b
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/name-member-manual.html
@@ -0,0 +1,9 @@
+
+Test that name member is supported
+
+
+
+
Testing support for name member
+
+ To pass, the application name must be "pass".
+
diff --git a/testing/web-platform/tests/appmanifest/name-member/name-member-service-worker.js b/testing/web-platform/tests/appmanifest/name-member/name-member-service-worker.js
new file mode 100644
index 0000000000..5733f35636
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/name-member-service-worker.js
@@ -0,0 +1,52 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "name-member-manual.html",
+ "name-member-service-worker.js",
+ "resources/name-member-manual.js",
+ "resources/icon.png",
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/name-member/resources/icon.png b/testing/web-platform/tests/appmanifest/name-member/resources/icon.png
new file mode 100644
index 0000000000..6a06550023
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/name-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/name-member/resources/name-member-fail.webmanifest b/testing/web-platform/tests/appmanifest/name-member/resources/name-member-fail.webmanifest
new file mode 100644
index 0000000000..e1b2979207
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/resources/name-member-fail.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "fail",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../name-member-manual.html",
+ "display": "fullscreen"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/name-member/resources/name-member-fail.webmanifest.headers b/testing/web-platform/tests/appmanifest/name-member/resources/name-member-fail.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/resources/name-member-fail.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/name-member/resources/name-member-manual.js b/testing/web-platform/tests/appmanifest/name-member/resources/name-member-manual.js
new file mode 100644
index 0000000000..042b94f85b
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/resources/name-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'name-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/name-member/resources/name-member.webmanifest b/testing/web-platform/tests/appmanifest/name-member/resources/name-member.webmanifest
new file mode 100644
index 0000000000..366044f09e
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/resources/name-member.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "pass",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../name-member-manual.html",
+ "display": "fullscreen"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/name-member/resources/name-member.webmanifest.headers b/testing/web-platform/tests/appmanifest/name-member/resources/name-member.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/name-member/resources/name-member.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-landscape-manual.html b/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-landscape-manual.html
new file mode 100644
index 0000000000..8df1117964
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-landscape-manual.html
@@ -0,0 +1,25 @@
+
+Test that orientation member with landscape value is supported
+
+
+
+
+
Testing support for orientation member with "landscape" value
+
+
+ Please set the phone orientation to portrait.
+
+
+ To pass, after installing the display orientation must be landscape and the background must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-portrait-manual.html b/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-portrait-manual.html
new file mode 100644
index 0000000000..ed866f3561
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-portrait-manual.html
@@ -0,0 +1,25 @@
+
+Test that orientation member with portrait value is supported
+
+
+
+
+
Testing support for orientation member with "portrait" value
+
+
+ Please set the phone orientation to landscape.
+
+
+ To pass, after installing the display orientation must be portrait and the background must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-service-worker.js b/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-service-worker.js
new file mode 100644
index 0000000000..26f53c9816
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/orientation-member-service-worker.js
@@ -0,0 +1,53 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "orientation-member-landscape-manual.html",
+ "orientation-member-portrait-manual.html",
+ "orientation-member-service-worker.js",
+ "resources/orientation-member-manual.js",
+ "resources/icon.png",
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/resources/icon.png b/testing/web-platform/tests/appmanifest/orientation-member/resources/icon.png
new file mode 100644
index 0000000000..fecb1d2da4
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/orientation-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-landscape.webmanifest b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-landscape.webmanifest
new file mode 100644
index 0000000000..c930d292e5
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-landscape.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "Orientation member with landscape value WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../orientation-member-landscape-manual.html",
+ "display": "standalone",
+ "orientation": "landscape"
+}
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-landscape.webmanifest.headers b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-landscape.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-landscape.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-manual.js b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-manual.js
new file mode 100644
index 0000000000..6929c997a4
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'orientation-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-portrait.webmanifest b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-portrait.webmanifest
new file mode 100644
index 0000000000..7ddf0851ac
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-portrait.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "Orientation member with portrait value WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../orientation-member-portrait-manual.html",
+ "display": "standalone",
+ "orientation": "portrait"
+}
diff --git a/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-portrait.webmanifest.headers b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-portrait.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/orientation-member/resources/orientation-member-portrait.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html b/testing/web-platform/tests/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html
new file mode 100644
index 0000000000..fa9c958e0e
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/protocol_handlers-member/protocol_handlers-member-manual.tentative.html
@@ -0,0 +1,34 @@
+
+
+
+
+
+ Protocol Handling Web Platform Test
+
+
+
+
Protocol Handling Web Platform Test
+
This test validates that an install application can register URL protocol
+ handlers via a property in the web app manifest. The app should open
+ directly when the 'web+testing' custom-scheme URL is visited.
+
+
Manual Test Steps:
+
+
+
Install this app.
+
Launch 'web+testing://test-url/'. Instructions will vary by OS.
+
+
On Windows - open a command prompt, and run "start web+testing://test-url/".
+
On MacOS - open a terminal, and "open web+testing://test-url/".
+
On Linux - open a terminal, and "xgd-open web+testing://test-url/".
+
+
+
If your browser prompts you, allow the app to open.
+
The app window that opens should indicate success of this test.
+
+
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/protocol_handlers-member/protocol_handlers-member-service-worker.js b/testing/web-platform/tests/appmanifest/protocol_handlers-member/protocol_handlers-member-service-worker.js
new file mode 100644
index 0000000000..e502e2a985
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/protocol_handlers-member/protocol_handlers-member-service-worker.js
@@ -0,0 +1,52 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.1";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "protocol_handlers-member-service-worker.js",
+ "protocol_handlers-member-manual.tentative.html",
+ "resources/icon.png",
+ "resources/protocol_handlers_entry.html",
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/icon.png b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/icon.png
new file mode 100644
index 0000000000..9255547fae
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest
new file mode 100644
index 0000000000..cce6ae1e22
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest
@@ -0,0 +1,18 @@
+{
+ "name": "Protocol_handlers test",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "144x144"
+ }
+ ],
+ "start_url": "../protocol_handlers-member-manual.tentative.html",
+ "display": "standalone",
+ "scope": "../../protocol_handlers-member/",
+ "protocol_handlers": [
+ {
+ "protocol": "web+testing",
+ "url": "protocol_handlers_entry.html?value=%s"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest.headers b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers-member.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers_entry.html b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers_entry.html
new file mode 100644
index 0000000000..c5fa629f22
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/protocol_handlers-member/resources/protocol_handlers_entry.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Protocol Handling Web Platform Test - Pass
+
+
+
+
+
+
Protocol Handling Page
+
This test validates that the app was launched with the web+testing://test-url/ URL.
+
+
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/short_name-member/resources/icon.png b/testing/web-platform/tests/appmanifest/short_name-member/resources/icon.png
new file mode 100644
index 0000000000..1798a17481
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/short_name-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member-manual.js b/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member-manual.js
new file mode 100644
index 0000000000..7420e66c31
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'short_name-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member.webmanifest b/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member.webmanifest
new file mode 100644
index 0000000000..e456f55d60
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member.webmanifest
@@ -0,0 +1,11 @@
+{
+ "short_name": "pass",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../short_name-member-manual.html",
+ "display": "fullscreen"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member.webmanifest.headers b/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/short_name-member/resources/short_name-member.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/short_name-member/short_name-member-manual.html b/testing/web-platform/tests/appmanifest/short_name-member/short_name-member-manual.html
new file mode 100644
index 0000000000..ce5f8029fe
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/short_name-member/short_name-member-manual.html
@@ -0,0 +1,9 @@
+
+Test that short_name member is supported
+
+
+
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-cors-fail-manual.sub.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-cors-fail-manual.sub.html
new file mode 100644
index 0000000000..5b1bd84dca
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-cors-fail-manual.sub.html
@@ -0,0 +1,17 @@
+
+Test that shortcuts member is supported (icon violates CORS)
+
+
+
+
Testing support for shortcuts member (icon violates CORS)
+
+
+ To pass, the application must not show a shortcut with
+ a white cross on red background.
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-cors-manual.sub.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-cors-manual.sub.html
new file mode 100644
index 0000000000..73b47c4336
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-cors-manual.sub.html
@@ -0,0 +1,17 @@
+
+Test that shortcuts member is supported (icon via CORS)
+
+
+
+
Testing support for shortcuts member (icon via CORS)
+
+
+ To pass, the application must show a shortcut named "pass" with a check
+ mark icon. Clicking it must open this document again.
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-csp-fail-manual.sub.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-csp-fail-manual.sub.html
new file mode 100644
index 0000000000..228c9782c0
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-csp-fail-manual.sub.html
@@ -0,0 +1,18 @@
+
+
+Test that shortcuts member is supported (icon CSP violation)
+
+
+
+
Testing support for shortcuts member (icon CSP violation)
+
+
+ To pass, the application must not show a shortcut with
+ a white cross on red background.
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-csp-manual.sub.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-csp-manual.sub.html
new file mode 100644
index 0000000000..68c5f0107d
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-csp-manual.sub.html
@@ -0,0 +1,18 @@
+
+
+Test that shortcuts member is supported (icon CSP check)
+
+
+
+
Testing support for shortcuts member (icon CSP check)
+
+
+ To pass, the application must show a shortcut named "pass" with a check
+ mark icon. Clicking it must open this document again.
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-manual.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-manual.html
new file mode 100644
index 0000000000..f2a7d6742d
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-manual.html
@@ -0,0 +1,10 @@
+
+Test that shortcuts member is supported
+
+
+
+
Testing support for shortcuts member
+
+ To pass, the application must show a shortcut named "pass" with a check
+ mark icon. Clicking it must open this document again.
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-service-worker.js b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-service-worker.js
new file mode 100644
index 0000000000..bd9995202e
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-service-worker.js
@@ -0,0 +1,61 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "shortcuts-member-cors-fail-manual.sub.html",
+ "shortcuts-member-cors-manual.sub.html",
+ "shortcuts-member-csp-fail-manual.sub.html",
+ "shortcuts-member-csp-manual.sub.html",
+ "shortcuts-member-manual.html",
+ "shortcuts-member-skip-for-empty-name-manual.html",
+ "shortcuts-member-skip-for-invalid-url-manual.html",
+ "shortcuts-member-skip-for-out-of-scope-url-manual.html",
+ "shortcuts-member-skip-for-undefined-name-manual.html",
+ "shortcuts-member-skip-for-undefined-url-manual.html",
+ "shortcuts-member-service-worker.js",
+ "resources/shortcuts-member-manual.js",
+ "resources/pass.png",
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-empty-name-manual.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-empty-name-manual.html
new file mode 100644
index 0000000000..48f4af7ba5
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-empty-name-manual.html
@@ -0,0 +1,9 @@
+
+Test that shortcut items with an empty name are skipped
+
+
+
+
Testing if shortcut items with an empty name are skipped
+
+ To pass, the application must provide a single shortcut named "pass".
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-invalid-url-manual.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-invalid-url-manual.html
new file mode 100644
index 0000000000..6967f8dca2
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-invalid-url-manual.html
@@ -0,0 +1,9 @@
+
+Test that shortcut items with an invalid URL are skipped
+
+
+
+
Testing if shortcut items with an invalid URL are skipped
+
+ To pass, the application must provide a single shortcut named "pass".
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-out-of-scope-url-manual.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-out-of-scope-url-manual.html
new file mode 100644
index 0000000000..64f3d0fe15
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-out-of-scope-url-manual.html
@@ -0,0 +1,9 @@
+
+Test that shortcut items with an out-of-scope URL are skipped
+
+
+
+
Testing if shortcut items with an out-of-scope URL are skipped
+
+ To pass, the application must provide a single shortcut named "pass".
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-undefined-name-manual.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-undefined-name-manual.html
new file mode 100644
index 0000000000..c0a7768eee
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-undefined-name-manual.html
@@ -0,0 +1,9 @@
+
+Test that shortcut items with an undefined name are skipped
+
+
+
+
Testing if shortcut items with an undefined name are skipped
+
+ To pass, the application must provide a single shortcut named "pass".
+
diff --git a/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-undefined-url-manual.html b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-undefined-url-manual.html
new file mode 100644
index 0000000000..ffeb6af9a0
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/shortcuts-member/shortcuts-member-skip-for-undefined-url-manual.html
@@ -0,0 +1,9 @@
+
+Test that shortcut items with an undefined URL are skipped
+
+
+
+
Testing if shortcut items with an undefined URL are skipped
+
+ To pass, the application must provide a single shortcut named "pass".
+
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/resources/icon.png b/testing/web-platform/tests/appmanifest/start_url-member/resources/icon.png
new file mode 100644
index 0000000000..b8845ac098
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/start_url-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-fail.sub.webmanifest b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-fail.sub.webmanifest
new file mode 100644
index 0000000000..9cfb0b815b
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-fail.sub.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "start_url member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "https://{{host}}:{{ports[https][1]}}/appmanifest/start_url-member/fail.html",
+ "display": "fullscreen"
+}
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-fail.sub.webmanifest.headers b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-fail.sub.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-fail.sub.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-manual.js b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-manual.js
new file mode 100644
index 0000000000..302ce45aeb
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'start_url-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member.webmanifest b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member.webmanifest
new file mode 100644
index 0000000000..2afae97566
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member.webmanifest
@@ -0,0 +1,11 @@
+{
+ "name": "start_url member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../pass.html",
+ "display": "fullscreen"
+}
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member.webmanifest.headers b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/resources/start_url-member.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-fail-manual.sub.html b/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-fail-manual.sub.html
new file mode 100644
index 0000000000..079f048b55
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-fail-manual.sub.html
@@ -0,0 +1,16 @@
+
+Test that start_url member is supported
+
+
+
+
Cross-origin start URLs are invalid
+
+
+ To pass, the start URL must not be fail.html because it's not same origin.
+
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-pass-manual.html b/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-pass-manual.html
new file mode 100644
index 0000000000..34be2d6263
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-pass-manual.html
@@ -0,0 +1,9 @@
+
+Test that start_url member is supported
+
+
+
+
Testing support for start_url member
+
+ To pass, the start URL must be pass.html after installing.
+
diff --git a/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-service-worker.js b/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-service-worker.js
new file mode 100644
index 0000000000..6ffe893e13
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/start_url-member/start_url-member-service-worker.js
@@ -0,0 +1,55 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "fail.html",
+ "pass.html",
+ "start_url-member-fail-manual.sub.html",
+ "start_url-member-pass-manual.html",
+ "start_url-member-service-worker.js",
+ "resources/start_url-member-manual.js",
+ "resources/icon.png"
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/icon.png b/testing/web-platform/tests/appmanifest/theme_color-member/resources/icon.png
new file mode 100644
index 0000000000..341f824d9b
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/theme_color-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-hsl.webmanifest b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-hsl.webmanifest
new file mode 100644
index 0000000000..d3ddbf1c16
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-hsl.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "theme_color member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../theme_color-member-hsl-manual.html",
+ "display": "fullscreen",
+ "theme_color": "hsl(120 100% 50%)"
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-hsl.webmanifest.headers b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-hsl.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-hsl.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-manual.js b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-manual.js
new file mode 100644
index 0000000000..0cef8baa4c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'theme_color-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-named.webmanifest b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-named.webmanifest
new file mode 100644
index 0000000000..efa621b57c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-named.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "theme_color member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../theme_color-member-named-manual.html",
+ "display": "fullscreen",
+ "theme_color": "green"
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-named.webmanifest.headers b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-named.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-named.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgb.webmanifest b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgb.webmanifest
new file mode 100644
index 0000000000..1a0a51debe
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgb.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "theme_color member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../theme_color-member-rgb-manual.html",
+ "display": "fullscreen",
+ "theme_color": "rgb(0 255 0)"
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgb.webmanifest.headers b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgb.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgb.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex3.webmanifest b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex3.webmanifest
new file mode 100644
index 0000000000..0d01d1d5fe
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex3.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "theme_color member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../theme_color-member-rgbhex3-manual.html",
+ "display": "fullscreen",
+ "theme_color": "#0F0"
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex3.webmanifest.headers b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex3.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex3.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex6.webmanifest b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex6.webmanifest
new file mode 100644
index 0000000000..74e71bb9b4
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex6.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "theme_color member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../theme_color-member-rgbhex6-manual.html",
+ "display": "fullscreen",
+ "theme_color": "#00FF00"
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex6.webmanifest.headers b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex6.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgbhex6.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgblegacy.webmanifest b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgblegacy.webmanifest
new file mode 100644
index 0000000000..5679b302be
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgblegacy.webmanifest
@@ -0,0 +1,12 @@
+{
+ "name": "theme_color member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../theme_color-member-rgblegacy-manual.html",
+ "display": "fullscreen",
+ "theme_color": "rgb(0, 255, 0)"
+}
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgblegacy.webmanifest.headers b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgblegacy.webmanifest.headers
new file mode 100644
index 0000000000..2bab061d43
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/resources/theme_color-member-rgblegacy.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-hsl-manual.html b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-hsl-manual.html
new file mode 100644
index 0000000000..b5327e8a4b
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-hsl-manual.html
@@ -0,0 +1,9 @@
+
+Test that theme_color member is supported
+
+
+
+
Testing support for theme_color member
+
+ To pass, the theme_color must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-named-manual.html b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-named-manual.html
new file mode 100644
index 0000000000..28156f5a7b
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-named-manual.html
@@ -0,0 +1,9 @@
+
+Test that theme_color member is supported
+
+
+
+
Testing support for theme_color member
+
+ To pass, the theme_color must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgb-manual.html b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgb-manual.html
new file mode 100644
index 0000000000..c1a23d15d4
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgb-manual.html
@@ -0,0 +1,9 @@
+
+Test that theme_color member is supported
+
+
+
+
Testing support for theme_color member
+
+ To pass, the theme_color must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgbhex3-manual.html b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgbhex3-manual.html
new file mode 100644
index 0000000000..bd2d6bc28e
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgbhex3-manual.html
@@ -0,0 +1,9 @@
+
+Test that theme_color member is supported
+
+
+
+
Testing support for theme_color member
+
+ To pass, the theme_color must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgbhex6-manual.html b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgbhex6-manual.html
new file mode 100644
index 0000000000..65a2d369ae
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgbhex6-manual.html
@@ -0,0 +1,9 @@
+
+Test that theme_color member is supported
+
+
+
+
Testing support for theme_color member
+
+ To pass, the theme_color must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgblegacy-manual.html b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgblegacy-manual.html
new file mode 100644
index 0000000000..4df73b0d67
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-rgblegacy-manual.html
@@ -0,0 +1,9 @@
+
+Test that theme_color member is supported
+
+
+
+
Testing support for theme_color member
+
+ To pass, the theme_color must be green.
+
diff --git a/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-service-worker.js b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-service-worker.js
new file mode 100644
index 0000000000..f087117e10
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/theme_color-member/theme_color-member-service-worker.js
@@ -0,0 +1,57 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "theme_color-member-hsl-manual.html",
+ "theme_color-member-named-manual.html",
+ "theme_color-member-rgb-manual.html",
+ "theme_color-member-rgbhex3-manual.html",
+ "theme_color-member-rgbhex6-manual.html",
+ "theme_color-member-rgblegacy-manual.html",
+ "theme_color-member-service-worker.js",
+ "resources/theme_color-member-manual.js",
+ "resources/icon.png"
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/unrecognized-member/resources/icon.png b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/icon.png
new file mode 100644
index 0000000000..deea71918a
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member-manual.js b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member-manual.js
new file mode 100644
index 0000000000..9be8fb602e
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'unrecognized-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member.webmanifest b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member.webmanifest
new file mode 100644
index 0000000000..1eb7b6285a
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member.webmanifest
@@ -0,0 +1,15 @@
+{
+ "this member name is not expected to be recognized": "ok",
+ "this object is not expected to be recognized": {
+ "this sub-field is not expected to be recognized": []
+ },
+ "short_name": "pass",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "192x192"
+ }
+ ],
+ "start_url": "../unrecognized-member-manual.html",
+ "display": "fullscreen"
+}
diff --git a/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member.webmanifest.headers b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/unrecognized-member/resources/unrecognized-member.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/unrecognized-member/unrecognized-member-manual.html b/testing/web-platform/tests/appmanifest/unrecognized-member/unrecognized-member-manual.html
new file mode 100644
index 0000000000..d22b5bacd7
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/unrecognized-member/unrecognized-member-manual.html
@@ -0,0 +1,10 @@
+
+Test that an unrecognized member is ignored
+
+
+
+
Testing support for ignoring an unrecognized member
+
+ To pass, the application name must be "pass". Parsing must not fail due to the
+ presence of the unrecognized members in the manifest.
+
diff --git a/testing/web-platform/tests/appmanifest/unrecognized-member/unrecognized-member-service-worker.js b/testing/web-platform/tests/appmanifest/unrecognized-member/unrecognized-member-service-worker.js
new file mode 100644
index 0000000000..5364b09ffd
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/unrecognized-member/unrecognized-member-service-worker.js
@@ -0,0 +1,52 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "unrecognized-member-manual.html",
+ "unrecognized-member-service-worker.js",
+ "resources/unrecognized-member-manual.js",
+ "resources/icon.png"
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
diff --git a/testing/web-platform/tests/appmanifest/user_preferences-member/resources/icon.png b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/icon.png
new file mode 100644
index 0000000000..d6dd4860ae
Binary files /dev/null and b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/icon.png differ
diff --git a/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member-manual.js b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member-manual.js
new file mode 100644
index 0000000000..bf1bc8d24c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member-manual.js
@@ -0,0 +1,4 @@
+if ('serviceWorker' in navigator) {
+ navigator.serviceWorker.register(
+ 'user_preferences-member-service-worker.js');
+}
diff --git a/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member.webmanifest b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member.webmanifest
new file mode 100644
index 0000000000..3d92202bf7
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member.webmanifest
@@ -0,0 +1,22 @@
+{
+ "name": "user_preferences member WPT",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "144x144"
+ }
+ ],
+ "start_url": "../user_preferences-member-manual.html",
+ "display": "fullscreen",
+ "user_preferences": {
+ "color_scheme": {
+ "dark": {
+ "theme_color": "green"
+ },
+ "light": {
+ "theme_color": "green"
+ }
+ }
+ },
+ "theme_color": "red"
+}
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member.webmanifest.headers b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/user_preferences-member/resources/user_preferences-member.webmanifest.headers
@@ -0,0 +1 @@
+Content-Type: application/manifest+json; charset=utf-8
\ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/user_preferences-member/user_preferences-member-manual.html b/testing/web-platform/tests/appmanifest/user_preferences-member/user_preferences-member-manual.html
new file mode 100644
index 0000000000..c864d3dfd5
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/user_preferences-member/user_preferences-member-manual.html
@@ -0,0 +1,13 @@
+
+Test that user_preferences member is supported
+
+
+
Testing support for user_preferences member
+
+
Install this site as a PWA
+
Enable the OS dark mode setting
+
To pass, the theme_color must be green. This can be observed by looking
+ at the top of the window. On failure, this will be red.
+
+
+
diff --git a/testing/web-platform/tests/appmanifest/user_preferences-member/user_preferences-member-service-worker.js b/testing/web-platform/tests/appmanifest/user_preferences-member/user_preferences-member-service-worker.js
new file mode 100644
index 0000000000..24d575a917
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/user_preferences-member/user_preferences-member-service-worker.js
@@ -0,0 +1,52 @@
+// Some user agents only offer app installation if there is a SW and it handles
+// offline requests.
+
+const cacheVersion = "1.2";
+const CACHE_NAME = `cache-v${cacheVersion}`;
+
+// The resources cached by this service worker.
+const resources = [
+ "user_preferences-member-manual.html",
+ "user_preferences-member-service-worker.js",
+ "resources/user_preferences-member-manual.js",
+ "resources/icon.png"
+];
+
+// Load all resources for this service worker.
+const precache = async () => {
+ const cache = await caches.open(CACHE_NAME);
+ await cache.addAll(resources);
+};
+
+// Get a resource from the cache.
+const fromCache = async request => {
+ const cache = await caches.open(CACHE_NAME);
+ return await cache.match(request.url);
+};
+
+// Attempt to get resources from the network first, fallback to the cache if we're
+// offline.
+const networkFallbackToCache = async request => {
+ try {
+ const response = await fetch(request);
+ if (response.ok) return response;
+ } catch (err) {}
+ return await fromCache(request);
+};
+
+// When we have a new service worker, update the caches and swap immediately.
+self.addEventListener("install", e => {
+ e.waitUntil(precache().then(() => self.skipWaiting()));
+});
+
+// Claim existing clients.
+self.addEventListener("activate", e => {
+ e.waitUntil(self.clients.claim());
+});
+
+// When a resource need to be fetched, check whether it is
+// contained in the cache and return the cached version, otherwise
+// get it from the network.
+self.addEventListener("fetch", e => {
+ e.respondWith(networkFallbackToCache(e.request));
+});
--
cgit v1.2.3