Commit 8584b146 authored by dcheng@chromium.org's avatar dcheng@chromium.org

Deflake LayoutTests/http/tests/security/cross-origin-appcache-allowed.html

The iframe load was racing with the main frame setting the onmessage
event handler. To fix this, defer the iframe loads until the main frame
onmessage event handler has already been set.

BUG=none

Review URL: https://codereview.chromium.org/704413010

git-svn-id: svn://svn.chromium.org/blink/trunk@185150 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent d7653780
......@@ -2,22 +2,27 @@
<head>
<script>
var frames = 2;
if (window.testRunner) {
function runTest()
{
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
testRunner.waitUntilDone();
}
window.onmessage = function(message) {
}
window.onmessage = function(message) {
--frames;
if (frames <= 0 && window.testRunner)
testRunner.notifyDone();
}
document.getElementById('frame1').src = "http://localhost:8000/security/resources/cross-origin-iframe-for-appcache-allowed.html";
document.getElementById('frame2').src = "http://127.0.0.1:8000/security/resources/cross-origin-iframe-for-appcache-allowed.html";
}
</script>
</head>
<body>
<body onload="runTest()">
<p>This iframe should have a cache:</p>
<iframe src="http://localhost:8000/security/resources/cross-origin-iframe-for-appcache-allowed.html"></iframe>
<iframe id="frame1"></iframe>
<p>This iframe should have a cache:</p>
<iframe src="http://127.0.0.1:8000/security/resources/cross-origin-iframe-for-appcache-allowed.html"></iframe>
<iframe id="frame2"></iframe>
</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