Skip to content

Commit

Permalink
[Do not submit yet] Include unpartitioned cookie availability check i…
Browse files Browse the repository at this point in the history
…n hasStorageAccess()

This change is based on spec PR
privacycg/storage-access#174.

Bug: 1433013
Change-Id: I6c29b2a2afddb288d40d946040dc73fbe76b6fcb
  • Loading branch information
shuranhuang authored and chromium-wpt-export-bot committed Jun 16, 2023
1 parent 4bdf59d commit 7bd5202
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 7bd5202

Please sign in to comment.