summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/appmanifest/id-member
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/appmanifest/id-member
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/appmanifest/id-member')
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/icon.pngbin0 -> 14565 bytes
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v1.html29
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v2.html25
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual.tentative.html22
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest13
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest.headers1
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.webmanifest13
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.webmanifest.headers1
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update.js34
-rw-r--r--testing/web-platform/tests/appmanifest/id-member/id-member-service-worker.js8
10 files changed, 146 insertions, 0 deletions
diff --git a/testing/web-platform/tests/appmanifest/id-member/icon.png b/testing/web-platform/tests/appmanifest/id-member/icon.png
new file mode 100644
index 0000000000..4b9c7c8f32
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/icon.png
Binary files differ
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v1.html b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v1.html
new file mode 100644
index 0000000000..3f4a331e0b
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v1.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Manifest Id Web Platform Test</title>
+ <style>
+ body {
+ margin: 2em;
+ }
+
+ ol {
+ line-height: 200%;
+ }
+ </style>
+ <!-- This points to manifest v2 with a different start_url, but the
+ id is url-equivalent to manifest v1. -->
+ <link rel="manifest" href="id-member-manifest-update-v2.webmanifest" />
+ <script src="id-member-manifest-update.js"></script>
+
+ </head>
+ <body>
+ <h1>
+ Manifest Id Test
+ </h1>
+ <h2 style="color: red">
+ start_url v1
+ </h2>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v2.html b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v2.html
new file mode 100644
index 0000000000..4454017eaf
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual-v2.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>Manifest Id Web Platform Test</title>
+ <style>
+ body {
+ margin: 2em;
+ }
+
+ ol {
+ line-height: 200%;
+ }
+ </style>
+ <link rel="manifest" href="id-member-manifest-update-v1.webmanifest" />
+ <script src="id-member-manifest-update.js"></script>
+ </head>
+ <body>
+ <h1>
+ Manifest Id Test
+ </h1>
+ <h2 style="color: green">
+ start_url v2
+ </h2>
+ </body>
+</html>
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual.tentative.html b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual.tentative.html
new file mode 100644
index 0000000000..c534d7404a
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-manual.tentative.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <title>Manifest Id Web Platform Test</title>
+ <style>
+ body {
+ margin: 2em;
+ }
+
+ ol {
+ line-height: 200%;
+ }
+ </style>
+ <link rel="manifest" href="id-member-manifest-update-v1.webmanifest" />
+ <script src="id-member-manifest-update.js"></script>
+ </head>
+ <body>
+ <h1>
+ Manifest Id Test
+ </h1>
+ </body>
+</html> \ No newline at end of file
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest
new file mode 100644
index 0000000000..5d02d2b10a
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest
@@ -0,0 +1,13 @@
+{
+ "name": "id member test",
+ "id": "/testId",
+ "start_url": "id-member-manifest-update-manual-v1.html",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "display": "standalone"
+}
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest.headers b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v1.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/id-member/id-member-manifest-update-v2.webmanifest b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.webmanifest
new file mode 100644
index 0000000000..582620186e
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.webmanifest
@@ -0,0 +1,13 @@
+{
+ "name": "id member test",
+ "id": "testId",
+ "start_url": "id-member-manifest-update-manual-v2.html",
+ "icons": [
+ {
+ "src": "icon.png",
+ "sizes": "256x256",
+ "type": "image/png"
+ }
+ ],
+ "display": "standalone"
+}
diff --git a/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.webmanifest.headers b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.webmanifest.headers
new file mode 100644
index 0000000000..23f36ea27c
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update-v2.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/id-member/id-member-manifest-update.js b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update.js
new file mode 100644
index 0000000000..7d6e344ed9
--- /dev/null
+++ b/testing/web-platform/tests/appmanifest/id-member/id-member-manifest-update.js
@@ -0,0 +1,34 @@
+window.onload = () => {
+ const instruction = document.createElement("div");
+ instruction.innerHTML = `
+ <h2>
+ Instructions
+ </h2>
+ <ol>
+ <li>Install <a href="id-member-manifest-update-manual.html ">id-member-manifest-update-manual.html </a> as a PWA</li>
+ <li>
+ Launch the app from OS. The page should be launched to start_url v1.
+ </li>
+ <li>
+ Close the app window.
+ </li>
+ <li>
+ Trigger a manifest update event.
+ <p>
+ This step is specific to each browser implementation.
+ On Chrome, trigger the update by restarting the browser through chrome://restart.
+ </p>
+ </li>
+ <li>
+ Launch the app from OS again, start_url should be updated to v2.
+ </li>
+ </ol>
+`;
+
+ 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.');
+ }));
+});