WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-211802-20200512140529.patch (text/plain), 10.80 KB, created by
Daniel Bates
on 2020-05-12 14:05:29 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2020-05-12 14:05:29 PDT
Size:
10.80 KB
patch
obsolete
>Subversion Revision: 261304 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index ded8310cf2b84837d0f910ca16839d230833f4cd..1048be5f992f7369e2e0b13279db705489b8bb56 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,33 @@ >+2020-05-12 Daniel Bates <dabates@apple.com> >+ >+ Make editing/spelling/editing-word-with-marker-2.html test what it claims and make it work on iOS >+ https://bugs.webkit.org/show_bug.cgi?id=211802 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Went back and looked at the originally written version of this test that was added in r70826 >+ and brought back the missing "insert whitespace after misspelling" sub-test. While I am here, >+ I also simplified the test and made the test work on iOS by using UIHelper. I also fixed some >+ idiosyncrasies that were introduced in r169687 and did other modernizations. >+ >+ The fix for iOS was simple: just enable internals.setContinuousSpellCheckingEnabled(). 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. >+ >+ I removed the use of editing commands to clear the textarea in favor of just setting the element's >+ value attribute because it's simpler and exercises less code in the engine, which I hope will reduce >+ future flakiness + the purpose of the test is to test how a spelling marker is updated not an exercise >+ on how to clear a textarea using editing commands. That kind of exercise is expected to be covered >+ by dedicated editing tests, though I haven't checked that they exist, but would be suprised if they >+ didn't. >+ >+ * editing/spelling/editing-word-with-marker-2-expected.txt: >+ * editing/spelling/editing-word-with-marker-2.html: >+ * platform/ios-wk1/TestExpectations: Unskip. >+ * platform/ios-wk2/TestExpectations: Ditto. >+ * platform/mac-wk2/TestExpectations: Ditto. >+ > 2020-03-25 Daniel Bates <dabates@apple.com> > > [iOS] Should show input view when became first responder if keyboard was showing when the view was resigned >diff --git a/LayoutTests/editing/spelling/editing-word-with-marker-2-expected.txt b/LayoutTests/editing/spelling/editing-word-with-marker-2-expected.txt >index c35fa63cbd05c01cfe3f86162a0fa6b86cd49be1..e6f363c8d1cf63b723a0cf4732274d741fe06a90 100644 >--- a/LayoutTests/editing/spelling/editing-word-with-marker-2-expected.txt >+++ b/LayoutTests/editing/spelling/editing-word-with-marker-2-expected.txt >@@ -1,18 +1,25 @@ >-The test verifies if the spelling markers remain if a whitespace is added before or after the misspelled word. The test succeeds if the word 'meagesga' has red underline. >+The test verifies if the spelling markers remain if whitespace is added before or after the misspelled word or the caret is moved.The test succeeds if the word 'meagesga' has a red underline. > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > > >-PASS internals.hasSpellingMarker(expectedMisspelledPosition, 8) became true > >-execMoveSelectionBackwardByWordCommand() >+Test: Has misspelled word: >+PASS internals.hasSpellingMarker(7, 8) became true >+ >+Test: Insert space before misspelled word: >+test.setSelectionRange(7, 7) > typeCharacterCommand(' ') >-PASS internals.hasSpellingMarker(expectedMisspelledPosition, 8) became true >+PASS internals.hasSpellingMarker(8, 8) became true > >+Test: Insert space after misspelled word: >+test.setSelectionRange(15, 15) >+typeCharacterCommand(' ') >+PASS internals.hasSpellingMarker(7, 8) became true >+ >+Test: Move caret: > execMoveSelectionBackwardByCharacterCommand() >-typeCharacterCommand(' ') >-PASS internals.hasSpellingMarker(expectedMisspelledPosition, 8) became true >- >+PASS internals.hasSpellingMarker(7, 8) became true > PASS successfullyParsed is true > > TEST COMPLETE >diff --git a/LayoutTests/editing/spelling/editing-word-with-marker-2.html b/LayoutTests/editing/spelling/editing-word-with-marker-2.html >index b8e088490b8bd6d0d02d70c3a14729e3ba1199ec..7d54f567024e06bd610e497d750e7eee0ca96e6b 100644 >--- a/LayoutTests/editing/spelling/editing-word-with-marker-2.html >+++ b/LayoutTests/editing/spelling/editing-word-with-marker-2.html >@@ -1,26 +1,37 @@ >+<!DOCTYPE html> > <html> > <head> > <script src="../editing.js"></script> >+<script src="../../resources/js-test.js"></script> >+<script src="../../resources/ui-helper.js"></script> > </head> > <body> > <textarea id="test"></textarea> >-<script src="../../resources/js-test-pre.js"></script> > <script> >-description("The test verifies if the spelling markers remain if a whitespace " >- + "is added before or after the misspelled word. " >- + "The test succeeds if the word 'meagesga' has red underline."); >+description("The test verifies if the spelling markers remain if whitespace " >+ + "is added before or after the misspelled word or the caret is moved." >+ + "The test succeeds if the word 'meagesga' has a red underline."); > > jsTestIsAsync = true; > > if (window.internals) { >- internals.settings.setUnifiedTextCheckerEnabled(true); >- internals.settings.setAsynchronousSpellCheckingEnabled(true); >+ if (UIHelper.isIOSFamily()) >+ internals.setContinuousSpellCheckingEnabled(true); >+ else { >+ internals.settings.setUnifiedTextCheckerEnabled(true); >+ internals.settings.setAsynchronousSpellCheckingEnabled(true); >+ } > } > >-function resetText() { >- document.getElementById('test').focus(); >- execSelectAllCommand(); >- execDeleteCommand(); >+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('\''); >@@ -39,52 +50,60 @@ function resetText() { > typeCharacterCommand(' '); > } > >-var expectedMisspelledPosition; >-function checkSpellingMarkerAfterAddingWhitespace(testCase) >+async function checkSpellingMarker(testCase) > { >- resetText(); >+ await resetText(); > >- if (testCase.updateCaretPosition) { >- testCase.updateCaretPosition(); >- evalAndLog("typeCharacterCommand(' ')"); >- } >+ debug(`<br>Test: ${testCase.testName}:`); >+ testCase.run(); > >- expectedMisspelledPosition = testCase.misspelledPosition; >- >- if (window.internals) { >- shouldBecomeEqual("internals.hasSpellingMarker(expectedMisspelledPosition, 8)", "true", function() { >- debug(""); >- done(); >- }); >- } else >- done(); >+ if (window.internals) >+ shouldBecomeEqual(`internals.hasSpellingMarker(${testCase.expectedMisspelledWordStartPosition}, 8)`, "true", () => runNextTest()); >+ else >+ runNextTest(); > } > > var testCases = [ > { >- updateCaretPosition: null, >- misspelledPosition: 7 >+ testName: "Has misspelled word", >+ run: () => { /* Do nothing */ }, >+ expectedMisspelledWordStartPosition: 7, > }, > { >- updateCaretPosition: function() { evalAndLog("execMoveSelectionBackwardByWordCommand()"); }, >- misspelledPosition: 8 >+ testName: "Insert space before misspelled word", >+ run: () => { >+ evalAndLog("test.setSelectionRange(7, 7)"); >+ evalAndLog("typeCharacterCommand(' ')"); >+ }, >+ expectedMisspelledWordStartPosition: 8, > }, > { >- updateCaretPosition: function() { evalAndLog("execMoveSelectionBackwardByCharacterCommand()"); }, >- misspelledPosition: 7 >+ testName: "Insert space after misspelled word", >+ run: () => { >+ evalAndLog("test.setSelectionRange(15, 15)"); >+ evalAndLog("typeCharacterCommand(' ')"); >+ }, >+ expectedMisspelledWordStartPosition: 7, >+ }, >+ { >+ testName: "Move caret", >+ run: () => { >+ evalAndLog("execMoveSelectionBackwardByCharacterCommand()"); >+ }, >+ expectedMisspelledWordStartPosition: 7, > } > ]; > >-function done() >+function runNextTest() > { >- var testCase = testCases.shift(); >- if (testCase) >- return setTimeout(checkSpellingMarkerAfterAddingWhitespace(testCase), 0); >- >+ let testCase = testCases.shift(); >+ if (testCase) { >+ setTimeout(() => checkSpellingMarker(testCase), 0); >+ return; >+ } > finishJSTest(); > } >-done(); >+runNextTest(); > </script> >-<script src="../../resources/js-test-post.js"></script> > </body> > </html> >diff --git a/LayoutTests/platform/ios-wk1/TestExpectations b/LayoutTests/platform/ios-wk1/TestExpectations >index 65226e7f537039af03fd759cd6eee320b4fdd06a..12321c078d7437f8bd421c1bcdbddb6a096aa036 100644 >--- a/LayoutTests/platform/ios-wk1/TestExpectations >+++ b/LayoutTests/platform/ios-wk1/TestExpectations >@@ -153,7 +153,6 @@ editing/selection/caret-at-bidi-boundary.html > editing/spelling/context-menu-suggestions-multiword-selection.html > editing/spelling/delete-into-misspelled-word.html > editing/spelling/design-mode-spellcheck-off.html >-editing/spelling/editing-word-with-marker-2.html > editing/spelling/grammar-edit-word.html > editing/spelling/grammar.html > editing/spelling/inline-spelling-markers-hidpi.html >diff --git a/LayoutTests/platform/ios-wk2/TestExpectations b/LayoutTests/platform/ios-wk2/TestExpectations >index 443e4e5fcca9fa370c790f80f4cec0882aba673c..e3668d5ce3ae3b535b217966d8e7ca5bc960969c 100644 >--- a/LayoutTests/platform/ios-wk2/TestExpectations >+++ b/LayoutTests/platform/ios-wk2/TestExpectations >@@ -704,7 +704,6 @@ editing/caret/ios/emoji.html [ Failure ] > editing/selection/designmode-no-caret.html > editing/selection/move-by-character-brute-force.html > editing/spelling/delete-into-misspelled-word.html >-editing/spelling/editing-word-with-marker-2.html > editing/spelling/grammar-edit-word.html > editing/spelling/grammar.html > editing/spelling/inline-spelling-markers-hidpi.html >diff --git a/LayoutTests/platform/mac-wk2/TestExpectations b/LayoutTests/platform/mac-wk2/TestExpectations >index 371fa776d61125a3658ce40256f0140e9784e805..91c9ffb3738b4dc84e9bcf93e222a8c04c48302c 100644 >--- a/LayoutTests/platform/mac-wk2/TestExpectations >+++ b/LayoutTests/platform/mac-wk2/TestExpectations >@@ -176,7 +176,6 @@ webkit.org/b/105616 editing/spelling/context-menu-suggestions-subword-selection. > webkit.org/b/105616 editing/spelling/copy-paste-crash.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/spelling/editing-word-with-marker-2.html > webkit.org/b/105616 editing/spelling/move-cursor-around-misspelled-word.html > webkit.org/b/105616 editing/spelling/spelling-changed-text.html > webkit.org/b/105616 editing/spelling/spelling-backspace-between-lines.html
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 211802
:
399173
|
399196
|
399197
|
399198
|
399556