0

[Blob URL] Flakey cross-partition-navigation.https.html WPT Fix

WPT would pass on occasion due to what seems like a race considtion where the same_site_iframe is returning it's response before the cross_site_iframe, which causes the test to pass.

Example of Build Failure: https://ci.chromium.org/ui/p/chromium/builders/ci/Mac12%20Tests/27105/test-results?q=ID%3Aninja%3A%2F%2F%3Aheadless_shell_wpt%2Fexternal%2Fwpt%2FFileAPI%2FBlobURL%2Fcross-partition-navigation.https.html&sortby=&groupby=

Bug: 390049422
Change-Id: If67d0cd8cbc0bdad8e0bcb23d5c6f315be05639b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6254922
Auto-Submit: Janice Liu <janiceliu@chromium.org>
Reviewed-by: Andrew Williams <awillia@chromium.org>
Commit-Queue: Andrew Williams <awillia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1420283}
This commit is contained in:
Janice Liu
2025-02-13 19:58:58 -08:00
committed by Chromium LUCI CQ
parent 96c36037c2
commit b20dec873e
6 changed files with 11 additions and 53 deletions
third_party/blink/web_tests
TestExpectations
external
platform
mac-mac11-arm64
mac-mac12-arm64
mac-mac14
mac

@@ -9149,8 +9149,6 @@ crbug.com/383946052 [ Fuchsia ] external/wpt/screen-capture/tentative/getdisplay
crbug.com/383946052 [ Linux ] external/wpt/screen-capture/tentative/getdisplaymedia-captured-surface-resolution.https.html [ Failure ]
crbug.com/383946052 [ Mac ] external/wpt/screen-capture/tentative/getdisplaymedia-captured-surface-resolution.https.html [ Failure ]
# Gardener 2025-02-11
crbug.com/395891728 [ Win ] external/wpt/FileAPI/BlobURL/cross-partition-navigation.https.html [ Failure ]
# Also failing on WebKit Linux ASAN
crbug.com/391728750 [ Linux ] external/wpt/ai/translator/ai_translator_translate.tentative.https.any.html [ Failure Timeout ]
crbug.com/391728750 [ Linux ] external/wpt/ai/translator/ai_translator_translate.tentative.https.any.worker.html [ Failure Timeout ]

@@ -134,17 +134,22 @@ const blob_url_iframe_html = (response_queue_uuid, message) => `
<script src="/common/utils.js"><\/script>
<script src="/common/dispatcher/dispatcher.js"><\/script>
<script>
window.onload = () => {
send("${response_queue_uuid}", "${message}");
window.close();
};
send("${response_queue_uuid}", "${message}");
<\/script>
`;
const create_iframe_with_blob_url = (blob_url) => `
const create_iframe_with_blob_url = (blob_url, response_queue_uuid) => `
const iframe = document.createElement('iframe');
iframe.src = "${blob_url}";
document.body.appendChild(iframe);
const same_site_message = "same_partition_loaded";
const blob_url_iframe_html = ${blob_url_iframe_html};
const same_top_level_site_blob = new Blob([blob_url_iframe_html("${response_queue_uuid}", same_site_message)], {type : "text/html"});
const same_top_level_site_blob_url = URL.createObjectURL(same_top_level_site_blob);
const iframe2 = document.createElement('iframe');
iframe2.src = same_top_level_site_blob_url;
document.body.appendChild(iframe2);
`;
// Tests blob URL subframe navigations for same and cross partition iframes.
@@ -154,7 +159,6 @@ promise_test(t => {
// Creates same and cross partition iframes.
const response_queue_uuid = token();
const cross_site_message = "cross_partition_loaded";
const same_site_message = "same_partition_loaded";
const [cross_site_iframe_uuid, same_site_iframe_uuid] =
await create_test_iframes(t, response_queue_uuid);
@@ -164,14 +168,8 @@ promise_test(t => {
const cross_site_blob_url = URL.createObjectURL(cross_site_blob);
// Attempt to open blob URL in cross partition iframe.
await send(cross_site_iframe_uuid, create_iframe_with_blob_url(cross_site_blob_url));
await send(cross_site_iframe_uuid, create_iframe_with_blob_url(cross_site_blob_url, response_queue_uuid));
// Create blob URL for the same-site test.
const same_site_blob = new Blob([blob_url_iframe_html(response_queue_uuid, same_site_message)], {type: "text/html"});
const same_site_blob_url = URL.createObjectURL(same_site_blob);
// Attempt to open blob URL in same partition iframe.
await send(same_site_iframe_uuid, create_iframe_with_blob_url(same_site_blob_url));
const response = await receive(response_queue_uuid);
if (response === cross_site_message) {
reject(`Blob URL subframe navigation succeeded in not-same-top-level-site iframe.`);

@@ -1,9 +0,0 @@
This is a testharness.js-based test.
[FAIL] Blob URL window.open should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL handle wasn't null in not-same-top-level-site iframe: Navigation handle returns not null"
[FAIL] Blob URL link click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
[FAIL] Blob URL area element click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
Harness: the test ran to completion.

@@ -1,9 +0,0 @@
This is a testharness.js-based test.
[FAIL] Blob URL window.open should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL handle wasn't null in not-same-top-level-site iframe: Navigation handle returns not null"
[FAIL] Blob URL link click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
[FAIL] Blob URL area element click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
Harness: the test ran to completion.

@@ -1,11 +0,0 @@
This is a testharness.js-based test.
[FAIL] Blob URL window.open should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL handle wasn't null in not-same-top-level-site iframe: Navigation handle returns not null"
[FAIL] Blob URL should partition subframe navigation.
promise_test: Unhandled rejection with value: "Blob URL subframe navigation succeeded in not-same-top-level-site iframe."
[FAIL] Blob URL link click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
[FAIL] Blob URL area element click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
Harness: the test ran to completion.

@@ -1,9 +0,0 @@
This is a testharness.js-based test.
[FAIL] Blob URL window.open should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL handle wasn't null in not-same-top-level-site iframe: Navigation handle returns not null"
[FAIL] Blob URL link click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
[FAIL] Blob URL area element click should enforce noopener for a cross-top-level-site navigation
promise_test: Unhandled rejection with value: "Blob URL page opener wasn't null in not-same-top-level-site iframe."
Harness: the test ran to completion.