Title: [137953] trunk/LayoutTests
Revision
137953
Author
[email protected]
Date
2012-12-17 15:54:18 -0800 (Mon, 17 Dec 2012)

Log Message

Layout Test editing/selection/move-by-character-crash-test-textarea.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=104951

Reviewed by Eric Seidel.

The problem was that editing/selection/move-by-character-6.html was running editing commands
in a timer without making the test runner wait. Fixed the bug by calling waitUntilDone and
notifyDone at appropriate places in editing.js.

We don't need to rebaseline other tests since this is the only test that uses commandDelay.

* editing/editing.js:
(setSelectionCommand):
(transposeCharactersCommand):
(moveSelectionLeftByCharacterCommand):
(moveSelectionRightByCharacterCommand):
(extendSelectionLeftByCharacterCommand):
(extendSelectionRightByCharacterCommand):
(moveSelectionForwardByCharacterCommand):
(extendSelectionForwardByCharacterCommand):
(moveSelectionForwardByWordCommand):
(extendSelectionForwardByWordCommand):
(moveSelectionForwardBySentenceCommand):
(extendSelectionForwardBySentenceCommand):
(moveSelectionForwardByLineCommand):
(extendSelectionForwardByLineCommand):
(moveSelectionForwardByLineBoundaryCommand):
(extendSelectionForwardByLineBoundaryCommand):
(moveSelectionBackwardByCharacterCommand):
(extendSelectionBackwardByCharacterCommand):
(moveSelectionBackwardByWordCommand):
(extendSelectionBackwardByWordCommand):
(moveSelectionBackwardBySentenceCommand):
(extendSelectionBackwardBySentenceCommand):
(moveSelectionBackwardByLineCommand):
(extendSelectionBackwardByLineCommand):
(extendSelectionBackwardByLineBoundaryCommand):
(moveSelectionBackwardByLineBoundaryCommand):
(boldCommand):
(underlineCommand):
(fontNameCommand):
(fontSizeCommand):
(fontSizeDeltaCommand):
(italicCommand):
(justifyCenterCommand):
(justifyLeftCommand):
(justifyRightCommand):
(insertHTMLCommand):
(insertImageCommand):
(insertLineBreakCommand):
(insertParagraphCommand):
(insertNewlineInQuotedContentCommand):
(typeCharacterCommand):
(selectAllCommand):
(strikethroughCommand):
(undoCommand):
(redoCommand):
(changeRootSize):
(cutCommand):
(copyCommand):
(pasteCommand):
(createLinkCommand):
(unlinkCommand):
(pasteAndMatchStyleCommand):
(deleteCommand):
(forwardDeleteCommand):
(backColorCommand):
(foreColorCommand):
(executeCommand):
* platform/mac/editing/selection/move-by-character-6-expected.txt: Rebaselined.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (137952 => 137953)


--- trunk/LayoutTests/ChangeLog	2012-12-17 23:28:08 UTC (rev 137952)
+++ trunk/LayoutTests/ChangeLog	2012-12-17 23:54:18 UTC (rev 137953)
@@ -1,3 +1,76 @@
+2012-12-14  Ryosuke Niwa  <[email protected]>
+
+        Layout Test editing/selection/move-by-character-crash-test-textarea.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=104951
+
+        Reviewed by Eric Seidel.
+
+        The problem was that editing/selection/move-by-character-6.html was running editing commands
+        in a timer without making the test runner wait. Fixed the bug by calling waitUntilDone and
+        notifyDone at appropriate places in editing.js.
+
+        We don't need to rebaseline other tests since this is the only test that uses commandDelay.
+
+        * editing/editing.js:
+        (setSelectionCommand):
+        (transposeCharactersCommand):
+        (moveSelectionLeftByCharacterCommand):
+        (moveSelectionRightByCharacterCommand):
+        (extendSelectionLeftByCharacterCommand):
+        (extendSelectionRightByCharacterCommand):
+        (moveSelectionForwardByCharacterCommand):
+        (extendSelectionForwardByCharacterCommand):
+        (moveSelectionForwardByWordCommand):
+        (extendSelectionForwardByWordCommand):
+        (moveSelectionForwardBySentenceCommand):
+        (extendSelectionForwardBySentenceCommand):
+        (moveSelectionForwardByLineCommand):
+        (extendSelectionForwardByLineCommand):
+        (moveSelectionForwardByLineBoundaryCommand):
+        (extendSelectionForwardByLineBoundaryCommand):
+        (moveSelectionBackwardByCharacterCommand):
+        (extendSelectionBackwardByCharacterCommand):
+        (moveSelectionBackwardByWordCommand):
+        (extendSelectionBackwardByWordCommand):
+        (moveSelectionBackwardBySentenceCommand):
+        (extendSelectionBackwardBySentenceCommand):
+        (moveSelectionBackwardByLineCommand):
+        (extendSelectionBackwardByLineCommand):
+        (extendSelectionBackwardByLineBoundaryCommand):
+        (moveSelectionBackwardByLineBoundaryCommand):
+        (boldCommand):
+        (underlineCommand):
+        (fontNameCommand):
+        (fontSizeCommand):
+        (fontSizeDeltaCommand):
+        (italicCommand):
+        (justifyCenterCommand):
+        (justifyLeftCommand):
+        (justifyRightCommand):
+        (insertHTMLCommand):
+        (insertImageCommand):
+        (insertLineBreakCommand):
+        (insertParagraphCommand):
+        (insertNewlineInQuotedContentCommand):
+        (typeCharacterCommand):
+        (selectAllCommand):
+        (strikethroughCommand):
+        (undoCommand):
+        (redoCommand):
+        (changeRootSize):
+        (cutCommand):
+        (copyCommand):
+        (pasteCommand):
+        (createLinkCommand):
+        (unlinkCommand):
+        (pasteAndMatchStyleCommand):
+        (deleteCommand):
+        (forwardDeleteCommand):
+        (backColorCommand):
+        (foreColorCommand):
+        (executeCommand):
+        * platform/mac/editing/selection/move-by-character-6-expected.txt: Rebaselined.
+
 2012-12-17  Filip Pizlo  <[email protected]>
 
         _javascript_ integer overflow

Modified: trunk/LayoutTests/editing/editing.js (137952 => 137953)


--- trunk/LayoutTests/editing/editing.js	2012-12-17 23:28:08 UTC (rev 137952)
+++ trunk/LayoutTests/editing/editing.js	2012-12-17 23:54:18 UTC (rev 137953)
@@ -16,7 +16,7 @@
 // Args are startNode, startOffset, endNode, endOffset
 function setSelectionCommand(sn, so, en, eo) {
     if (commandDelay > 0) {
-        window.setTimeout(execSetSelectionCommand, commandCount * commandDelay, sn, so, en, eo);
+        queueCommand(execSetSelectionCommand.bind(execSetSelectionCommand, sn, so, en, eo), commandCount * commandDelay);
         commandCount++;
     } else
         execSetSelectionCommand(sn, so, en, eo);
@@ -29,7 +29,7 @@
 }
 function transposeCharactersCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execTransposeCharactersCommand, commandCount * commandDelay);
+        queueCommand(execTransposeCharactersCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -44,7 +44,7 @@
 }
 function moveSelectionLeftByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionLeftByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionLeftByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -59,7 +59,7 @@
 }
 function moveSelectionRightByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionRightByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionRightByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -74,7 +74,7 @@
 }
 function extendSelectionLeftByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionLeftByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionLeftByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -89,7 +89,7 @@
 }
 function extendSelectionRightByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionRightByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionRightByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -104,7 +104,7 @@
 }
 function moveSelectionForwardByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionForwardByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionForwardByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -119,7 +119,7 @@
 }
 function extendSelectionForwardByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionForwardByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionForwardByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -134,7 +134,7 @@
 }
 function moveSelectionForwardByWordCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionForwardByWordCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionForwardByWordCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -149,7 +149,7 @@
 }
 function extendSelectionForwardByWordCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionForwardByWordCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionForwardByWordCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -164,7 +164,7 @@
 }
 function moveSelectionForwardBySentenceCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionForwardBySentenceCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionForwardBySentenceCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -179,7 +179,7 @@
 }
 function extendSelectionForwardBySentenceCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionForwardBySentenceCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionForwardBySentenceCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -194,7 +194,7 @@
 }
 function moveSelectionForwardByLineCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionForwardByLineCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionForwardByLineCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -209,7 +209,7 @@
 }
 function extendSelectionForwardByLineCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionForwardByLineCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionForwardByLineCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -224,7 +224,7 @@
 }
 function moveSelectionForwardByLineBoundaryCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionForwardByLineBoundaryCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionForwardByLineBoundaryCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -239,7 +239,7 @@
 }
 function extendSelectionForwardByLineBoundaryCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionForwardByLineBoundaryCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionForwardByLineBoundaryCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -254,7 +254,7 @@
 }
 function moveSelectionBackwardByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionBackwardByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionBackwardByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -269,7 +269,7 @@
 }
 function extendSelectionBackwardByCharacterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionBackwardByCharacterCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionBackwardByCharacterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -284,7 +284,7 @@
 }
 function moveSelectionBackwardByWordCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionBackwardByWordCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionBackwardByWordCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -299,7 +299,7 @@
 }
 function extendSelectionBackwardByWordCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionBackwardByWordCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionBackwardByWordCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -314,7 +314,7 @@
 }
 function moveSelectionBackwardBySentenceCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionBackwardBySentenceCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionBackwardBySentenceCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -329,7 +329,7 @@
 }
 function extendSelectionBackwardBySentenceCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionBackwardBySentenceCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionBackwardBySentenceCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -344,7 +344,7 @@
 }
 function moveSelectionBackwardByLineCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionBackwardByLineCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionBackwardByLineCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -359,7 +359,7 @@
 }
 function extendSelectionBackwardByLineCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionBackwardByLineCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionBackwardByLineCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -374,7 +374,7 @@
 }
 function extendSelectionBackwardByLineBoundaryCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execExtendSelectionBackwardByLineBoundaryCommand, commandCount * commandDelay);
+        queueCommand(execExtendSelectionBackwardByLineBoundaryCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -389,7 +389,7 @@
 }
 function moveSelectionBackwardByLineBoundaryCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execMoveSelectionBackwardByLineBoundaryCommand, commandCount * commandDelay);
+        queueCommand(execMoveSelectionBackwardByLineBoundaryCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -422,7 +422,7 @@
 }
 function boldCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execBoldCommand, commandCount * commandDelay);
+        queueCommand(execBoldCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -438,7 +438,7 @@
 }
 function underlineCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execUnderlineCommand, commandCount * commandDelay);
+        queueCommand(execUnderlineCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -454,7 +454,7 @@
 }
 function fontNameCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execFontNameCommand, commandCount * commandDelay);
+        queueCommand(execFontNameCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -472,7 +472,7 @@
 }
 function fontSizeCommand(s) {
     if (commandDelay > 0) {
-        window.setTimeout(execFontSizeCommand, commandCount * commandDelay, s);
+        queueCommand(execFontSizeCommand, commandCount * commandDelay, s);
         commandCount++;
     }
     else {
@@ -490,7 +490,7 @@
 }
 function fontSizeDeltaCommand(s) {
     if (commandDelay > 0) {
-        window.setTimeout(execFontSizeDeltaCommand, commandCount * commandDelay, s);
+        queueCommand(execFontSizeDeltaCommand.bind(execFontSizeDeltaCommand, s), commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -506,7 +506,7 @@
 }
 function italicCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execItalicCommand, commandCount * commandDelay);
+        queueCommand(execItalicCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -523,7 +523,7 @@
 }
 function justifyCenterCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execJustifyCenterCommand, commandCount * commandDelay);
+        queueCommand(execJustifyCenterCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -540,7 +540,7 @@
 }
 function justifyLeftCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execJustifyLeftCommand, commandCount * commandDelay);
+        queueCommand(execJustifyLeftCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -557,7 +557,7 @@
 }
 function justifyRightCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execJustifyRightCommand, commandCount * commandDelay);
+        queueCommand(execJustifyRightCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -573,7 +573,7 @@
 }
 function insertHTMLCommand(html) {
     if (commandDelay > 0) {
-        window.setTimeout(execInsertHTMLCommand, commandCount * commandDelay, html);
+        queueCommand(execInsertHTMLCommand.bind(execInsertHTMLCommand, html), commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -589,7 +589,7 @@
 }
 function insertImageCommand(imgSrc) {
     if (commandDelay > 0) {
-        window.setTimeout(execInsertImageCommand, commandCount * commandDelay, imgSrc);
+        queueCommand(execInsertImageCommand.bind(execInsertImageCommand, imgSrc), commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -605,7 +605,7 @@
 }
 function insertLineBreakCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execInsertLineBreakCommand, commandCount * commandDelay);
+        queueCommand(execInsertLineBreakCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -621,7 +621,7 @@
 }
 function insertParagraphCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execInsertParagraphCommand, commandCount * commandDelay);
+        queueCommand(execInsertParagraphCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -637,7 +637,7 @@
 }
 function insertNewlineInQuotedContentCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execInsertNewlineInQuotedContentCommand, commandCount * commandDelay);
+        queueCommand(execInsertNewlineInQuotedContentCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -655,7 +655,7 @@
 }
 function typeCharacterCommand(c) {
     if (commandDelay > 0) {
-        window.setTimeout(execTypeCharacterCommand, commandCount * commandDelay, c);
+        queueCommand(execTypeCharacterCommand.bind(execTypeCharacterCommand, c), commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -670,7 +670,7 @@
 }
 function selectAllCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execSelectAllCommand, commandCount * commandDelay);
+        queueCommand(execSelectAllCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -686,7 +686,7 @@
 }
 function strikethroughCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execStrikethroughCommand, commandCount * commandDelay);
+        queueCommand(execStrikethroughCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -702,7 +702,7 @@
 }
 function undoCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execUndoCommand, commandCount * commandDelay);
+        queueCommand(execUndoCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -718,7 +718,7 @@
 }
 function redoCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execRedoCommand, commandCount * commandDelay);
+        queueCommand(execRedoCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -733,7 +733,7 @@
 }
 function changeRootSize() {
     if (commandDelay > 0) {
-        window.setTimeout(execChangeRootSize, commandCount * commandDelay);
+        queueCommand(execChangeRootSize, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -749,7 +749,7 @@
 }
 function cutCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execCutCommand, commandCount * commandDelay);
+        queueCommand(execCutCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -765,7 +765,7 @@
 }
 function copyCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execCopyCommand, commandCount * commandDelay);
+        queueCommand(execCopyCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -781,7 +781,7 @@
 }
 function pasteCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execPasteCommand, commandCount * commandDelay);
+        queueCommand(execPasteCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -797,7 +797,7 @@
 }
 function createLinkCommand(url) {
     if (commandDelay > 0) {
-        window.setTimeout(execCreateLinkCommand, commandCount * commandDelay, url);
+        queueCommand(execCreateLinkCommand.bind(execCreateLinkCommand, url), commandCount * commandDelay);
         commandCount++;
     } else
         execCreateLinkCommand(url);
@@ -811,7 +811,7 @@
 }
 function unlinkCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execUnlinkCommand, commandCount * commandDelay);
+        queueCommand(execUnlinkCommand, commandCount * commandDelay);
         commandCount++;
     } else
         execUnlinkCommand();
@@ -825,7 +825,7 @@
 }
 function pasteAndMatchStyleCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execPasteAndMatchStyleCommand, commandCount * commandDelay);
+        queueCommand(execPasteAndMatchStyleCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -841,7 +841,7 @@
 }
 function deleteCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execDeleteCommand, commandCount * commandDelay);
+        queueCommand(execDeleteCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -857,7 +857,7 @@
 }
 function forwardDeleteCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execForwardDeleteCommand, commandCount * commandDelay);
+        queueCommand(execForwardDeleteCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -867,6 +867,32 @@
 
 //-------------------------------------------------------------------------------------------------------
 
+(function () {
+    var queue = [];
+    var i = 0;
+    var timer;
+
+    function queueCommand(callback) {
+        queue.push(callback);
+        if (!timer) {
+            if (window.testRunner)
+                testRunner.waitUntilDone();
+            timer = setTimeout(runCommand, commandDelay);
+        }
+    }
+
+    function runCommand() {
+        queue[i]();
+        i++;
+        if (i < queue.length)
+            setTimeout(runCommand, commandDelay);
+        else if (window.testRunner)
+            testRunner.notifyDone();
+    }
+    
+    window.queueCommand = queueCommand;
+})();
+
 function runEditingTest() {
     if (window.testRunner)
         testRunner.dumpEditingCallbacks();
@@ -914,7 +940,7 @@
 }
 function backColorCommand() {
     if (commandDelay > 0) {
-        window.setTimeout(execBackColorCommand, commandCount * commandDelay);
+        queueCommand(execBackColorCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {
@@ -929,7 +955,7 @@
 }
 function foreColorCommand(color) {
     if (commandDelay > 0) {
-        window.setTimeout(execForeColorCommand, commandCount * commandDelay, color);
+        queueCommand(execForeColorCommand.bind(execForeColorCommand, color), commandCount * commandDelay);
         commandCount++;
     } else
         execForeColorCommand(color);
@@ -944,7 +970,7 @@
 
 function executeCommand(command,arg1,arg2) {
     if (commandDelay > 0) {
-        window.setTimeout(runCommand, commandCount * commandDelay);
+        queueCommand(runCommand, commandCount * commandDelay);
         commandCount++;
     }
     else {

Modified: trunk/LayoutTests/platform/mac/editing/selection/move-by-character-6-expected.txt (137952 => 137953)


--- trunk/LayoutTests/platform/mac/editing/selection/move-by-character-6-expected.txt	2012-12-17 23:28:08 UTC (rev 137952)
+++ trunk/LayoutTests/platform/mac/editing/selection/move-by-character-6-expected.txt	2012-12-17 23:54:18 UTC (rev 137953)
@@ -1,6 +1,28 @@
 EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
 EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
 layer at (0,0) size 800x600
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to