diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /testing/web-platform/tests/appmanifest/id-member | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/appmanifest/id-member')
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 Binary files differnew file mode 100644 index 0000000000..4b9c7c8f32 --- /dev/null +++ b/testing/web-platform/tests/appmanifest/id-member/icon.png 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.'); + })); +}); |