Skip to content

Commit

Permalink
Prerender: Upstream tests for storage APIs in same-origin prerendered…
Browse files Browse the repository at this point in the history
… pages (1)

This CL upstreams tests for storage APIs (Cache Storage, IndexedDB,
Local Storage) in same-origin prerendered pages to the WPT. The behavior
of these APIs is not defined in the spec yet, but we already reached a
consensus that the storage APIs in same-origin prerendered pages are
just allowed.

See the GitHub issue for details:
WICG/nav-speculation#7 (comment)

Tests for remaining storage APIs (e.g., Storage Foundation) will be
upstreamed by subsequent CLs.

Bug: 1253158
Change-Id: I25482404b7bbee2566297bd917dfe824502052cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226443
Reviewed-by: Kouhei Ueno <[email protected]>
Reviewed-by: Lingqi Chi <[email protected]>
Commit-Queue: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/main@{#932415}
  • Loading branch information
nhiroki authored and Chromium LUCI CQ committed Oct 18, 2021
1 parent e46e227 commit 53813a5
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<body>
<script>

setup(() => assertSpeculationRulesIsSupported());

promise_test(async t => {
const bc = new BroadcastChannel('prerender-channel');

Expand Down Expand Up @@ -34,7 +36,6 @@
await caches.delete(cacheName);

bc.close();

}, 'prerendering page should be able to access cache storage')

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<body>
<script>

setup(() => assertSpeculationRulesIsSupported());

promise_test(async t => {
const bc = new BroadcastChannel('prerender-channel');

Expand Down Expand Up @@ -36,7 +38,7 @@
'prerendering page should be able to write to Indexed DataBase');
db.close();
bc.close();

}, 'prerendering page should be able to access Indexed DataBase')

</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<body>
<script>

setup(() => assertSpeculationRulesIsSupported());

promise_test(async t => {
const bc = new BroadcastChannel('prerender-channel');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello, Prerender API!

0 comments on commit 53813a5

Please sign in to comment.