The test TestWebKitAPI.PasteMixedContent.CopyAndPasteWithCustomPasteboardDataOnly copies text from one web view and pastes it into another, but it neither waits until the copy operation completes nor does it ensure that this operation completed successfully. As a result, the test is timing dependent, aka flaky.
Created attachment 391676 [details] Patch
We don't need to explicitly wait for select all and paste operations because we implicit wait for them by virtue of sending additional web page messages. Specifically, do not need to wait for select all to complete before executing copy because the WebProcess is guaranteed to receive these requests in order. Similar argument for why there is no need to wait for paste.
Comment on attachment 391676 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391676&action=review Good catch! > Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteMixedContent.mm:-316 > - [source _executeEditCommand:@"copy" argument:nil completion:nil]; Nit - it would probably be simpler to just call -_synchronouslyExecuteEditCommand:argument:.
Comment on attachment 391676 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=391676&action=review Thanks for the review. >> Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteMixedContent.mm:-316 >> - [source _executeEditCommand:@"copy" argument:nil completion:nil]; > > Nit - it would probably be simpler to just call -_synchronouslyExecuteEditCommand:argument:. !! I didn't know about this. !!
Created attachment 391683 [details] To land
All reviewed patches have been landed. Closing bug.
Committed r257375: <https://trac.webkit.org/changeset/257375>
<rdar://problem/59779909>