Bug 194900

Summary: Add tests mixing programmatic and user frame scrolling on iOS
Product: WebKit Reporter: Frédéric Wang (:fredw) <fred.wang>
Component: New BugsAssignee: Frédéric Wang (:fredw) <fred.wang>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, koivisto, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=196394
Bug Depends on: 192303, 194886, 195003    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Frédéric Wang (:fredw) 2019-02-21 07:51:58 PST
Add more tests for programmatic frame scrolling on iOS
Comment 1 Frédéric Wang (:fredw) 2019-02-21 07:54:12 PST
Created attachment 362605 [details]
Patch
Comment 2 Frédéric Wang (:fredw) 2019-02-22 09:08:16 PST
review ping?
Comment 3 Simon Fraser (smfr) 2019-02-22 10:24:17 PST
Comment on attachment 362605 [details]
Patch

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

> LayoutTests/fast/scrolling/ios/hit-testing-iframe.html:110
> +      <iframe id="clickElementInsideFrameAfterProgrammaticScroll" style="left: 100px; top: 100px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
> +          <body style='margin: 0; width: 200px; height: 200px; background: green;'>
> +             <div style='position: absolute; width: 75px; height: 75px; background: red;'></div>
> +              <div style='position: absolute; left: 110px; top: 110px; width: 50px; height: 50px; background: red;'
> +                   onclick='this.style.background=&quot;green&quot;'></div>
> +          </body>" onload="newFrameLoaded()">
> +      </iframe>

I don't like tests that do multiple different things. It's really hard to debug them, and when the test breaks, you have to spend time investigating to see which part broke. I think this should be broken into 6(?) different tests.
Comment 4 Frédéric Wang (:fredw) 2019-02-25 06:41:36 PST
(In reply to Simon Fraser (smfr) from comment #3)
> Comment on attachment 362605 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362605&action=review
> 
> > LayoutTests/fast/scrolling/ios/hit-testing-iframe.html:110
> > +      <iframe id="clickElementInsideFrameAfterProgrammaticScroll" style="left: 100px; top: 100px;" scrolling="yes" onclick="this.style.background='red'" srcdoc="
> > +          <body style='margin: 0; width: 200px; height: 200px; background: green;'>
> > +             <div style='position: absolute; width: 75px; height: 75px; background: red;'></div>
> > +              <div style='position: absolute; left: 110px; top: 110px; width: 50px; height: 50px; background: red;'
> > +                   onclick='this.style.background=&quot;green&quot;'></div>
> > +          </body>" onload="newFrameLoaded()">
> > +      </iframe>
> 
> I don't like tests that do multiple different things. It's really hard to
> debug them, and when the test breaks, you have to spend time investigating
> to see which part broke. I think this should be broken into 6(?) different
> tests.


For hit-testing.html, I moved that task to bug 195003. I'll try and split the new one on this bug.
Comment 5 Frédéric Wang (:fredw) 2019-02-25 07:37:03 PST
Comment on attachment 362605 [details]
Patch

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

> LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll.html:83
> +       var frameToLoadCount = 1;

Oops, this seems wrong.
Comment 6 Frédéric Wang (:fredw) 2019-02-25 08:23:21 PST
Created attachment 362904 [details]
Patch
Comment 7 Antti Koivisto 2019-02-25 09:56:50 PST
Comment on attachment 362904 [details]
Patch

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

> LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll-005.html:37
> +          await waitPromise(1000); // Wait for scrolling to stabilize.

It is bit sad that these tests are so slow to run.
Comment 8 Frédéric Wang (:fredw) 2019-02-25 10:00:41 PST
(In reply to Antti Koivisto from comment #7)
> Comment on attachment 362904 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=362904&action=review
> 
> > LayoutTests/fast/scrolling/ios/mixing-user-and-programmatic-scroll-005.html:37
> > +          await waitPromise(1000); // Wait for scrolling to stabilize.
> 
> It is bit sad that these tests are so slow to run.

Right, not sure how to improve this, though.
Comment 9 WebKit Commit Bot 2019-02-25 10:26:14 PST
Comment on attachment 362904 [details]
Patch

Clearing flags on attachment: 362904

Committed r242046: <https://trac.webkit.org/changeset/242046>
Comment 10 WebKit Commit Bot 2019-02-25 10:26:16 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Antti Koivisto 2019-02-25 10:27:34 PST
We should add testing API that simulates user scroll without using UI scripting. I have a patch along those lines. It is good to have some tests doing real scrolling though.
Comment 12 Radar WebKit Bug Importer 2019-02-25 10:39:19 PST
<rdar://problem/48368245>
Comment 13 Radar WebKit Bug Importer 2019-02-25 10:39:19 PST
<rdar://problem/48368246>