-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DPWA: add tentative WPT manual tests for manifest id
Adds tentative manual tests for manifest id, specifically for manifest update behavior. As suggested in #30409 manifest update is both not specified in spec and not supported in other user agents yet, so adding these tests as tentative. Bug: 1182363 Change-Id: I065afc19982f528b509fb81491738b899b72cc1d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3177731 Commit-Queue: Phillis Tang <phillis@chromium.org> Reviewed-by: Daniel Murphy <dmurph@chromium.org> Cr-Commit-Position: refs/heads/main@{#925858}
- Loading branch information
1 parent
82d5eb8
commit 12c0dec
Showing
10 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions
29
appmanifest/id-member/id-member-manifest-update-manual-v1.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
25 changes: 25 additions & 0 deletions
25
appmanifest/id-member/id-member-manifest-update-manual-v2.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
22 changes: 22 additions & 0 deletions
22
appmanifest/id-member/id-member-manifest-update-manual.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
13 changes: 13 additions & 0 deletions
13
appmanifest/id-member/id-member-manifest-update-v1.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "id member test", | ||
"id": "/testId", | ||
"start_url": "id-member-manifest-update-manual-v1.tentative.html", | ||
"icons": [ | ||
{ | ||
"src": "icon.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
} | ||
], | ||
"display": "standalone" | ||
} |
1 change: 1 addition & 0 deletions
1
appmanifest/id-member/id-member-manifest-update-v1.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
13 changes: 13 additions & 0 deletions
13
appmanifest/id-member/id-member-manifest-update-v2.webmanifest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "id member test", | ||
"id": "testId", | ||
"start_url": "id-member-manifest-update-manual-v2.tentative.html", | ||
"icons": [ | ||
{ | ||
"src": "icon.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
} | ||
], | ||
"display": "standalone" | ||
} |
1 change: 1 addition & 0 deletions
1
appmanifest/id-member/id-member-manifest-update-v2.webmanifest.headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Content-Type: application/manifest+json; charset=utf-8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.tentative.html ">id-member-manifest-update-manual.tentative.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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.'); | ||
})); | ||
}); |