Bug 164980

Summary: [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: New BugsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, commit-queue, dino, ryanhaddad, sam, simon.fraser, thorton
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch cdumez: review+

Description Simon Fraser (smfr) 2016-11-18 18:56:02 PST
[iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
Comment 1 Simon Fraser (smfr) 2016-11-18 18:59:31 PST
Created attachment 295243 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-11-18 18:59:55 PST
Depends on the patch in bug 164967.
Comment 3 Simon Fraser (smfr) 2016-11-18 20:32:47 PST
Created attachment 295246 [details]
Patch
Comment 4 WebKit Commit Bot 2016-11-18 20:34:34 PST
Attachment 295246 [details] did not pass style-queue:


ERROR: Source/WebCore/testing/Internals.cpp:858:  EVENT_THROTTLING_BEHAVIOR_RESPONSIVE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
ERROR: Source/WebCore/testing/Internals.cpp:859:  EVENT_THROTTLING_BEHAVIOR_UNRESPONSIVE is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 2 in 18 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Chris Dumez 2016-11-18 21:04:11 PST
Comment on attachment 295246 [details]
Patch

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

r=me with suggestion

> Source/WebCore/testing/Internals.idl:333
> +    attribute unsigned short? eventThrottlingBehaviorOverride;

The modern way of doing this would be to use a string enumeration in IDL.

enum EventThrottlingBehavior { "responsive", "unresponsive" };
attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;

Also, is there really a need for this to be nullable? It seems we could just return "responsive" by default.

Finally, given your comment, shouldn't this be in a #if PLATFORM(IOS) block?
Comment 6 Chris Dumez 2016-11-18 21:05:15 PST
Comment on attachment 295246 [details]
Patch

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

> LayoutTests/fast/scrolling/ios/scroll-events-default-expected.txt:1
> +PASS receivedScrollEvent is true

nit: It'd be nice for those tests to have a description("...");
Comment 7 Simon Fraser (smfr) 2016-11-18 21:15:15 PST
(In reply to comment #5)
> Comment on attachment 295246 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=295246&action=review
> 
> r=me with suggestion
> 
> > Source/WebCore/testing/Internals.idl:333
> > +    attribute unsigned short? eventThrottlingBehaviorOverride;
> 
> The modern way of doing this would be to use a string enumeration in IDL.
> 
> enum EventThrottlingBehavior { "responsive", "unresponsive" };
> attribute EventThrottlingBehavior? eventThrottlingBehaviorOverride;

Nice, will do that.

> Also, is there really a need for this to be nullable? It seems we could just
> return "responsive" by default.

I made it nullable to remove the override entirely.

> Finally, given your comment, shouldn't this be in a #if PLATFORM(IOS) block?

It only impacts iOS, but I'd prefer to not conditionalize the internals API because it makes cross-platform tests harder to write.
Comment 8 Simon Fraser (smfr) 2016-11-18 23:35:58 PST
Committed r208921: <http://trac.webkit.org/changeset/208921>