-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test PWA for integration tests on tabbed mode
Tabbed Mode explainer: https://github.com/WICG/manifest-incubations/blob/gh-pages/tabbed-mode-explainer.md Bug: 1406730 Change-Id: I22413751682467b4aef5f4aef9bec12d12171ce8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4199786 Reviewed-by: Eric Willigers <ericwilligers@chromium.org> Reviewed-by: Louise Brett <loubrett@google.com> Commit-Queue: Eric Willigers <ericwilligers@chromium.org> Cr-Commit-Position: refs/heads/main@{#1098421}
- Loading branch information
Kasie Wang
authored and
Chromium LUCI CQ
committed
Jan 30, 2023
1 parent
52fee87
commit f99aff7
Showing
9 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
chrome/test/data/webapps_integration/standalone/manifest_tabbed.json
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,31 @@ | ||
{ | ||
"name": "Site A", | ||
"icons": [ | ||
{ | ||
"src": "48x48-green.png", | ||
"sizes": "48x48", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "128x128-green.png", | ||
"sizes": "128x128", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "192x192-green.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "256x256-green.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
} | ||
], | ||
"start_url": "/webapps_integration/standalone/basic.html", | ||
"scope": "/webapps_integration/standalone/", | ||
"display": "standalone", | ||
"display_override": [ | ||
"tabbed" | ||
] | ||
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Tabbed</title> | ||
<script src="/webapps_integration/test_utils.js"></script> | ||
<script> | ||
// If a "manifest=/path/to/manifest.json" query argument is provided to | ||
// the URL accessing this page, that path is injected as the manifest tag. | ||
// Otherwise, "basic.json" is used as the manifest tag. | ||
addManifestLinkTag(); | ||
</script> | ||
</head> | ||
<body onload="startWorker('/webapps_integration/tabbed/service_worker.js', { scope: '/webapps_integration/tabbed/' })"> | ||
<h1>Tabbed Home Page</h1> | ||
<div> | ||
<p> | ||
This site is used for dPWA integration tests, and is subject to modification to support that framework. See | ||
<a | ||
href="https://chromium.googlesource.com/chromium/src/+/main/docs/webapps/integration-testing-framework.md">https://chromium.googlesource.com/chromium/src/+/main/docs/webapps/integration-testing-framework.md</a> | ||
</p> | ||
</div> | ||
</body> | ||
</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,39 @@ | ||
{ | ||
"name": "Tabbed", | ||
"icons": [ | ||
{ | ||
"src": "192x192-red.webp", | ||
"sizes": "192x192", | ||
"type": "image/webp" | ||
}, | ||
{ | ||
"src": "256x256-red.webp", | ||
"sizes": "256x256", | ||
"type": "image/webp" | ||
} | ||
], | ||
"start_url": "/webapps_integration/tabbed/basic.html", | ||
"scope": "/webapps_integration/tabbed/", | ||
"display": "standalone", | ||
"display_override": ["tabbed"], | ||
"tab_strip": { | ||
"home_tab": { | ||
"url": "/webapps_integration/tabbed/basic.html", | ||
"icons": [ | ||
{ | ||
"src": "192x192-green.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "256x256-green.png", | ||
"sizes": "256x256", | ||
"type": "image/png" | ||
} | ||
] | ||
}, | ||
"new_tab_button": { | ||
"url": "/webapps_integration/tabbed/new_page.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,23 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Tabbed</title> | ||
<script src="/webapps_integration/test_utils.js"></script> | ||
<script> | ||
// If a "manifest=/path/to/manifest.json" query argument is provided to | ||
// the URL accessing this page, that path is injected as the manifest tag. | ||
// Otherwise, "basic.json" is used as the manifest tag. | ||
addManifestLinkTag(); | ||
</script> | ||
</head> | ||
<body onload="startWorker('/webapps_integration/tabbed/service_worker.js', { scope: '/webapps_integration/tabbed/' })"> | ||
<h1>Tabbed Page One</h1> | ||
<div> | ||
<p> | ||
This site is used for dPWA integration tests, and is subject to modification to support that framework. See | ||
<a | ||
href="https://chromium.googlesource.com/chromium/src/+/main/docs/webapps/integration-testing-framework.md">https://chromium.googlesource.com/chromium/src/+/main/docs/webapps/integration-testing-framework.md</a> | ||
</p> | ||
</div> | ||
</body> | ||
</html> |
11 changes: 11 additions & 0 deletions
11
chrome/test/data/webapps_integration/tabbed/service_worker.js
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,11 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
'use strict'; | ||
|
||
self.addEventListener('fetch', event => { | ||
event.respondWith(fetch(event.request).catch(_ => { | ||
return new Response('Offline test.'); | ||
})); | ||
}); |