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 (2)

This CL upstreams tests for storage APIs (Storage Foundation,
Web Database) 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)

Bug: 1253158
Change-Id: If34e4f325341a95f036beff43af19dde3504a8ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3226531
Reviewed-by: Kouhei Ueno <[email protected]>
Reviewed-by: Lingqi Chi <[email protected]>
Commit-Queue: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/main@{#932416}
NOKEYCHECK=True
GitOrigin-RevId: 32037f69cbdd8089f908c483d1f1db24abd3545d
  • Loading branch information
nhiroki authored and copybara-github committed Oct 18, 2021
1 parent 5b48c65 commit ed24895
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<body>
<script>

setup(() => assertSpeculationRulesIsSupported());

const expectedReadBuffer = [65, 66, 67, 68];

async function writeToFile() {
Expand Down Expand Up @@ -60,5 +62,6 @@

await storageFoundation.delete('test_file');
}, 'prerendering page should be able to access storage foundation API');

</script>
</body>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<script src="resources/utils.js"></script>
<body>
<script>

setup(() => assertSpeculationRulesIsSupported());

async function insertQuery() {
return new Promise(resolve => {
const db = openDatabase("test", "1.0", "test database", 1024);
Expand Down Expand Up @@ -62,5 +65,6 @@
selectResult, 2,
'prerendering page should be able to write to Web Database');
}, 'prerendering page should be able to access Web Database');

</script>
</body>

0 comments on commit ed24895

Please sign in to comment.