Title: [261796] trunk/LayoutTests
Revision
261796
Author
[email protected]
Date
2020-05-17 21:14:57 -0700 (Sun, 17 May 2020)

Log Message

Make editing-word-with-marker-1.html work on iOS
https://bugs.webkit.org/show_bug.cgi?id=211814

Reviewed by Simon Fraser and David Kilzer.

Minimal changes needed to make the test work on iOS + rebase the results. I was tempted to go
full js-test.js conversion, but I didn't do so to reduce the risk I introduce a bug and I think
is good enough.

To make the test work on iOS I enable internals.setContinuousSpellCheckingEnabled() + use UIHelper
to activate the textarea + blur the textarea on reset (for maximal code reuse). I didn't enable this
via the WKTR option spellCheckingDots because this test should be capable of running in DumpRenderTree
though we don't actually run DumpRenderTree for iOS on any bots. So, I did this largely for just for me.

* editing/mac/spelling/editing-word-with-marker-1-expected.txt:
* editing/mac/spelling/editing-word-with-marker-1.html:
* platform/ios/TestExpectations: Temporarily mark this test as PASS here so that iOS runs it even
though its in a Mac-specific directory. I will remove this entry when I move the test to editing/spelling
in the fix for <https://webkit.org/b/211802>.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261795 => 261796)


--- trunk/LayoutTests/ChangeLog	2020-05-17 19:42:07 UTC (rev 261795)
+++ trunk/LayoutTests/ChangeLog	2020-05-18 04:14:57 UTC (rev 261796)
@@ -1,3 +1,25 @@
+2020-05-17  Daniel Bates  <[email protected]>
+
+        Make editing-word-with-marker-1.html work on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=211814
+
+        Reviewed by Simon Fraser and David Kilzer.
+
+        Minimal changes needed to make the test work on iOS + rebase the results. I was tempted to go
+        full js-test.js conversion, but I didn't do so to reduce the risk I introduce a bug and I think
+        is good enough.
+
+        To make the test work on iOS I enable internals.setContinuousSpellCheckingEnabled() + use UIHelper
+        to activate the textarea + blur the textarea on reset (for maximal code reuse). I didn't enable this
+        via the WKTR option spellCheckingDots because this test should be capable of running in DumpRenderTree
+        though we don't actually run DumpRenderTree for iOS on any bots. So, I did this largely for just for me.
+
+        * editing/mac/spelling/editing-word-with-marker-1-expected.txt:
+        * editing/mac/spelling/editing-word-with-marker-1.html:
+        * platform/ios/TestExpectations: Temporarily mark this test as PASS here so that iOS runs it even
+        though its in a Mac-specific directory. I will remove this entry when I move the test to editing/spelling
+        in the fix for <https://webkit.org/b/211802>.
+
 2020-05-17  Andy Estes  <[email protected]>
 
         http/tests/ssl/applepay/ApplePayInstallmentConfiguration.https.html fails in public SDK builds

Modified: trunk/LayoutTests/editing/mac/spelling/editing-word-with-marker-1-expected.txt (261795 => 261796)


--- trunk/LayoutTests/editing/mac/spelling/editing-word-with-marker-1-expected.txt	2020-05-17 19:42:07 UTC (rev 261795)
+++ trunk/LayoutTests/editing/mac/spelling/editing-word-with-marker-1-expected.txt	2020-05-18 04:14:57 UTC (rev 261796)
@@ -1,15 +1,15 @@
-The test verified that when a word is modified, its Spelling and Autocorrection Markers are removed. When manully testing, type "it's a meagesga", then edit the word "meagesga". You should see the underline under the modified "meagesga" disppears after editing.
+The test verified that when a word is modified, its spelling markers are removed. When manually testing, type "it's a meagesga", then edit the word "meagesga". You should see the underline under the modified "meagesga" disppears after editing.
 
 
 SUCCESS
-FAILURE. The word 'ameagesga' has underline.
-FAILURE. The word 'eagesga' has underline.
-FAILURE. The segment 'mea gesga' has underline.
 SUCCESS
-FAILURE. The segment 'mea ga' has underline.
-FAILURE. The word 'ameagesga' has underline.
 SUCCESS
 SUCCESS
 SUCCESS
 SUCCESS
+SUCCESS
+SUCCESS
+SUCCESS
+SUCCESS
+SUCCESS
 

Modified: trunk/LayoutTests/editing/mac/spelling/editing-word-with-marker-1.html (261795 => 261796)


--- trunk/LayoutTests/editing/mac/spelling/editing-word-with-marker-1.html	2020-05-17 19:42:07 UTC (rev 261795)
+++ trunk/LayoutTests/editing/mac/spelling/editing-word-with-marker-1.html	2020-05-18 04:14:57 UTC (rev 261796)
@@ -1,19 +1,42 @@
+<!DOCTYPE html>
 <html>
 <head>
-<script src="" language="_javascript_" type="text/_javascript_"></script>
+<script src=""
+<script src=""
 <title>Editing word with marker test 1</title>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+if (window.internals) {
+    if (UIHelper.isIOSFamily() || !UIHelper.isWebKit2())
+        internals.setContinuousSpellCheckingEnabled(true);
+    else {
+        internals.settings.setUnifiedTextCheckerEnabled(true);
+        internals.settings.setAsynchronousSpellCheckingEnabled(true);
+    }
+}
+</script>
 </head>
 <body>
-<p>The test verified that when a word is modified, its Spelling and Autocorrection Markers are removed.
-When manully testing, type "it's a meagesga", then edit the word "meagesga". You should see the 
+<p>The test verified that when a word is modified, its spelling markers are removed.
+When manually testing, type "it's a meagesga", then edit the word "meagesga". You should see the 
 underline under the modified "meagesga" disppears after editing.</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();
+<script>
+let textarea = document.getElementById("test");
+
+async function resetText()
+{
+    textarea.blur();
+    if (window.testRunner)
+        await UIHelper.activateElementAndWaitForInputSession(textarea);
+    else
+        textarea.focus();
+    textarea.value = "";
     typeCharacterCommand('i');
     typeCharacterCommand('t');
     typeCharacterCommand('\'');
@@ -32,147 +55,137 @@
     typeCharacterCommand(' ');
 }
 
-if (window.testRunner) {
-    testRunner.dumpAsText();
-}
+async function runTest()
+{
+    resetText();
+    textarea.setSelectionRange(14, 15);
+    execDeleteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 7))
+            document.getElementById('console').innerHTML = 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML = "FAILURE. The word 'meagesg' has underline.<br>";
+    }
 
-resetText();
-textarea = document.getElementById('test');
-textarea.focus();
-textarea.setSelectionRange(14, 15);
-execDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,7) == 0) {
-        document.getElementById('console').innerHTML = 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = "FAILURE. The word 'meagesg' has underline.<br>";
+    // Testing deletion at various location.
+    resetText();
+    textarea.setSelectionRange(6, 6);
+    execForwardDeleteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(6, 8))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'ameagesga' has underline.<br>";
     }
-}
 
-// Testing deletion at various location.
-resetText();
-textarea.setSelectionRange(6, 6);
-execForwardDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(6,8) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'ameagesga' has underline.<br>";
+    resetText();
+    textarea.setSelectionRange(7, 7);
+    execForwardDeleteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 7))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'eagesga' has underline.<br>";
     }
-}
 
-resetText();
-textarea.setSelectionRange(7, 7);
-execForwardDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,7) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'eagesga' has underline.<br>";
+    resetText();
+    textarea.setSelectionRange(10, 10);
+    typeCharacterCommand(' ');
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 3) && !window.internals.hasSpellingMarker(11, 5))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The segment 'mea gesga' has underline.<br>";
     }
-}
 
-resetText();
-textarea.setSelectionRange(10, 10);
-typeCharacterCommand(' ');
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,3) == 0 && window.internals.hasSpellingMarker(11,5) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The segment 'mea gesga' has underline.<br>";
+    resetText();
+    textarea.setSelectionRange(10, 13);
+    execDeleteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 5))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'meaga' has underline.<br>";
     }
-}
 
-resetText();
-textarea.setSelectionRange(10, 13);
-execDeleteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,5) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'meaga' has underline.<br>";
+    resetText();
+    textarea.setSelectionRange(10, 13);
+    typeCharacterCommand(' ');
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 3) && !window.internals.hasSpellingMarker(11, 2))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The segment 'mea ga' has underline.<br>";
     }
-}
 
-resetText();
-textarea.setSelectionRange(10, 13);
-typeCharacterCommand(' ');
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,3) == 0 && window.internals.hasSpellingMarker(11,2) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The segment 'mea ga' has underline.<br>";
+    // Testing appending non-whitespace character.
+    resetText();
+    textarea.setSelectionRange(7, 7);
+    typeCharacterCommand('a');
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(8, 8))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'ameagesga' has underline.<br>";
     }
-}
 
-// Testing appending non-whitespace character.
-resetText();
-textarea.setSelectionRange(7, 7);
-typeCharacterCommand('a');
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(8,8) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'ameagesga' has underline.<br>";
+    resetText();
+    textarea.setSelectionRange(15, 15);
+    typeCharacterCommand('a');
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7,8))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'meagesgaa' has underline.<br>";
     }
-}
 
-resetText();
-textarea.setSelectionRange(15, 15);
-typeCharacterCommand('a');
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,8) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'meagesgaa' has underline.<br>";
+    // Testing pasting.
+    resetText();
+    textarea = document.getElementById('test');
+    textarea.setSelectionRange(0, 4);
+    execCopyCommand();
+    textarea.setSelectionRange(7, 7);
+    execPasteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(11, 8))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'meagesga' has underline.<br>";
     }
-}
 
-// Testing pasting.
-resetText();
-textarea = document.getElementById('test');
-textarea.setSelectionRange(0,4);
-execCopyCommand();
-textarea.setSelectionRange(7, 7);
-execPasteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (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 'meagesga' has underline.<br>";
+    resetText();
+    textarea = document.getElementById('test');
+    textarea.setSelectionRange(0, 4);
+    execCopyCommand();
+    textarea.setSelectionRange(15, 15);
+    if (window.internals)
+        internals.updateEditorUINowIfScheduled();
+    execPasteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 8))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'meagesga' has underline.<br>";
     }
-}
 
-resetText();
-textarea = document.getElementById('test');
-textarea.setSelectionRange(0,4);
-execCopyCommand();
-textarea.setSelectionRange(15, 15);
-if (window.internals)
-    internals.updateEditorUINowIfScheduled();
-execPasteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,8) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'meagesga' has underline.<br>";
+    resetText();
+    textarea = document.getElementById('test');
+    textarea.setSelectionRange(0, 4);
+    execCopyCommand();
+    textarea.setSelectionRange(10, 10);
+    execPasteCommand();
+    if (window.internals && window.internals.hasSpellingMarker) {
+        if (!window.internals.hasSpellingMarker(7, 3) && !window.internals.hasSpellingMarker(15, 5))
+            document.getElementById('console').innerHTML += 'SUCCESS<br>';
+        else
+            document.getElementById('console').innerHTML += "FAILURE. The word 'meait\'sgesga' has underline.<br>";
     }
-}
 
-resetText();
-textarea = document.getElementById('test');
-textarea.setSelectionRange(0,4);
-execCopyCommand();
-textarea.setSelectionRange(10, 10);
-execPasteCommand();
-if (window.internals && window.internals.hasSpellingMarker) {
-    if (window.internals.hasSpellingMarker(7,3) == 0 && window.internals.hasSpellingMarker(15,5) == 0) {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + 'SUCCESS<br>';
-    } else {
-        document.getElementById('console').innerHTML = document.getElementById('console').innerHTML + "FAILURE. The word 'meait\'sgesga' has underline.<br>";
-    }
+    if (window.testRunner)
+        testRunner.notifyDone();
 }
 
+runTest();
 </script>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/ios/TestExpectations (261795 => 261796)


--- trunk/LayoutTests/platform/ios/TestExpectations	2020-05-17 19:42:07 UTC (rev 261795)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2020-05-18 04:14:57 UTC (rev 261796)
@@ -27,6 +27,8 @@
 
 imported/w3c/web-platform-tests/dom/events/document-level-touchmove-event-listener-passive-by-default.html [ Pass ]
 
+webkit.org/b/211813 editing/mac/spelling/editing-word-with-marker-1.html [ Pass ]
+
 #//////////////////////////////////////////////////////////////////////////////////////////
 # End platform-specific directories.
 #//////////////////////////////////////////////////////////////////////////////////////////
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to