Title: [168426] trunk/LayoutTests
Revision
168426
Author
g.czajkow...@samsung.com
Date
2014-05-07 07:54:56 -0700 (Wed, 07 May 2014)

Log Message

Share mac/editing/spelling/editing-multiple-words-with-markers.html with other platforms
https://bugs.webkit.org/show_bug.cgi?id=132649

Reviewed by Ryosuke Niwa.

This test does not verify autocorrection feature which is only implemented
by Mac. Other WebKit ports might be interested in running it due to
verification of spelling markers after merging two misspelled words.

Additionally, add the test case confirming spelling markers
before any selection change.

Due to bug 125689, this test starts using asynchronous spellchecking.

* editing/spelling/editing-multiple-words-with-markers-expected.txt:
Renamed from platform/mac/editing/spelling/editing-multiple-words-with-markers-expected.txt
* editing/spelling/editing-multiple-words-with-markers.html:
Renamed from platform/mac/editing/spelling/editing-multiple-words-with-markers.html

* platform/gtk/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
Mark editing-multiple-words-with-markers.html as failing since those
platforms didn't turn on asynchronous spellchecking.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (168425 => 168426)


--- trunk/LayoutTests/ChangeLog	2014-05-07 14:07:02 UTC (rev 168425)
+++ trunk/LayoutTests/ChangeLog	2014-05-07 14:54:56 UTC (rev 168426)
@@ -1,3 +1,30 @@
+2014-05-07  Grzegorz Czajkowski  <g.czajkow...@samsung.com>
+
+        Share mac/editing/spelling/editing-multiple-words-with-markers.html with other platforms
+        https://bugs.webkit.org/show_bug.cgi?id=132649
+
+        Reviewed by Ryosuke Niwa.
+
+        This test does not verify autocorrection feature which is only implemented
+        by Mac. Other WebKit ports might be interested in running it due to
+        verification of spelling markers after merging two misspelled words.
+
+        Additionally, add the test case confirming spelling markers
+        before any selection change.
+
+        Due to bug 125689, this test starts using asynchronous spellchecking.
+
+        * editing/spelling/editing-multiple-words-with-markers-expected.txt:
+        Renamed from platform/mac/editing/spelling/editing-multiple-words-with-markers-expected.txt
+        * editing/spelling/editing-multiple-words-with-markers.html:
+        Renamed from platform/mac/editing/spelling/editing-multiple-words-with-markers.html
+
+        * platform/gtk/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+        * platform/win/TestExpectations:
+        Mark editing-multiple-words-with-markers.html as failing since those
+        platforms didn't turn on asynchronous spellchecking.
+
 2014-05-06  Antti Koivisto  <an...@apple.com>
 
         REGRESSION: Animated GIF inside compositing layer never resumes animation when scrolled back into view

Added: trunk/LayoutTests/editing/spelling/editing-multiple-words-with-markers-expected.txt (0 => 168426)


--- trunk/LayoutTests/editing/spelling/editing-multiple-words-with-markers-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/spelling/editing-multiple-words-with-markers-expected.txt	2014-05-07 14:54:56 UTC (rev 168426)
@@ -0,0 +1,21 @@
+The test verifies if the spelling markers disappear when the multiple misspelled words are concatenated by delete command. To test manually, type "it's a meagesga meagesga", then select and delete "esga meag". The test succeeds if the remaining text does not have any underline.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS internals.hasSpellingMarker(spellingPositions[0], spellingLengths[0]) became false
+PASS internals.hasSpellingMarker(spellingPositions[1], spellingLengths[1]) became true
+
+PASS internals.hasSpellingMarker(spellingPositions[0], spellingLengths[0]) became false
+PASS internals.hasSpellingMarker(spellingPositions[1], spellingLengths[1]) became false
+
+PASS internals.hasSpellingMarker(spellingPositions[0], spellingLengths[0]) became false
+PASS internals.hasSpellingMarker(spellingPositions[1], spellingLengths[1]) became false
+
+PASS internals.hasSpellingMarker(spellingPositions[0], spellingLengths[0]) became false
+PASS internals.hasSpellingMarker(spellingPositions[1], spellingLengths[1]) became false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/editing/spelling/editing-multiple-words-with-markers.html (0 => 168426)


--- trunk/LayoutTests/editing/spelling/editing-multiple-words-with-markers.html	                        (rev 0)
+++ trunk/LayoutTests/editing/spelling/editing-multiple-words-with-markers.html	2014-05-07 14:54:56 UTC (rev 168426)
@@ -0,0 +1,106 @@
+<html>
+<head>
+<script src=""
+<title>Editing multiple words with markers test</title>
+</head>
+<body>
+<textarea id="testElement"></textarea>
+<script src=""
+<script>
+description('The test verifies if the spelling markers disappear when '
+    + 'the multiple misspelled words are concatenated by delete command. '
+    + 'To test manually, type "it\'s a meagesga meagesga", then '
+    + 'select and delete "esga meag". The test succeeds '
+    + 'if the remaining text does not have any underline.');
+
+jsTestIsAsync = true;
+
+if (window.internals) {
+    internals.settings.setUnifiedTextCheckerEnabled(true);
+    internals.settings.setAsynchronousSpellCheckingEnabled(true);
+}
+
+function resetText() {
+    var textArea = document.getElementById('testElement');
+    textArea.value = "";
+    textArea.focus();
+    typeCharacterCommand('i');
+    typeCharacterCommand('t');
+    typeCharacterCommand('\'');
+    typeCharacterCommand('s');
+    typeCharacterCommand(' ');
+    typeCharacterCommand('a');
+    typeCharacterCommand(' ');
+    typeCharacterCommand('m');
+    typeCharacterCommand('e');
+    typeCharacterCommand('a');
+    typeCharacterCommand('g');
+    typeCharacterCommand('e');
+    typeCharacterCommand('s');
+    typeCharacterCommand('g');
+    typeCharacterCommand('a');
+    typeCharacterCommand(' ');
+    typeCharacterCommand('m');
+    typeCharacterCommand('e');
+    typeCharacterCommand('a');
+    typeCharacterCommand('g');
+    typeCharacterCommand('e');
+    typeCharacterCommand('s');
+    typeCharacterCommand('g');
+    typeCharacterCommand('a');
+    typeCharacterCommand(' ');
+}
+
+var testCases = [
+    { selectionRange: null, spellingMarkerPositions: [ 0, 7 ], spellingMarkerLengths: [ 4, 8 ], shouldBeMarked: [ false, true ] },
+    { selectionRange: [ 11, 20 ], spellingMarkerPositions: [ 7, 11 ], spellingMarkerLengths: [ 4, 4 ], shouldBeMarked: [ false, false] },
+    { selectionRange: [ 11, 16 ], spellingMarkerPositions: [ 7, 11 ], spellingMarkerLengths: [ 4, 8 ], shouldBeMarked: [ false, false] },
+    { selectionRange: [ 15, 20 ], spellingMarkerPositions: [ 7, 15 ], spellingMarkerLengths: [ 8, 4 ], shouldBeMarked: [ false, false] }
+];
+
+var spellingPositions;
+var spellingLengths;
+var markersExpectation;
+
+function checkSpellingMarkerAfterDeleteingSelection(selectionRange, spellingMarkerPositions, spellingMarkerLengths, shouldBeMarked)
+{
+    resetText();
+    if (selectionRange) {
+        document.getElementById('testElement').setSelectionRange(selectionRange[0], selectionRange[1]);
+        execDeleteCommand();
+    }
+
+    spellingPositions = spellingMarkerPositions;
+    spellingLengths = spellingMarkerLengths;
+    markersExpectation = shouldBeMarked;
+
+    if (window.internals) {
+        shouldBecomeEqual('internals.hasSpellingMarker(spellingPositions[0], spellingLengths[0])',
+            markersExpectation[0] ? 'true' : 'false', function() {
+                shouldBecomeEqual('internals.hasSpellingMarker(spellingPositions[1], spellingLengths[1])',
+                    markersExpectation[1] ? 'true' : 'false', function() {
+                        debug("");
+                        done();
+                    });
+            });
+    }
+}
+
+function done()
+{
+    var nextTestCase = testCases.shift();
+    if (nextTestCase)
+        return setTimeout(checkSpellingMarkerAfterDeleteingSelection(
+            nextTestCase.selectionRange,
+            nextTestCase.spellingMarkerPositions,
+            nextTestCase.spellingMarkerLengths,
+            nextTestCase.shouldBeMarked,
+            0));
+
+    finishJSTest();
+}
+done();
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (168425 => 168426)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2014-05-07 14:07:02 UTC (rev 168425)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2014-05-07 14:54:56 UTC (rev 168426)
@@ -1138,6 +1138,7 @@
 
 # Missing TextChecker::requestCheckingOfString() implementation for Gtk.
 webkit.org/b/73003 editing/spelling/delete-into-misspelled-word.html [ Skip ]
+webkit.org/b/73003 editing/spelling/editing-multiple-words-with-markers.html [ Skip ]
 webkit.org/b/73003 editing/spelling/spellcheck-async-mutation.html [ Skip ]
 webkit.org/b/73003 editing/spelling/spellcheck-async-remove-frame.html [ Skip ]
 webkit.org/b/73003 editing/spelling/spellcheck-async.html [ Skip ]

Deleted: trunk/LayoutTests/platform/mac/editing/spelling/editing-multiple-words-with-markers-expected.txt (168425 => 168426)


--- trunk/LayoutTests/platform/mac/editing/spelling/editing-multiple-words-with-markers-expected.txt	2014-05-07 14:07:02 UTC (rev 168425)
+++ trunk/LayoutTests/platform/mac/editing/spelling/editing-multiple-words-with-markers-expected.txt	2014-05-07 14:54:56 UTC (rev 168426)
@@ -1,7 +0,0 @@
-The test verified that when multiple words are modified by one editing command, their Spelling and Autocorrection markers are removed. When manully testing, type "it's a meagesga meagesga", then select and delete "esga meag", you should see the remaing text without any underline.
-
-
-SUCCESS
-SUCCESS
-SUCCESS
-

Deleted: trunk/LayoutTests/platform/mac/editing/spelling/editing-multiple-words-with-markers.html (168425 => 168426)


--- trunk/LayoutTests/platform/mac/editing/spelling/editing-multiple-words-with-markers.html	2014-05-07 14:07:02 UTC (rev 168425)
+++ trunk/LayoutTests/platform/mac/editing/spelling/editing-multiple-words-with-markers.html	2014-05-07 14:54:56 UTC (rev 168426)
@@ -1,85 +0,0 @@
-<html>
-<head>
-<script src="" language="_javascript_" type="text/_javascript_"></script>
-<title>Editing multiple words with markers test</title>
-</head>
-<body>
-<p>The test verified that when multiple words are modified by one editing command, their Spelling and 
-Autocorrection markers are removed. When manully testing, type "it's a meagesga meagesga", then 
-select and delete "esga meag", you should see the remaing text without any underline.</p>
-<textarea id="test" cols="80" rows="10"></textarea>
-<div id="console"></div>
-<script language="_javascript_" type="text/_javascript_">
-function resetText() {
-    document.getElementById('test').focus();
-    execSelectAllCommand();
-    execDeleteCommand();
-    typeCharacterCommand('i');
-    typeCharacterCommand('t');
-    typeCharacterCommand('\'');
-    typeCharacterCommand('s');
-    typeCharacterCommand(' ');
-    typeCharacterCommand('a');
-    typeCharacterCommand(' ');
-    typeCharacterCommand('m');
-    typeCharacterCommand('e');
-    typeCharacterCommand('a');
-    typeCharacterCommand('g');
-    typeCharacterCommand('e');
-    typeCharacterCommand('s');
-    typeCharacterCommand('g');
-    typeCharacterCommand('a');
-    typeCharacterCommand(' ');
-    typeCharacterCommand('m');
-    typeCharacterCommand('e');
-    typeCharacterCommand('a');
-    typeCharacterCommand('g');
-    typeCharacterCommand('e');
-    typeCharacterCommand('s');
-    typeCharacterCommand('g');
-    typeCharacterCommand('a');
-    typeCharacterCommand(' ');
-}
-
-if (window.testRunner) {
-    testRunner.dumpAsText();
-}
-
-textarea = document.getElementById('test');
-
-resetText();
-textarea.setSelectionRange(11, 20);
-execDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,4) == 0 && window.internals.hasSpellingMarker(11,4) == 0) {
-        document.getElementById('console').innerHTML = 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = "FAILURE. The word 'meagesga' has underline.<br>";
-    }
-}
-
-resetText();
-textarea.setSelectionRange(11, 16);
-execDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,4) == 0 && window.internals.hasSpellingMarker(11,8) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'meagmeagesga' has underline.<br>";
-    }
-}
-
-resetText();
-textarea.setSelectionRange(15, 20);
-execDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,8) == 0 && window.internals.hasSpellingMarker(15,4) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'meagesgaesga' has underline.<br>";
-    }
-}
-
-</script>
-</body>
-</html>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (168425 => 168426)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2014-05-07 14:07:02 UTC (rev 168425)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2014-05-07 14:54:56 UTC (rev 168426)
@@ -119,6 +119,7 @@
 webkit.org/b/105616 editing/spelling/context-menu-suggestions-multiword-selection.html
 webkit.org/b/105616 editing/spelling/context-menu-suggestions-subword-selection.html
 webkit.org/b/105616 editing/spelling/delete-into-misspelled-word.html
+webkit.org/b/105616 editing/spelling/editing-multiple-words-with-markers.html
 webkit.org/b/105616 editing/inserting/inserting-slash-inside-url-with-smart-link.html
 webkit.org/b/105616 editing/spelling/spelling-changed-text.html
 webkit.org/b/105616 editing/spelling/spelling-backspace-between-lines.html

Modified: trunk/LayoutTests/platform/win/TestExpectations (168425 => 168426)


--- trunk/LayoutTests/platform/win/TestExpectations	2014-05-07 14:07:02 UTC (rev 168425)
+++ trunk/LayoutTests/platform/win/TestExpectations	2014-05-07 14:54:56 UTC (rev 168426)
@@ -1933,6 +1933,7 @@
 
 # Spellchecker behavior tests.
 webkit.org/b/108370 editing/spelling/delete-into-misspelled-word.html [ Failure ]
+webkit.org/b/108370 editing/spelling/editing-multiple-words-with-markers.html [ Failure ]
 webkit.org/b/108370 editing/spelling/design-mode-spellcheck-off.html [ Failure ]
 webkit.org/b/108370 editing/spelling/context-menu-suggestions-multiword-selection.html [ Failure ]
 webkit.org/b/108370 editing/spelling/context-menu-suggestions-subword-selection.html [ Failure ]
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to