Bug 208214 - TestWebKitAPI.PasteMixedContent.CopyAndPasteWithCustomPasteboardDataOnly should wait until copy operation completes
Summary: TestWebKitAPI.PasteMixedContent.CopyAndPasteWithCustomPasteboardDataOnly shou...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 13
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-25 12:48 PST by Daniel Bates
Modified: 2020-02-25 14:12 PST (History)
2 users (show)

See Also:


Attachments
Patch (2.55 KB, patch)
2020-02-25 12:50 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
To land (2.16 KB, patch)
2020-02-25 14:10 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2020-02-25 12:48:50 PST
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.
Comment 1 Daniel Bates 2020-02-25 12:50:53 PST
Created attachment 391676 [details]
Patch
Comment 2 Daniel Bates 2020-02-25 12:55:53 PST
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 3 Wenson Hsieh 2020-02-25 13:52:34 PST
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 4 Daniel Bates 2020-02-25 14:06:58 PST
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. !!
Comment 5 Daniel Bates 2020-02-25 14:10:21 PST
Created attachment 391683 [details]
To land
Comment 6 Daniel Bates 2020-02-25 14:11:35 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Daniel Bates 2020-02-25 14:11:58 PST
Committed r257375: <https://trac.webkit.org/changeset/257375>
Comment 8 Radar WebKit Bug Importer 2020-02-25 14:12:15 PST
<rdar://problem/59779909>