Commit 6f6900b0 authored by Alex Moshchuk's avatar Alex Moshchuk Committed by Commit Bot

Fix race in http/tests/security/mixedContent/blob-url-in-iframe.html

This test started failing with --site-per-process in
https://chromium-review.googlesource.com/c/chromium/src/+/636786.  The
reason appears to be that the test installed the iframe's onload
handler after the main page started a navigation to the test's HTTPS
location, and the iframe's onload from the old page could fire
before the HTTPS navigation completed.  With the above CL, the
(cross-process) main frame navigation likely became a bit slower due 
to the extra proxy being created for it, exposing this race.

The fix is to only register iframe's onload once the test is at the
HTTPS location, similarly to what's done in
filesystem-url-in-iframe.html.

Bug: 756790
Change-Id: I63e22c25bd3c7adc374b09e227b1d30e36c3d75c
Reviewed-on: https://chromium-review.googlesource.com/651609Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Alex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#499989}
parent a28bda9e
......@@ -9,22 +9,24 @@
</p>
<script>
if (location.protocol != 'https:')
location = 'https://127.0.0.1:8443/security/mixedContent/blob-url-in-iframe.html';
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
testRunner.waitUntilDone();
}
var iframe = document.querySelector('iframe');
iframe.onload = function () {
if (window.testRunner)
testRunner.notifyDone();
};
var b = new Blob(['<h1>PASS (1/1)</h1>'], { type: 'text/html' });
iframe.src = URL.createObjectURL(b);
if (location.protocol != 'https:') {
location = 'https://127.0.0.1:8443/security/mixedContent/blob-url-in-iframe.html';
} else {
var iframe = document.querySelector('iframe');
iframe.onload = function () {
if (window.testRunner)
testRunner.notifyDone();
};
var b = new Blob(['<h1>PASS (1/1)</h1>'], { type: 'text/html' });
iframe.src = URL.createObjectURL(b);
}
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment