Skip to content

Commit

Permalink
Bug 1875058 [wpt PR 44043] - Prerender: Run WPT for local-storage wit…
Browse files Browse the repository at this point in the history
…h target hint, a=testonly

Automatic update from web-platform-tests
Prerender: Run WPT for local-storage with target hint

Bug: 1501674
Change-Id: I9f556f5abd89d102887ef5ac90a1964f07b795a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5203960
Auto-Submit: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Huanpo Lin <robertlin@chromium.org>
Commit-Queue: Huanpo Lin <robertlin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1248549}

--

wpt-commits: 154b178cd085c4baff304f38a310d40d9cd4229f
wpt-pr: 44043
  • Loading branch information
nhiroki authored and moz-wptsync-bot committed Jan 20, 2024
1 parent 2048db5 commit e6e0468
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!DOCTYPE html>
<title>Same-origin prerendering can access localStorage</title>
<meta name="variant" content="?target_hint=_self">
<meta name="variant" content="?target_hint=_blank">
<meta name="timeout" content="long">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Expand Down Expand Up @@ -28,8 +30,12 @@
}, { once: true });
});

const opt = {};
const init_opt = {};
const rule_extras = {'target_hint': getTargetHint()};

window.localStorage.setItem('initial', uid1);
const {exec} = await create_prerendered_page(t);
const {exec} = await create_prerendered_page(t, opt, init_opt, rule_extras);
const result = await exec(uid2 => {
window.localStorage.setItem('prerender', uid2);
return window.localStorage.getItem('initial');
Expand Down

0 comments on commit e6e0468

Please sign in to comment.