Title: [133934] trunk/LayoutTests
Revision
133934
Author
t...@chromium.org
Date
2012-11-08 12:41:16 -0800 (Thu, 08 Nov 2012)

Log Message

Layout test editing/pasteboard/file-drag-to-editable.html flaky
https://bugs.webkit.org/show_bug.cgi?id=101092

Reviewed by Ryosuke Niwa.

Fix a flaky test.  The problem was that we were confusing the test harness by
trying to do a navigation before the initial load finished (the notifyDone()
call did nothing because waitUntilDone() was missing).  Depending on the state
of the frame loader when the test run, there was a race in whether or not we
would dump the results before or after completing the script execution.

Fix this by restructuring the test to run during onload and by calling notifyDone()
after the file load attempt failed.

* editing/pasteboard/file-drag-to-editable-expected.txt:
* editing/pasteboard/script-tests/file-drag-to-editable.js:
(runTest.window.onbeforeunload): Simplify and don't run nofityDone yet.
(runTest): Run test during onload event.
* platform/chromium/TestExpectations: Remove flaky marker.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (133933 => 133934)


--- trunk/LayoutTests/ChangeLog	2012-11-08 20:37:24 UTC (rev 133933)
+++ trunk/LayoutTests/ChangeLog	2012-11-08 20:41:16 UTC (rev 133934)
@@ -1,3 +1,25 @@
+2012-11-08  Tony Chang  <t...@chromium.org>
+
+        Layout test editing/pasteboard/file-drag-to-editable.html flaky
+        https://bugs.webkit.org/show_bug.cgi?id=101092
+
+        Reviewed by Ryosuke Niwa.
+
+        Fix a flaky test.  The problem was that we were confusing the test harness by
+        trying to do a navigation before the initial load finished (the notifyDone()
+        call did nothing because waitUntilDone() was missing).  Depending on the state
+        of the frame loader when the test run, there was a race in whether or not we
+        would dump the results before or after completing the script execution.
+
+        Fix this by restructuring the test to run during onload and by calling notifyDone()
+        after the file load attempt failed.
+
+        * editing/pasteboard/file-drag-to-editable-expected.txt:
+        * editing/pasteboard/script-tests/file-drag-to-editable.js:
+        (runTest.window.onbeforeunload): Simplify and don't run nofityDone yet.
+        (runTest): Run test during onload event.
+        * platform/chromium/TestExpectations: Remove flaky marker.
+
 2012-11-08  Erik Arvidsson  <a...@chromium.org>
 
         Wrong error type is thrown for type errors in callbacks

Modified: trunk/LayoutTests/editing/pasteboard/file-drag-to-editable-expected.txt (133933 => 133934)


--- trunk/LayoutTests/editing/pasteboard/file-drag-to-editable-expected.txt	2012-11-08 20:37:24 UTC (rev 133933)
+++ trunk/LayoutTests/editing/pasteboard/file-drag-to-editable-expected.txt	2012-11-08 20:41:16 UTC (rev 133934)
@@ -3,6 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
+PASS window.attemptedFileNavigation is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/editing/pasteboard/script-tests/file-drag-to-editable.js (133933 => 133934)


--- trunk/LayoutTests/editing/pasteboard/script-tests/file-drag-to-editable.js	2012-11-08 20:37:24 UTC (rev 133933)
+++ trunk/LayoutTests/editing/pasteboard/script-tests/file-drag-to-editable.js	2012-11-08 20:41:16 UTC (rev 133934)
@@ -25,24 +25,23 @@
 function runTest()
 {
     window._onbeforeunload_ = function() {
-        shouldBeTrue('successfullyParsed');
-        debug('<br /><span class="pass">TEST COMPLETE</span>');
+        window.attemptedFileNavigation = true;
 
         // Don't remove the editable node, since we want to make sure there no stray file URLs were
         // inserted during the drop.
-
-        testRunner.notifyDone();
-
-        window._onbeforeunload_ = null;
     };
     dragFilesOntoEditableArea(['DRTFakeFile']);
-    testFailed('The test should have resulted in navigation');
+
+    shouldBeTrue("window.attemptedFileNavigation");
+    finishJSTest();
 }
 
 var successfullyParsed = true;
 
-if (window.eventSender) {
-    runTest();
+if (window.eventSender && window.testRunner) {
+    window.jsTestIsAsync = true;
+
+    window._onload_ = runTest;
 } else {
     testFailed('This test is not interactive, please run using DumpRenderTree');
 }

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (133933 => 133934)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2012-11-08 20:37:24 UTC (rev 133933)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2012-11-08 20:41:16 UTC (rev 133934)
@@ -4074,9 +4074,6 @@
 # This ref-test doesn't work on Chromium Mac ("Test" is offset).
 webkit.org/b/101093 [ Mac ] fast/sub-pixel/float-wrap-zoom.html [ ImageOnlyFailure ]
 
-# Flaky since r133069
-webkit.org/b/101092 [ Mac Win Debug ] editing/pasteboard/file-drag-to-editable.html [ Failure Pass ]
-
 # Crashy since at least r133035; gives a v8 error
 webkit.org/b/101099 [ Linux Debug ] fast/files/workers/worker-apply-blob-url-to-xhr.html [ Crash Pass ]
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to