Skip to content

Commit

Permalink
Include unpartitioned cookie availability check in hasStorageAccess()
Browse files Browse the repository at this point in the history
This change is based on spec PR
privacycg/storage-access#174.

Bug: 1433013
Change-Id: I6c29b2a2afddb288d40d946040dc73fbe76b6fcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4611289
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Shuran Huang <[email protected]>
Reviewed-by: Chris Fredrickson <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1161766}
  • Loading branch information
shuranhuang authored and chromium-wpt-export-bot committed Jun 23, 2023
1 parent b5d291d commit 7ffe5b8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions storage-access-api/hasStorageAccess.sub.https.window.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// META: script=helpers.js
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
'use strict';

const {testPrefix, topLevelDocument} = processQueryParams();
Expand All @@ -9,6 +11,7 @@ promise_test(async () => {
}, "[" + testPrefix + "] document.hasStorageAccess() should exist on the document interface");

promise_test(async () => {
await MaybeSetStorageAccess("*", "*", "blocked");
const hasAccess = await document.hasStorageAccess();
if (topLevelDocument || testPrefix.includes('same-origin')) {
assert_true(hasAccess, "Access should be granted in top-level frame or iframe that is in first-party context by default.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<meta charset=utf-8>

<script src="/resources/testharness.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<script src="/storage-access-api/helpers.js"></script>
<body>
<script src="/storage-access-api/resources/hasStorageAccess-ABA-iframe.sub.https.window.js"></script>
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// META: script=../helpers.js
// META: script=/resources/testdriver.js
// META: script=/resources/testdriver-vendor.js
'use strict';

// This expects to be run in an iframe that is cross-site to the top-level frame.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<meta charset=utf-8>

<script src="/resources/testharness.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<!-- no testharnessreport.js -->
<script src="../helpers.js"></script>
<div id=log></div>
Expand Down

0 comments on commit 7ffe5b8

Please sign in to comment.