http/tests/loading/empty-urls.html shouldn't
authorjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 18:37:07 +0000 (18:37 +0000)
committerjaphet@chromium.org <japhet@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 18:37:07 +0000 (18:37 +0000)
fail if the load event fires before we finish.
https://bugs.webkit.org/show_bug.cgi?id=67359

Reviewed by Adam Barth.

* http/tests/loading/empty-urls-expected.txt:
* http/tests/loading/empty-urls.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94320 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/loading/empty-urls-expected.txt
LayoutTests/http/tests/loading/empty-urls.html

index b27f21b..cc43110 100644 (file)
@@ -1,3 +1,14 @@
+2011-09-01  Nate Chapin  <japhet@chromium.org>
+
+        http/tests/loading/empty-urls.html shouldn't
+        fail if the load event fires before we finish.
+        https://bugs.webkit.org/show_bug.cgi?id=67359
+
+        Reviewed by Adam Barth.
+
+        * http/tests/loading/empty-urls-expected.txt:
+        * http/tests/loading/empty-urls.html:
+
 2011-09-01  Sam Weinig  <sam@webkit.org>
 
         WebGLContextEvent should have its own JS wrapper
index 7089d26..0b5f1c2 100644 (file)
@@ -2,6 +2,7 @@ main frame - didStartProvisionalLoadForFrame
 main frame - didCommitLoadForFrame
 main frame - didFinishDocumentLoadForFrame
 main frame - didFinishLoadForFrame
+main frame - didHandleOnloadEventsForFrame
 PASS: img onerror fired
 PASS: input type=image onerror fired
 PASS: script onerror fired
index 8d45a6a..5adc50c 100644 (file)
@@ -9,6 +9,7 @@ if (window.layoutTestController) {
 var expectedPasses = 6;
 var messages = new Array();
 var currentMessageIndex = 0;
+var onloadFired = false;
 
 function log(message)
 {
@@ -26,7 +27,12 @@ function logPass(message, messageNumber)
     }
 
     expectedPasses--;
-    if (expectedPasses == 0 && window.layoutTestController)
+    checkIfDone();
+}
+
+function checkIfDone()
+{
+    if (expectedPasses == 0 && onloadFired && window.layoutTestController)
         layoutTestController.notifyDone();
 }
 </script>
@@ -34,7 +40,7 @@ function logPass(message, messageNumber)
 <link rel="prefetch" src="" href="" onerror="log('FAIL: link rel=prefetch onerror fired')"></link>
 <link rel="stylesheet" src="" href="" onerror="log('FAIL: link rel=stylesheet onerror fired')"></link>
 </head>
-<body>
+<body onload="setTimeout('onloadFired = true; checkIfDone();', 0)">
 <div id="console"></div>
 <command icon="" onerror="log('FAIL: command onerror fired')"></command>
 <object data="" onerror="log('FAIL: object onerror fired')"></object>