Bug 170658 - [WK2] Add infrastructure to perform actions after an asynchronous position information request finishes
Summary: [WK2] Add infrastructure to perform actions after an asynchronous position in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-09 16:15 PDT by Wenson Hsieh
Modified: 2017-04-13 14:59 PDT (History)
4 users (show)

See Also:


Attachments
Patch (15.63 KB, patch)
2017-04-09 16:48 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Try to fix OpenSource iOS build (15.80 KB, patch)
2017-04-09 21:48 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Patch for landing (15.75 KB, patch)
2017-04-09 22:43 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Additional tweaks to the test (6.39 KB, patch)
2017-04-10 14:12 PDT, Wenson Hsieh
thorton: review+
Details | Formatted Diff | Diff
Patch for landing (7.65 KB, patch)
2017-04-10 14:38 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Wenson Hsieh 2017-04-09 16:15:19 PDT
<rdar://problem/31431450>
Comment 1 Wenson Hsieh 2017-04-09 16:48:44 PDT
Created attachment 306636 [details]
Patch
Comment 2 Tim Horton 2017-04-09 20:09:20 PDT
Comment on attachment 306636 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=306636&action=review

Very cool.

> Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm:374
> +    EXPECT_LT([NSDate timeIntervalSinceReferenceDate] - startTime, 1);

Did this actually fail before? I thought the timeout was 500ms. Also I hope this isn't flaky on contended bots... we'll see.
Comment 3 Wenson Hsieh 2017-04-09 21:00:21 PDT
Thanks!

(In reply to Tim Horton from comment #2)
> Comment on attachment 306636 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=306636&action=review
> 
> Very cool.
> 
> > Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm:374
> > +    EXPECT_LT([NSDate timeIntervalSinceReferenceDate] - startTime, 1);
> 
> Did this actually fail before? I thought the timeout was 500ms. Also I hope
> this isn't flaky on contended bots... we'll see.

Oh, interesting -- when I ran it locally before my change, I got 1s (+2ms or so), so I set it to this value as the threshold. I don't think this will be flaky, since very little work is now done when preparing for data interaction, but if many other tests are running simultaneously and this isn't getting any execution time, another better way to test this might be to add hooks in the web view configs to disable the responsiveness timer altogether before beginning to spin the WP, forcing this test to time out if it does make a sync request to the web process.

I'll see how well the bots cope with this, and introduce some testing SPI with the above approach if I see any failures.
Comment 4 Wenson Hsieh 2017-04-09 21:48:01 PDT
Created attachment 306648 [details]
Try to fix OpenSource iOS build
Comment 5 Wenson Hsieh 2017-04-09 22:43:02 PDT
Created attachment 306658 [details]
Patch for landing
Comment 6 WebKit Commit Bot 2017-04-09 23:25:25 PDT
Comment on attachment 306658 [details]
Patch for landing

Clearing flags on attachment: 306658

Committed r215171: <http://trac.webkit.org/changeset/215171>
Comment 7 Wenson Hsieh 2017-04-10 14:12:02 PDT
Created attachment 306740 [details]
Additional tweaks to the test
Comment 8 Wenson Hsieh 2017-04-10 14:38:56 PDT
Created attachment 306743 [details]
Patch for landing
Comment 9 WebKit Commit Bot 2017-04-10 15:22:43 PDT
Comment on attachment 306743 [details]
Patch for landing

Clearing flags on attachment: 306743

Committed r215207: <http://trac.webkit.org/changeset/215207>