Bug 185599 - [iOS] Add a test to ensure that setTimeout() does not fire more than expected when using UIWebView
Summary: [iOS] Add a test to ensure that setTimeout() does not fire more than expected...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: iPhone / iPad iOS 9.3
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-05-13 20:32 PDT by Daniel Bates
Modified: 2018-05-14 16:19 PDT (History)
6 users (show)

See Also:


Attachments
Unit test (11.93 KB, patch)
2018-05-13 20:41 PDT, Daniel Bates
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-05-13 20:32:15 PDT
Add a test to ensure that setTimeout() fires once.
Comment 1 Daniel Bates 2018-05-13 20:32:34 PDT
<rdar://problem/22493890>
Comment 2 Daniel Bates 2018-05-13 20:41:39 PDT
Created attachment 340287 [details]
Unit test
Comment 3 Simon Fraser (smfr) 2018-05-14 15:06:27 PDT
Comment on attachment 340287 [details]
Unit test

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

> Tools/TestWebKitAPI/ios/set-timeout-function.html:11
> +setTimeout(function() { i++; }, 0);
> +setTimeout(function() { i++; }, 100);
> +setTimeout(function() {
> +    i++;
> +    window.location.href = "?fired-" + i;
> +}, 200);

Can we make the test take less than 200ms?
Comment 4 Daniel Bates 2018-05-14 16:09:01 PDT
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 340287 [details]
> Unit test
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=340287&action=review
> 
> > Tools/TestWebKitAPI/ios/set-timeout-function.html:11
> > +setTimeout(function() { i++; }, 0);
> > +setTimeout(function() { i++; }, 100);
> > +setTimeout(function() {
> > +    i++;
> > +    window.location.href = "?fired-" + i;
> > +}, 200);
> 
> Can we make the test take less than 200ms?

Will change to use 20ms before landing.
Comment 5 Daniel Bates 2018-05-14 16:19:44 PDT
Committed r231776: <https://trac.webkit.org/changeset/231776>