2011-03-05 Andrey Kosyakov <caseq@chromium.org>
authorcaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2011 14:34:58 +0000 (14:34 +0000)
committercaseq@chromium.org <caseq@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 5 Mar 2011 14:34:58 +0000 (14:34 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: inspector/extensions/extensions-events.html sometimes fails on Windows
        https://bugs.webkit.org/show_bug.cgi?id=54974

        Properly serialize test output to fix flakiness due to race with output during page reload.

        * inspector/extensions/extensions-events-expected.txt:
        * inspector/extensions/extensions-events.html:
        * platform/win/Skipped:

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

LayoutTests/ChangeLog
LayoutTests/inspector/extensions/extensions-events.html
LayoutTests/platform/win/Skipped

index 2a971ea..23245a5 100644 (file)
@@ -1,3 +1,16 @@
+2011-03-05  Andrey Kosyakov  <caseq@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: inspector/extensions/extensions-events.html sometimes fails on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=54974
+
+        Properly serialize test output to fix flakiness due to race with output during page reload.
+
+        * inspector/extensions/extensions-events-expected.txt:
+        * inspector/extensions/extensions-events.html:
+        * platform/win/Skipped:
+
 2011-03-05  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Reviewed by Yury Semikhatsky.
index ad60c22..1aa3f69 100755 (executable)
@@ -34,18 +34,26 @@ function extension_testOnResourceFinished(nextTest)
 function extension_testPageLoadEvents(nextTest)
 {
     var callbackCount = 0;
+    var onLoadArgument;
+
     webInspector.inspectedWindow.onDOMContentLoaded.addListener(function(time) {
         output("onDOMContentLoaded fired: " + typeof time);
     });
+
+    // Logging on onLoaded is tricky due to race conditions with output("Page reloaded") in page initialization code.
+    // So only log when we're sure both onLoaded fired and reload is done.
+    function reloadCallback()
+    {
+        if (++callbackCount < 2)
+            return;
+        output("onLoaded fired: " + typeof onLoadArgument);
+        nextTest();
+    }
     webInspector.inspectedWindow.onLoaded.addListener(function(time) {
-        output("onLoaded fired: " + typeof time);
-        if (++callbackCount > 1)
-            nextTest();
-    });
-    dispatchOnFrontend({ command: "reload" }, function() {
-        if (++callbackCount > 1)
-            nextTest();
+        onLoadArgument = time;
+        reloadCallback();
     });
+    dispatchOnFrontend({ command: "reload" }, reloadCallback);
 }
 
 </script>
index a66b6bf..19d695a 100644 (file)
@@ -410,9 +410,6 @@ http/tests/security/xssAuditor/script-tag-with-fancy-unicode.html
 # Needs windows-specific pixel results http://webkit.org/b/54757
 media/video-controls-in-media-document.html
 
-# Sometimes fails http://webkit.org/b/54974
-inspector/extensions/extensions-events.html
-
 # Sometimes crashes http://webkit.org/b/55375
 http/tests/websocket/tests/reload-crash.html