Skip to content

Commit

Permalink
Reland "FSA: Fix more WPTs"
Browse files Browse the repository at this point in the history
This CL was reverted here b2629e5b805d72c2fc6c02a436a2125540bc45af
because the tests were timing out. This CL does not fix the tests timing
out but instead adds them to the TestExpectations with a filed bug:
crbug.com/376931817.

Original description:

> Two tests were using await in a non-async function. And a test helper
> was using newAnonymousIframe which was updated at some point to
> newIframeCredentialless.

Bug: 346991169
Change-Id: I418e7b40abaaa4d8b2b14f48930ca8d54333956a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5980708
Commit-Queue: Nathan Memmott <[email protected]>
Reviewed-by: Daseul Lee <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1377908}
  • Loading branch information
Nathan Memmott authored and chromium-wpt-export-bot committed Nov 4, 2024
1 parent 5188826 commit c0de417
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!doctype html>
<head>
<meta charset=utf-8>
<meta name="timeout" content="long">
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="/common/get-host-info.sub.js"></script>
<script src="/common/utils.js"></script>
Expand Down Expand Up @@ -60,7 +61,7 @@

// To be resilient against tests not cleaning up properly, cleanup before
// every test.
function clearDirectories() {
async function clearDirectories() {
const directory = await directory_promise;
for await (let entry of directory.values()) {
await directory.removeEntry(
Expand All @@ -72,7 +73,7 @@
// that send assertion scripts to multiple executor subframes.

framed_test(async (t, sendTo) => {
clearDirectories();
await clearDirectories();
// Ensure we have directory picker access in all child contexts.
await sendTo(childContexts, setUpChildFrame);
await sendTo(sameSiteContexts, assertNumEntries(0));
Expand All @@ -85,7 +86,7 @@
}, 'getDirectoryHandle can access handles across same-site contexts.');

framed_test(async (t, sendTo) => {
clearDirectories();
await clearDirectories();
// Ensure we have directory picker access in all child contexts.
await sendTo(childContexts, setUpChildFrame);
await sendTo(sameSiteContexts, assertNumEntries(0));
Expand All @@ -101,7 +102,7 @@
}, 'Directory handles can be removed from other same-site contexts.');

framed_test(async (t, sendTo) => {
clearDirectories();
await clearDirectories();
// Ensure we have directory picker access in all child contexts.
await sendTo(childContexts, setUpChildFrame);
// Assert that an error is raised when attempting to access
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@

// To be resilient against tests not cleaning up properly, cleanup before
// every test.
function clearDirectories() {
async function clearDirectories() {
const directory = await directory_promise;
for await (let entry of directory.values()) {
await directory.removeEntry(
Expand All @@ -82,7 +82,7 @@
// that send assertion scripts to multiple executor subframes.

framed_test(async (t, sendTo) => {
clearDirectories();
await clearDirectories();
// Ensure we have directory picker access in all child contexts.
await sendTo(childContexts, setUpChildFrame);
await sendTo(sameSiteContexts, assertNumEntries(0));
Expand All @@ -95,7 +95,7 @@
}, 'getFileHandle can access handles across same-site contexts.');

framed_test(async (t, sendTo) => {
clearDirectories();
await clearDirectories();
// Ensure we have directory picker access in all child frames.
await sendTo(childContexts, setUpChildFrame);
await sendTo(sameSiteContexts, assertNumEntries(0));
Expand All @@ -111,7 +111,7 @@
}, 'File handles can be removed from other same-site contexts.');

framed_test(async (t, sendTo) => {
clearDirectories();
await clearDirectories();
// Ensure we have directory picker access in all child contexts.
await sendTo(childContexts, setUpChildFrame);
// Assert that an error is raised when attempting to access getFileHandle.
Expand Down
17 changes: 10 additions & 7 deletions file-system-access/resources/local-fs-test-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,25 @@ function framed_test(func, description) {
try {
// Set up handles to all third party frames.
const handles = [
null, // firstParty
newIframe(same_site_origin), // thirdPartySameSite
null, // thirdPartySameSite_AncestorBit
null, // firstParty
newIframe(same_site_origin), // thirdPartySameSite
null, // thirdPartySameSite_AncestorBit
newIframe(cross_site_origin), // thirdPartyCrossSite
newAnonymousIframe(same_site_origin), // anonymousFrameSameSite
newIframeCredentialless(same_site_origin), // anonymousFrameSameSite
null, // anonymousFrameSameSite_AncestorBit
newAnonymousIframe(cross_site_origin), // anonymousFrameCrossSite
newIframeCredentialless(
cross_site_origin), // anonymousFrameCrossSite
];
// Set up nested SameSite frames for ancestor bit contexts.
const setUpQueue = token();
send(newIframe(cross_site_origin),
child_frame_js(same_site_origin, "newIframe", setUpQueue));
handles[FRAME_CONTEXT.thirdPartySameSite_AncestorBit] =
await receive(setUpQueue);
send(newAnonymousIframe(cross_site_origin),
child_frame_js(same_site_origin, "newAnonymousIframe", setUpQueue));
send(
newIframeCredentialless(cross_site_origin),
child_frame_js(
same_site_origin, 'newIframeCredentialless', setUpQueue));
handles[FRAME_CONTEXT.anonymousFrameSameSite_AncestorBit] =
await receive(setUpQueue);

Expand Down

0 comments on commit c0de417

Please sign in to comment.