The iframe sub-tests in RequestTextInputContext.Simple are non-deterministic. They may fail if the iframe has not finished loading before the web process hit tests to find the editable elements. To make the these tests more robust they need to wait until the iframe has loaded.
<rdar://problem/61303697>
Created attachment 395463 [details] Patch
Created attachment 395464 [details] Patch
Comment on attachment 395464 [details] Patch Which test needs the inMainFrameOnly:NO behavior?
(In reply to Darin Adler from comment #4) > Comment on attachment 395464 [details] > Patch > > Which test needs the inMainFrameOnly:NO behavior? All the existing ones that call -performAfterLoading. I want to invert this relationship (see ChangeLog), but I hope you don't mind I defer for now.
Comment on attachment 395464 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395464&action=review > Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:154 > +static webViewLoadHTMLStringAndWaitForDOMLoadEvent(TestWKWebView *webView, NSString *htmlString) missing void
Created attachment 395465 [details] Patch
Comment on attachment 395464 [details] Patch I predict we will find no callers that want or need inMainFrameOnly:NO.
Comment on attachment 395465 [details] Patch I predict we will find no callers that want or need inMainFrameOnly:NO. I predict that all the existing callers would work the same or better with inMainFrameOnly:YES.
(In reply to Darin Adler from comment #8) > Comment on attachment 395464 [details] > Patch > > I predict we will find no callers that want or need inMainFrameOnly:NO. If I was betting, I bet you're right. I just didn't want to rock the boat...
(In reply to Darin Adler from comment #9) > Comment on attachment 395465 [details] > Patch > > I predict we will find no callers that want or need inMainFrameOnly:NO. > > I predict that all the existing callers would work the same or better with > inMainFrameOnly:YES. Okay, I'll throw a patch up....
Thanks for the review!
Created attachment 395466 [details] [Alt] Patch that changes -performAfterLoading to add user script to main frame only Let's see what the bots say...
Created attachment 395467 [details] [Alt] Patch that changes -performAfterLoading to add user script to main frame only
Comment on attachment 395465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=395465&action=review > Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:170 > + webViewLoadHTMLStringAndWaitForDOMLoadEvent(webView, applyIframe(@"<input type='text' style='width: 50px; height: 50px;'>")); Needs a .get() here. > Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:175 > + webViewLoadHTMLStringAndWaitForDOMLoadEvent(webView, applyIframe(@"<textarea style='width: 100px; height: 100px;'></textarea>")); and here. > Tools/TestWebKitAPI/Tests/WebKitCocoa/RequestTextInputContext.mm:180 > + webViewLoadHTMLStringAndWaitForDOMLoadEvent(webView, applyIframe(@"<div contenteditable style='width: 100px; height: 100px;'></div>")); and here.
Thanks Simon! @Darin, both bet right, no test failed. Landing the alternative...
Created attachment 395513 [details] To Land
Committed r259551: <https://trac.webkit.org/changeset/259551>