WebKit Bugzilla
Attachment 346626 Details for
Bug 188335
: [iOS] Tests that try to interact with the QuickType bar time out on iOS 11+
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-188335-20180806072237.patch (text/plain), 25.80 KB, created by
Wenson Hsieh
on 2018-08-06 07:22:37 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2018-08-06 07:22:37 PDT
Size:
25.80 KB
patch
obsolete
>Subversion Revision: 234600 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index aee747d874792cc4406414049005396d38fa36c4..82d4855331ec7bb6dbc1cefef459a7ca71614740 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,30 @@ >+2018-08-05 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Tests that try to interact with the QuickType bar time out on iOS 11+ >+ https://bugs.webkit.org/show_bug.cgi?id=188335 >+ <rdar://problem/32542437> and <rdar://problem/32542433> >+ >+ Reviewed by Tim Horton. >+ >+ Remove a UIScriptController helper method that attempted to wait for QuickType buttons to appear, and then send >+ touch events to the buttons. These were only used for the two tests which this patch refactors. See the >+ LayoutTests ChangeLog for more detail. >+ >+ * DumpRenderTree/ios/UIScriptControllerIOS.mm: >+ (WTR::UIScriptController::selectTextCandidateAtIndex): Deleted. >+ * TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl: >+ * TestRunnerShared/UIScriptContext/UIScriptController.cpp: >+ (WTR::UIScriptController::selectTextCandidateAtIndex): Deleted. >+ (WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex): Deleted. >+ * TestRunnerShared/UIScriptContext/UIScriptController.h: >+ * TestRunnerShared/spi/UIKitTestSPI.h: >+ >+ Remove an internal class declaration that is now unnecessary. >+ >+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm: >+ (WTR::UIScriptController::selectTextCandidateAtIndex): Deleted. >+ (WTR::UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex): Deleted. >+ > 2018-08-06 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained >diff --git a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >index a446ff5552a0387783c031747cee04ed8ca03a1a..76425b973611af04b363e03085b9226dd7c6f6c2 100644 >--- a/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >+++ b/Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm >@@ -143,10 +143,6 @@ void UIScriptController::typeCharacterUsingHardwareKeyboard(JSStringRef characte > { > } > >-void UIScriptController::selectTextCandidateAtIndex(long, JSValueRef) >-{ >-} >- > void UIScriptController::keyDownUsingHardwareKeyboard(JSStringRef character, JSValueRef callback) > { > } >diff --git a/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl b/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >index 8deb4eb10b2262c05a64c3d3a8c96aa6244c09fa..abf84708576f3783a3c797f1a98cd4fe0801c5e0 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >+++ b/Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl >@@ -63,8 +63,6 @@ interface UIScriptController { > void keyDownUsingHardwareKeyboard(DOMString character, object callback); > void keyUpUsingHardwareKeyboard(DOMString character, object callback); > >- void selectTextCandidateAtIndex(long index, object callback); >- > // eventsJSON describes a series of user events in JSON form. For the keys, see HIDEventGenerator.mm. > // For example, this JSON describes a touch down followed by a touch up (i.e. a single tap). > // { >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >index e94f0af72bbb345af6693357f30811b7f897a282..492c948c378d44438571dbd22af534a15ca18675 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp >@@ -282,14 +282,6 @@ void UIScriptController::keyUpUsingHardwareKeyboard(JSStringRef, JSValueRef) > { > } > >-void UIScriptController::selectTextCandidateAtIndex(long, JSValueRef) >-{ >-} >- >-void UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex(long, unsigned, float) >-{ >-} >- > void UIScriptController::keyDownUsingHardwareKeyboard(JSStringRef, JSValueRef) > { > } >diff --git a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >index 95d7d54985645ab7b3632ee809b2c0f64bb26b06..7fd74da9570476d05295e0c27f54602c37f9dddd 100644 >--- a/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >+++ b/Tools/TestRunnerShared/UIScriptContext/UIScriptController.h >@@ -89,8 +89,6 @@ public: > void keyDownUsingHardwareKeyboard(JSStringRef character, JSValueRef callback); > void keyUpUsingHardwareKeyboard(JSStringRef character, JSValueRef callback); > >- void selectTextCandidateAtIndex(long index, JSValueRef callback); >- > void keyboardAccessoryBarNext(); > void keyboardAccessoryBarPrevious(); > >@@ -207,7 +205,6 @@ private: > JSClassRef wrapperClass() final; > > JSObjectRef objectFromRect(const WebCore::FloatRect&) const; >- void waitForTextPredictionsViewAndSelectCandidateAtIndex(long index, unsigned callbackID, float interval); > > UIScriptContext* m_context; > }; >diff --git a/Tools/TestRunnerShared/spi/UIKitTestSPI.h b/Tools/TestRunnerShared/spi/UIKitTestSPI.h >index dfcc21304846500c72869a1f306481e64b2f5e0b..034eb2be22f9f1d8b58326e53e2ee51cde09ad49 100644 >--- a/Tools/TestRunnerShared/spi/UIKitTestSPI.h >+++ b/Tools/TestRunnerShared/spi/UIKitTestSPI.h >@@ -41,11 +41,6 @@ > #import <UIKit/UIScreen_Private.h> > #import <UIKit/_UIApplicationRotationFollowing.h> > >-@interface UIKeyboardPredictionView : UIView >-+ (UIKeyboardPredictionView *)activeInstance; >-- (BOOL)hasPredictions; >-@end >- > #else > > #import "IOKitSPI.h" >diff --git a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >index c6ebfca52151906f6420dc760d051a80fea735af..6597040384e3fe7ea39fdd1620ebb139df32c9c3 100644 >--- a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >+++ b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >@@ -374,51 +374,6 @@ void UIScriptController::keyUpUsingHardwareKeyboard(JSStringRef character, JSVal > }]; > } > >-void UIScriptController::selectTextCandidateAtIndex(long index, JSValueRef callback) >-{ >-#if USE(APPLE_INTERNAL_SDK) >- static const float textPredictionsPollingInterval = 0.1; >- unsigned callbackID = m_context->prepareForAsyncTask(callback, CallbackTypeNonPersistent); >- waitForTextPredictionsViewAndSelectCandidateAtIndex(index, callbackID, textPredictionsPollingInterval); >-#else >- // FIXME: This is a no-op on non-internal builds due to UIKeyboardPredictionView being unavailable. Ideally, there should be a better way to >- // retrieve information and interact with the predictive text view that will be compatible with OpenSource. >- UNUSED_PARAM(index); >- UNUSED_PARAM(callback); >-#endif >-} >- >-void UIScriptController::waitForTextPredictionsViewAndSelectCandidateAtIndex(long index, unsigned callbackID, float interval) >-{ >- id UIKeyboardPredictionViewClass = NSClassFromString(@"UIKeyboardPredictionView"); >- if (!UIKeyboardPredictionViewClass) >- return; >- >-#if USE(APPLE_INTERNAL_SDK) >- UIKeyboardPredictionView *predictionView = (UIKeyboardPredictionView *)[UIKeyboardPredictionViewClass activeInstance]; >- if (![predictionView hasPredictions]) { >- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, interval * NSEC_PER_SEC), dispatch_get_main_queue(), ^() { >- waitForTextPredictionsViewAndSelectCandidateAtIndex(index, callbackID, interval); >- }); >- return; >- } >- >- PlatformWKView webView = TestController::singleton().mainWebView()->platformView(); >- CGRect predictionViewFrame = [predictionView frame]; >- // This assumes there are 3 predicted text cells of equal width, which is the case on iOS. >- float offsetX = (index * 2 + 1) * CGRectGetWidth(predictionViewFrame) / 6; >- float offsetY = CGRectGetHeight(webView.window.frame) - CGRectGetHeight([[predictionView superview] frame]) + CGRectGetHeight(predictionViewFrame) / 2; >- [[HIDEventGenerator sharedHIDEventGenerator] tap:CGPointMake(offsetX, offsetY) completionBlock:^{ >- if (m_context) >- m_context->asyncTaskComplete(callbackID); >- }]; >-#else >- UNUSED_PARAM(index); >- UNUSED_PARAM(callbackID); >- UNUSED_PARAM(interval); >-#endif >-} >- > void UIScriptController::dismissFormAccessoryView() > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index a04527333f3445209339396049ecc88f4144e0d8..6b22270571f09f62cc46b3af41bc0dd4ba091d40 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,38 @@ >+2018-08-05 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Tests that try to interact with the QuickType bar time out on iOS 11+ >+ https://bugs.webkit.org/show_bug.cgi?id=188335 >+ <rdar://problem/32542437> and <rdar://problem/32542433> >+ >+ Reviewed by Tim Horton. >+ >+ Refactors a couple of tests that currently rely on the QuickType bar being shown when the hardware keyboard is >+ presented in the iOS simulator, so that it can insert text suggestions by tapping QuickType bar buttons; in the >+ first place, it was never guaranteed that this bar would show up, or even have more than 1 text suggestion. >+ Instead, we use the existing UIScriptController::applyAutocorrection method to trigger text replacement in the >+ same way tapping a button on the QuickType bar would replace the current word with the suggested word. >+ >+ * fast/events/ios/before-input-events-prevent-candidate-insertion-expected.txt: >+ * fast/events/ios/before-input-events-prevent-candidate-insertion.html: >+ * fast/events/ios/input-events-insert-replacement-text-expected.txt: >+ * fast/events/ios/input-events-insert-replacement-text.html: >+ * platform/ios/TestExpectations: >+ >+ Removes a [Timeout] expectation. >+ >+ * resources/ui-helper.js: >+ (window.UIHelper.typeCharacter): >+ >+ Add a new UIHelper method to type a character using the keyboard. Sends hardware keyboard events on the WebKit2 >+ port of iOS, and uses EventSender elsewhere. >+ >+ (window.UIHelper.applyAutocorrection): >+ >+ Add a new UIHelper method that wraps UIScriptController::applyAutocorrection. Only supported in WebKit2 >+ currently. >+ >+ (window.UIHelper): >+ > 2018-08-06 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Caret disappears after resigning and becoming first responder if active focus state is retained >diff --git a/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion-expected.txt b/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion-expected.txt >index 98d0c2e86c8e83cfd72d9f5ff89f05b2ff630012..22675e38eeeb7d88ec446c44ed8cf09c7eddc2d5 100644 >--- a/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion-expected.txt >+++ b/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion-expected.txt >@@ -1,5 +1,9 @@ > >-To manually test, type 't' into the contenteditable and try to select a candidate. The replacement text should not be inserted. >+This test verifies that beforeinput events of inputType "insertReplacementText" can be prevented. > >-PASS: The replacement text was prevented. >+To manually test, type 'T' into the text field and try to select a candidate. The replacement text should not be inserted. >+ >+Replacing "T" with "The"... >+Prevented "insertReplacementText" with data: "The" >+Does the input value contain replacement text? false > >diff --git a/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion.html b/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion.html >index b1af4902e738dd0cc56c33cfcd747cf90fa50b6c..98eeea7e9eaea20252c7a30dbb5793e0207b91b0 100644 >--- a/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion.html >+++ b/LayoutTests/fast/events/ios/before-input-events-prevent-candidate-insertion.html >@@ -1,92 +1,63 @@ > <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> > > <html> >- > <head> >- <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> >- <script id="ui-script" type="text/plain"> >- (function() { >- uiController.didShowKeyboardCallback = function() { >- uiController.typeCharacterUsingHardwareKeyboard("t", function() { >- uiController.selectTextCandidateAtIndex(1, function() { >- uiController.uiScriptComplete(); >- }); >- }); >- } >- uiController.singleTapAtPoint($x, $y, function() {}); >- })(); >- </script> >- >- <script> >- var progress = 0; >- var replacementText = ""; >- let write = (message) => output.innerHTML += (message + "<br>"); >- function getUIScript() { >- let rect = editable.getBoundingClientRect(); >- let script = document.getElementById("ui-script").text; >- script = script.replace("$x", rect.left + rect.width / 2); >- return script.replace("$y", rect.top + rect.height / 2); >- } >- >- if (window.testRunner) { >- testRunner.dumpAsText(); >- testRunner.waitUntilDone(); >- internals.settings.setInputEventsEnabled(true); >- } >- >- function incrementProgress() >- { >- progress++; >- if (!window.testRunner || progress !== 2) >- return; >- >- setTimeout(function() { >- if (editable.value.indexOf(replacementText) == -1) >- write(`PASS: The replacement text was prevented.`); >- else >- write(`FAIL: The input value ${editable.value} should not contain replacement text ${replacementText}.`); >- testRunner.notifyDone(); >- }, 0); >- } >- >- function runTest() >- { >- editable.addEventListener("beforeinput", preventBeforeInput); >- if (!window.testRunner || !testRunner.runUIScript) >- return; >- >- testRunner.runUIScript(getUIScript(), function(result) { >- incrementProgress(); >- }); >- } >- >- function preventBeforeInput(event) >- { >- if (event.inputType === "insertReplacementText") { >- replacementText = event.data; >- if (!replacementText) >- write("FAIL: The replacement text input event lacks data."); >- event.preventDefault(); >- incrementProgress(); >- } >- } >- >- </script> >- <style> >- #editable { >- width: 200px; >- height: 100px; >- top: 0; >- left: 0; >- position: absolute; >- } >- </style> >+<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> >+<script src="../../../resources/ui-helper.js"></script> >+<style> >+#editable { >+ width: 320px; >+ height: 320px; >+ top: 0; >+ left: 0; >+ position: absolute; >+} >+</style> > </head> > >-<body style="margin: 0;" onload=runTest()> >- <input contenteditable id="editable"></input> >- <p>To manually test, type 't' into the contenteditable and try to select a candidate. The replacement text should not be inserted.</p> >- <div id="output"></div> >+<body style="margin: 0;"> >+<input contenteditable id="editable"></input> >+<p>This test verifies that <code>beforeinput</code> events of inputType "insertReplacementText" can be prevented.</p> >+<p>To manually test, type 'T' into the text field and try to select a candidate. The replacement text should not be inserted.</p> >+<pre id="output"></pre> >+<script> >+let write = (message) => output.innerHTML += (message + "<br>"); >+ >+function checkForCompletion() { >+ doneCount = window.doneCount ? doneCount : 0; >+ if (++doneCount == 2 && window.testRunner) >+ testRunner.notifyDone(); >+} >+ >+function handleBeforeInput(event) { >+ if (event.inputType !== "insertReplacementText") >+ return; >+ >+ event.preventDefault(); >+ >+ write(`Prevented "insertReplacementText" with data: "${event.data}"`); >+ setTimeout(() => { >+ write(`Does the input value contain replacement text? ${editable.value.includes("The")}`); >+ checkForCompletion(); >+ }, 0); >+} >+ >+function triggerAutocorrectionAfterFirstInput() { >+ editable.removeEventListener("input", triggerAutocorrectionAfterFirstInput); >+ write(`Replacing "T" with "The"...`); >+ editable.setSelectionRange(0, 1); >+ UIHelper.applyAutocorrection("The", "T").then(checkForCompletion); >+} >+ >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} >+ >+editable.addEventListener("beforeinput", handleBeforeInput); >+editable.addEventListener("input", triggerAutocorrectionAfterFirstInput); >+UIHelper.activateAndWaitForInputSessionAt(160, 160).then(() => UIHelper.typeCharacter("T")); >+</script> > </body> > > </html> >diff --git a/LayoutTests/fast/events/ios/input-events-insert-replacement-text-expected.txt b/LayoutTests/fast/events/ios/input-events-insert-replacement-text-expected.txt >index 9fa40f9f474082ddea180b1b82bd97e3c51949f1..1d28cba7f1f11ad0b6eb68a2059643f10b450014 100644 >--- a/LayoutTests/fast/events/ios/input-events-insert-replacement-text-expected.txt >+++ b/LayoutTests/fast/events/ios/input-events-insert-replacement-text-expected.txt >@@ -1,5 +1,9 @@ >-To manually test, type 't' into the contenteditable and try to select a candidate. The output should indicate that the beforeinput and input events for the text replacement were handled, and that the range of the beforeinput event is from 0 to 1. >+The >+This test verifies that input events of type "insertReplacementText" target the right ranges. > >-PASS: Handled text replacement before input event with range: [0, 1]. >-PASS: Handled text replacement input event. >+To manually test, type 'T' into the input field and try to select a candidate. The output should indicate that the beforeinput and input events for the text replacement were handled, and that the range of the beforeinput event is from 0 to 1. >+ >+Replacing "T" with "The"... >+Observed text replacement before input event with range: [0, 1] and data: "The" >+Observed text replacement input event with data: "The" > >diff --git a/LayoutTests/fast/events/ios/input-events-insert-replacement-text.html b/LayoutTests/fast/events/ios/input-events-insert-replacement-text.html >index 8ad9a774ec348398f89805194b925ad759f57659..1adc27fc99c362e510da9c7686898406eccfaea4 100644 >--- a/LayoutTests/fast/events/ios/input-events-insert-replacement-text.html >+++ b/LayoutTests/fast/events/ios/input-events-insert-replacement-text.html >@@ -1,90 +1,64 @@ > <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> > > <html> >- > <head> >- <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> >- <script id="ui-script" type="text/plain"> >- (function() { >- uiController.didShowKeyboardCallback = function() { >- uiController.typeCharacterUsingHardwareKeyboard("t", function() { >- uiController.selectTextCandidateAtIndex(1, function() { >- uiController.uiScriptComplete(); >- }); >- }); >- } >- uiController.singleTapAtPoint($x, $y, function() {}); >- })(); >- </script> >+<meta name="viewport" content="initial-scale=1.0, user-scalable=no"> >+<script src="../../../resources/ui-helper.js"></script> >+<style> >+#editable { >+ width: 200px; >+ height: 200px; >+ top: 0; >+ left: 0; >+ position: absolute; >+} >+</style> >+</head> > >- <script> >- var progress = 0; >- let write = (message) => output.innerHTML += (message + "<br>"); >- function getUIScript() { >- let rect = editable.getBoundingClientRect(); >- let script = document.getElementById("ui-script").text; >- script = script.replace("$x", rect.left + rect.width / 2); >- return script.replace("$y", rect.top + rect.height / 2); >- } >+<body style="margin: 0;"> >+<div contenteditable id="editable"></div> >+<p>This test verifies that input events of type "insertReplacementText" target the right ranges.</p> >+<p>To manually test, type 'T' into the input field and try to select a candidate. The output should indicate that the beforeinput and input events for the text replacement were handled, and that the range of the beforeinput event is from 0 to 1.</p> >+<div id="output"></div> >+<script> >+let write = (message) => output.innerHTML += (message + "<br>"); > >- if (window.testRunner) { >- testRunner.dumpAsText(); >- testRunner.waitUntilDone(); >- internals.settings.setInputEventsEnabled(true); >- } >+function checkForCompletion() { >+ doneCount = window.doneCount ? doneCount : 0; >+ if (++doneCount == 3 && window.testRunner) >+ testRunner.notifyDone(); >+} > >- function incrementProgress() >- { >- progress++; >- if (!window.testRunner || progress !== 3) >- return; >+function logInputEvent(event) >+{ >+ if (event.inputType !== "insertReplacementText") >+ return; > >- setTimeout(function() { >- editable.textContent = ""; >- testRunner.notifyDone(); >- }, 0); >- } >+ if (event.type === "beforeinput") { >+ let firstRange = event.getTargetRanges()[0]; >+ write(`Observed text replacement before input event with range: [${firstRange.startOffset}, ${firstRange.endOffset}] and data: "${event.dataTransfer.getData("text/plain")}"`); >+ } else >+ write(`Observed text replacement input event with data: "${event.dataTransfer.getData("text/plain")}"`); > >- function runTest() >- { >- editable.addEventListener("input", logInputEvent); >- editable.addEventListener("beforeinput", logInputEvent); >- if (!window.testRunner || !testRunner.runUIScript) >- return; >+ checkForCompletion(); >+} > >- testRunner.runUIScript(getUIScript(), function(result) { >- incrementProgress(); >- }); >- } >+function triggerAutocorrectionAfterFirstInput() { >+ editable.removeEventListener("input", triggerAutocorrectionAfterFirstInput); >+ write(`Replacing "T" with "The"...`); >+ getSelection().setBaseAndExtent(editable, 0, editable, 1); >+ UIHelper.applyAutocorrection("The", "T").then(checkForCompletion); >+} > >- function logInputEvent(event) >- { >- if (event.inputType !== "insertReplacementText") >- return; >+if (window.testRunner) { >+ testRunner.dumpAsText(); >+ testRunner.waitUntilDone(); >+} > >- if (event.type === "beforeinput") { >- let firstRange = event.getTargetRanges()[0]; >- write(`PASS: Handled text replacement before input event with range: [${firstRange.startOffset}, ${firstRange.endOffset}].`); >- } else >- write(`PASS: Handled text replacement input event.`); >- incrementProgress(); >- } >- </script> >- <style> >- #editable { >- width: 200px; >- height: 200px; >- top: 0; >- left: 0; >- position: absolute; >- } >- </style> >-</head> >- >-<body style="margin: 0;" onload=runTest()> >- <div contenteditable id="editable"></div> >- <p>To manually test, type 't' into the contenteditable and try to select a candidate. The output should indicate that the beforeinput and input events for the text replacement were handled, and that the range of the beforeinput event is from 0 to 1.</p> >- <div id="output"></div> >+editable.addEventListener("beforeinput", logInputEvent); >+editable.addEventListener("input", logInputEvent); >+editable.addEventListener("input", triggerAutocorrectionAfterFirstInput); >+UIHelper.activateAndWaitForInputSessionAt(100, 100).then(() => UIHelper.typeCharacter("T")); >+</script> > </body> >- > </html> >diff --git a/LayoutTests/platform/ios/TestExpectations b/LayoutTests/platform/ios/TestExpectations >index b881ed004ec01727d1f518b93076e9f9cf48a032..36944fae98d49834b305454e8120d292029cd2d1 100644 >--- a/LayoutTests/platform/ios/TestExpectations >+++ b/LayoutTests/platform/ios/TestExpectations >@@ -3078,9 +3078,6 @@ webkit.org/b/155092 js/arraybuffer-wrappers.html [ Pass Timeout ] > > webkit.org/b/172052 [ Release ] imported/w3c/web-platform-tests/html/webappapis/timers/type-long-setinterval.html [ Pass Failure ] > >-# <rdar://problem/32542437> REGRESSION (iOS 11): LayoutTest fast/events/ios/before-input-events-prevent-candidate-insertion.html is timing out >-fast/events/ios/before-input-events-prevent-candidate-insertion.html [ Timeout ] >- > # <rdar://problem/32542300> REGRESSION (iOS 11): LayoutTest fast/events/ios/contenteditable-autocapitalize.html is failing > fast/events/ios/contenteditable-autocapitalize.html [ Failure ] > >diff --git a/LayoutTests/resources/ui-helper.js b/LayoutTests/resources/ui-helper.js >index 9d0c6146ab447d212a89338ae70f665ab57d83b7..90a82119be122be095cb85913e6357d9cac31868 100644 >--- a/LayoutTests/resources/ui-helper.js >+++ b/LayoutTests/resources/ui-helper.js >@@ -278,4 +278,26 @@ window.UIHelper = class UIHelper { > })()`, resolve); > }); > } >+ >+ static typeCharacter(characterString) >+ { >+ if (!this.isWebKit2() || !this.isIOS()) { >+ eventSender.keyDown(key); >+ return; >+ } >+ >+ const escapedString = characterString.replace(/`/g, "\\`"); >+ const uiScript = `uiController.typeCharacterUsingHardwareKeyboard(\`${escapedString}\`, () => uiController.uiScriptComplete())`; >+ return new Promise(resolve => testRunner.runUIScript(uiScript, resolve)); >+ } >+ >+ static applyAutocorrection(newText, oldText) >+ { >+ if (!this.isWebKit2()) >+ return; >+ >+ const [escapedNewText, escapedOldText] = [newText.replace(/`/g, "\\`"), oldText.replace(/`/g, "\\`")]; >+ const uiScript = `uiController.applyAutocorrection(\`${escapedNewText}\`, \`${escapedOldText}\`, () => uiController.uiScriptComplete())`; >+ return new Promise(resolve => testRunner.runUIScript(uiScript, resolve)); >+ } > }
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 188335
:
346610
| 346626