Reviewed by Eric Seidel.
authorap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Sep 2008 13:23:51 +0000 (13:23 +0000)
committerap@webkit.org <ap@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 28 Sep 2008 13:23:51 +0000 (13:23 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=20366
        Reproducible test failure for editing/undo/undo-iframe-location-change.html

        This does not fix the problem, but makes the test more predictable by using iframe onload.
        Also, makes the test runnable in browser. Turns out that the test reliably fails there too,
        even without any special steps needed in DRT.

        * editing/undo/undo-iframe-location-change-expected.txt:
        * editing/undo/undo-iframe-location-change.html:

        * ChangeLog-2007-10-14: Added bug URLs for a patch that included this test.

WebCore:
        * ChangeLog-2006-05-10: Added bug URLs for a fix that included this test.

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

LayoutTests/ChangeLog
LayoutTests/ChangeLog-2007-10-14
LayoutTests/editing/undo/undo-iframe-location-change-expected.txt
LayoutTests/editing/undo/undo-iframe-location-change.html
WebCore/ChangeLog
WebCore/ChangeLog-2006-05-10

index 2d76166..d34ff6d 100644 (file)
@@ -1,3 +1,19 @@
+2008-09-28  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=20366
+        Reproducible test failure for editing/undo/undo-iframe-location-change.html
+
+        This does not fix the problem, but makes the test more predictable by using iframe onload.
+        Also, makes the test runnable in browser. Turns out that the test reliably fails there too,
+        even without any special steps needed in DRT.
+
+        * editing/undo/undo-iframe-location-change-expected.txt:
+        * editing/undo/undo-iframe-location-change.html:
+
+        * ChangeLog-2007-10-14: Added bug URLs for a patch that included this test.
+
 2008-09-27  Dan Bernstein  <mitz@apple.com>
 
         Rubber-stamped by Sam Weinig.
index b66868f..ec4dbed 100644 (file)
@@ -57145,8 +57145,8 @@ text-clip was an incorrect test, rather than an incorrect result
 
         Reviewed by mjs
         
-        <http://tinymce.moxiecode.com/example_full.php?example=true>
-        TinyMCE: Undo still enabled after a location change, crashes if performed
+        https://bugs.webkit.org/show_bug.cgi?id=7150
+        <rdar://4433765> TinyMCE: Undo still enabled after a location change, crashes if performed
 
         * editing/undo/undo-iframe-location-change-expected.txt: Added.
         * editing/undo/undo-iframe-location-change.html: Added.
index a560bbe..5d26d33 100644 (file)
@@ -1,9 +1,2 @@
-EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of BODY > HTML > #document to 1 of BODY > HTML > #document
-EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of BODY > HTML > #document to 0 of BODY > HTML > #document toDOMRange:range from 1 of #text > BODY > HTML > #document to 1 of #text > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 
 Success
index 738d24c..df5dd5b 100644 (file)
@@ -1,10 +1,5 @@
-<script>
-if (window.layoutTestController)
-     layoutTestController.dumpEditingCallbacks();
-</script>
-
 <script src="../editing.js"></script>
-<iframe name="iframe" src="../resources/contenteditable-iframe-src.html"></iframe>
+<iframe name="iframe" src="../resources/contenteditable-iframe-src.html" onload="runTest()"></iframe>
 <ul id="console"></ul>
 
 <script>
@@ -17,43 +12,53 @@ function log(message) {
 }
 
 function part1() {
-
-    // Hack to focus the frame, should be able to do frames['iframe'].focus()
-    eventSender.mouseMoveTo(50, 50);
-    eventSender.mouseDown();
-    eventSender.mouseUp();
+    frames['iframe'].document.body.focus();
     
     // Hack to perform the editing command.  Should be able to 
     // call execCommand on the main document.
     frames['iframe'].document.execCommand('InsertText', false, 'c');
-    
+
+    if (frames['iframe'].document.body.innerText != 'c') {
+        log("FAIL: could not insert text.");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+        return;
+    }
+
+    if (!document.queryCommandEnabled('Undo')) {
+        log("FAIL: Undo is not enabled after text insertion.");
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+        return;
+    }
+
     window.location = window.location.toString() + "?part2";
 }
 
 function part2() {
+    if (frames['iframe'].document.body.innerText != '')
+        log("FAIL: subframe still has old content after navigaiton.");
+
     if (!document.queryCommandEnabled('Undo'))
         log("Success");
     else
-        log("Failure, Undo was still enabled after the location changed.");
+        log("Failure, Undo was still enabled after the location changed (but at least we didn't crash!)");
         
-    window.layoutTestController.notifyDone();
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
 }
 
 function runTest() {
-    if (!window.layoutTestController)
-        return;
-
     if (window.location.toString().indexOf("?part2") == -1) {
-        window.layoutTestController.waitUntilDone();
-        window.layoutTestController.dumpAsText();
-        // Give the iframe a moment to come into being.
-        window.setTimeout(part1, 100);
+        part1();
     } else {
         part2();
     }
-
 }
 
-runTest();
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+    layoutTestController.dumpAsText();
+}
 
-</script>
\ No newline at end of file
+</script>
index 2abc923..4ad3bbc 100644 (file)
@@ -1,3 +1,12 @@
+2008-09-28  Alexey Proskuryakov  <ap@webkit.org>
+
+        Reviewed by Eric Seidel.
+
+        https://bugs.webkit.org/show_bug.cgi?id=20366
+        Reproducible test failure for editing/undo/undo-iframe-location-change.html
+
+        * ChangeLog-2006-05-10: Added bug URLs for a fix that included this test.
+
 2008-09-28  Darin Adler  <darin@apple.com>
 
         Reviewed by Sam Weinig (except for a few comment and header tweaks).
index c981a82..744ab98 100644 (file)
 
         Reviewed by mjs
         
-        <http://tinymce.moxiecode.com/example_full.php?example=true>
-        TinyMCE: Undo still enabled after a location change, crashes if performed
+        https://bugs.webkit.org/show_bug.cgi?id=7150
+        <rdar://4433765> TinyMCE: Undo still enabled after a location change, crashes if performed
         
         Can't clear undo/redo operations registered by subframes in didOpenURL,
         because subframes have already been detached.