Closed
Bug 1264017
Opened 8 years ago
Closed 8 years ago
Add a test_click.html to test mouse clicks
Categories
(Core :: Panning and Zooming, defect)
Core
Panning and Zooming
Tracking
()
RESOLVED
FIXED
mozilla49
People
(Reporter: kats, Assigned: kats)
References
Details
(Whiteboard: [gfx-noted])
Attachments
(6 files)
58 bytes,
text/x-review-board-request
|
botond
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
botond
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
rbarker
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
botond
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
botond
:
review+
|
Details |
58 bytes,
text/x-review-board-request
|
botond
:
review+
|
Details |
We have a test_tap.html file that tests touch-tapping in APZ. We should add a similar one for mouse clicking. We'll need to ensure the native mouse event sythesization works everywhere and add some helpers in apz_test_native_event_utils.js.
Assignee | ||
Updated•8 years ago
|
Whiteboard: [gfx-noted]
Assignee | ||
Comment 1•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=39d9fcb63709
Assignee | ||
Comment 2•8 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=818fd93e99d2
Assignee | ||
Comment 3•8 years ago
|
||
Also https://treeherder.mozilla.org/#/jobs?repo=try&revision=4dc482341101 for android since 'add jobs' doesn't work.
Assignee | ||
Comment 4•8 years ago
|
||
I canceled the push in comment 3 since it turns out 'add jobs' on comment 2 did work, just delayed. Tests are looking green, I'll put these up for review.
Assignee | ||
Comment 5•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/51993/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/51993/
Attachment #8751387 -
Flags: review?(botond)
Attachment #8751388 -
Flags: review?(botond)
Attachment #8751389 -
Flags: review?(rbarker)
Attachment #8751390 -
Flags: review?(botond)
Assignee | ||
Comment 6•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/51995/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/51995/
Assignee | ||
Comment 7•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/51997/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/51997/
Assignee | ||
Comment 8•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/51999/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/51999/
Comment 9•8 years ago
|
||
Comment on attachment 8751389 [details] MozReview Request: Bug 1264017 - Add synthesized mouse support to Android. r=rbarker https://reviewboard.mozilla.org/r/51997/#review48877
Attachment #8751389 -
Flags: review?(rbarker) → review+
Updated•8 years ago
|
Attachment #8751388 -
Flags: review?(botond) → review+
Comment 10•8 years ago
|
||
Comment on attachment 8751388 [details] MozReview Request: Bug 1264017 - Add a basic sanity mouse click synthesization test. r=botond https://reviewboard.mozilla.org/r/51995/#review48879
Comment 11•8 years ago
|
||
Comment on attachment 8751387 [details] MozReview Request: Bug 1264017 - Add an APZ test API to synthesize a mouse click. r=botond https://reviewboard.mozilla.org/r/51993/#review48881 I'm not very well-versed in the GTK widget code, but this looks simple enough, and it's only used by tests, so I'll r+ it. ::: widget/gtk/nsWindow.cpp:6837 (Diff revision 1) > > + event.button.x_root = aPoint.x; > + event.button.y_root = aPoint.y; > + > + LayoutDeviceIntPoint pointInWindow = aPoint - WidgetToScreenOffset(); > + event.button.x = pointInWindow.x; Similar code for touch events calls DevicePixelsToGdkCoordRoundDown().
Attachment #8751387 -
Flags: review?(botond) → review+
Comment 12•8 years ago
|
||
Comment on attachment 8751390 [details] MozReview Request: Bug 1264017 - Add another mouse event synthesization sanity test. r=botond https://reviewboard.mozilla.org/r/51999/#review48887 ::: gfx/layers/apz/test/mochitest/helper_drag_click.html:28 (Diff revision 1) > + > +function clicked(e) { > + // The mouse down at (5, 5) should not have generated a click, but the up > + // at (8, 8) should have. > + window.opener.is(e.target, document.getElementById('b'), "Clicked on button, yay! (at " + e.clientX + "," + e.clientY + ")"); > + window.opener.is(e.clientX, 8 + Math.floor(document.getElementById('b').getBoundingClientRect().left), 'x-coord of click event looks sane'); coordinatesRelativeToWindow() also takes into account devicePixelRatio and mozInnerScreen{X,Y}. If those are not 1 / 0, will this calculation still work? Perhaps we could instead write a coordinatesRelativeToElement() function that does the inverse of coordinatesRelativeToWindow(), and the check that coordinatesRelativeToElement(clientX, clientY) is (8, 8)?
Attachment #8751390 -
Flags: review?(botond) → review+
Assignee | ||
Comment 13•8 years ago
|
||
ni? myself as a reminder to do what I said in https://bugzilla.mozilla.org/show_bug.cgi?id=1270955#c20
Flags: needinfo?(bugmail.mozilla)
Assignee | ||
Comment 14•8 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #11) > > + LayoutDeviceIntPoint pointInWindow = aPoint - WidgetToScreenOffset(); > > + event.button.x = pointInWindow.x; > > Similar code for touch events calls DevicePixelsToGdkCoordRoundDown(). Good catch! I fixed this here, and filed bug 1272152 for fixing it in the mouse-scroll event synthesization wherefrom I copied this.
See Also: → 1272152
Assignee | ||
Comment 15•8 years ago
|
||
(In reply to Botond Ballo [:botond] from comment #12) > coordinatesRelativeToWindow() also takes into account devicePixelRatio and > mozInnerScreen{X,Y}. If those are not 1 / 0, will this calculation still > work? Good question - I checked and yes, it does. The parameters passed to synthesizeNativeMouseEvent are in CSS pixels relative to the element's bounding rect (this is documented above coordinatesRelativeToWindow). They get converted into some GDK coordinate space when they are sent off to GDK, but then gecko does most of the reverse conversion when processing the event. Inside the click handler, the event's clientX and clientY coordinates are in CSS pixels, relative to the client area of the window. Then I use the button's bounding client rect to shift it into CSS pixels, relative to the button's bounding rect. This is the same coordinate space that the original values passed to synthesizeNativeMouseEvent were in, so they are comparable. I verified this by running the test with --setpref layout.css.devPixelsPerPx=2.0 and 4.0. If I run it with 0.5 the test does fail, because of float to int truncation somewhere along the way (the click coordinates are one pixel less than the expected coordinates). I didn't dig into where exactly that's happening. > Perhaps we could instead write a coordinatesRelativeToElement() function > that does the inverse of coordinatesRelativeToWindow(), and the check that > coordinatesRelativeToElement(clientX, clientY) is (8, 8)? Given the above, I don't think this is needed, since it's basically what Gecko does for us already.
Assignee | ||
Comment 16•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52207/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/52207/
Attachment #8751387 -
Attachment description: MozReview Request: Bug 1264017 - Add an APZ test API to synthesize a mouse click. r?botond → MozReview Request: Bug 1264017 - Add an APZ test API to synthesize a mouse click. r=botond
Attachment #8751388 -
Attachment description: MozReview Request: Bug 1264017 - Add a basic sanity mouse click synthesization test. r?botond → MozReview Request: Bug 1264017 - Add a basic sanity mouse click synthesization test. r=botond
Attachment #8751389 -
Attachment description: MozReview Request: Bug 1264017 - Add synthesized mouse support to Android. r?rbarker → MozReview Request: Bug 1264017 - Add synthesized mouse support to Android. r=rbarker
Attachment #8751390 -
Attachment description: MozReview Request: Bug 1264017 - Add another mouse event synthesization sanity test. r?botond → MozReview Request: Bug 1264017 - Add another mouse event synthesization sanity test. r=botond
Attachment #8751775 -
Flags: review?(botond)
Attachment #8751776 -
Flags: review?(botond)
Assignee | ||
Comment 17•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/52209/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/52209/
Assignee | ||
Comment 18•8 years ago
|
||
Comment on attachment 8751387 [details] MozReview Request: Bug 1264017 - Add an APZ test API to synthesize a mouse click. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51993/diff/1-2/
Assignee | ||
Comment 19•8 years ago
|
||
Comment on attachment 8751388 [details] MozReview Request: Bug 1264017 - Add a basic sanity mouse click synthesization test. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51995/diff/1-2/
Assignee | ||
Comment 20•8 years ago
|
||
Comment on attachment 8751389 [details] MozReview Request: Bug 1264017 - Add synthesized mouse support to Android. r=rbarker Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51997/diff/1-2/
Assignee | ||
Comment 21•8 years ago
|
||
Comment on attachment 8751390 [details] MozReview Request: Bug 1264017 - Add another mouse event synthesization sanity test. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51999/diff/1-2/
Assignee | ||
Comment 22•8 years ago
|
||
Parts 1-4 are the same as before, with any review comments addressed. Part 5 extracts the machinery to run the tests in new windows from test_tap, test_click, and test_scroll_window into a helper function in apz_test_utils. I cleaned it up a bit to use a Promise, remove the !!, documented it a bit, and so on. I also modified it to inject a few things into the subtests so they don't have to use window.opener all over the place. Part 6 just renames these meta-tests to more appropriate names.
Flags: needinfo?(bugmail.mozilla)
Assignee | ||
Comment 23•8 years ago
|
||
Uh whoops, apparently starting test file names with "testgroup_" is verboten, and the harness just refuses to run them. Renaming to test_group_, sorry for the spew MozReview is about to generate.
Assignee | ||
Comment 24•8 years ago
|
||
Comment on attachment 8751387 [details] MozReview Request: Bug 1264017 - Add an APZ test API to synthesize a mouse click. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51993/diff/2-3/
Assignee | ||
Comment 25•8 years ago
|
||
Comment on attachment 8751388 [details] MozReview Request: Bug 1264017 - Add a basic sanity mouse click synthesization test. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51995/diff/2-3/
Assignee | ||
Comment 26•8 years ago
|
||
Comment on attachment 8751389 [details] MozReview Request: Bug 1264017 - Add synthesized mouse support to Android. r=rbarker Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51997/diff/2-3/
Assignee | ||
Comment 27•8 years ago
|
||
Comment on attachment 8751390 [details] MozReview Request: Bug 1264017 - Add another mouse event synthesization sanity test. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51999/diff/2-3/
Assignee | ||
Comment 28•8 years ago
|
||
Comment on attachment 8751775 [details] MozReview Request: Bug 1264017 - Refactor machinery to run tests serially in new windows into a helper function. r?botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52207/diff/1-2/
Assignee | ||
Comment 29•8 years ago
|
||
Comment on attachment 8751776 [details] MozReview Request: Bug 1264017 - Rename the meta-tests to have more meaningful names. r?botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52209/diff/1-2/
Assignee | ||
Comment 30•8 years ago
|
||
Comment on attachment 8751775 [details] MozReview Request: Bug 1264017 - Refactor machinery to run tests serially in new windows into a helper function. r?botond Looks like these patches are also failing on try, I need to debug it.
Attachment #8751775 -
Flags: review?(botond)
Assignee | ||
Updated•8 years ago
|
Attachment #8751776 -
Flags: review?(botond)
Assignee | ||
Comment 31•8 years ago
|
||
New try push which includes the patch on bug 1272757. https://treeherder.mozilla.org/#/jobs?repo=try&revision=7811b76c4608
Assignee | ||
Comment 32•8 years ago
|
||
I rebased to latest master, try push at https://treeherder.mozilla.org/#/jobs?repo=try&revision=ec248f9f7116 is still green, patches coming up.
Assignee | ||
Comment 33•8 years ago
|
||
Comment on attachment 8751387 [details] MozReview Request: Bug 1264017 - Add an APZ test API to synthesize a mouse click. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51993/diff/3-4/
Attachment #8751775 -
Flags: review?(botond)
Attachment #8751776 -
Flags: review?(botond)
Assignee | ||
Comment 34•8 years ago
|
||
Comment on attachment 8751388 [details] MozReview Request: Bug 1264017 - Add a basic sanity mouse click synthesization test. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51995/diff/3-4/
Assignee | ||
Comment 35•8 years ago
|
||
Comment on attachment 8751389 [details] MozReview Request: Bug 1264017 - Add synthesized mouse support to Android. r=rbarker Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51997/diff/3-4/
Assignee | ||
Comment 36•8 years ago
|
||
Comment on attachment 8751390 [details] MozReview Request: Bug 1264017 - Add another mouse event synthesization sanity test. r=botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/51999/diff/3-4/
Assignee | ||
Comment 37•8 years ago
|
||
Comment on attachment 8751775 [details] MozReview Request: Bug 1264017 - Refactor machinery to run tests serially in new windows into a helper function. r?botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52207/diff/2-3/
Assignee | ||
Comment 38•8 years ago
|
||
Comment on attachment 8751776 [details] MozReview Request: Bug 1264017 - Rename the meta-tests to have more meaningful names. r?botond Review request updated; see interdiff: https://reviewboard.mozilla.org/r/52209/diff/2-3/
Updated•8 years ago
|
Attachment #8751775 -
Flags: review?(botond) → review+
Comment 39•8 years ago
|
||
Comment on attachment 8751775 [details] MozReview Request: Bug 1264017 - Refactor machinery to run tests serially in new windows into a helper function. r?botond https://reviewboard.mozilla.org/r/52207/#review49730 Nice :)
Updated•8 years ago
|
Attachment #8751776 -
Flags: review?(botond) → review+
Comment 40•8 years ago
|
||
Comment on attachment 8751776 [details] MozReview Request: Bug 1264017 - Rename the meta-tests to have more meaningful names. r?botond https://reviewboard.mozilla.org/r/52209/#review49732
Comment 41•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd9e7767d112 https://hg.mozilla.org/integration/mozilla-inbound/rev/425633c8f994 https://hg.mozilla.org/integration/mozilla-inbound/rev/e07d0d4457bd https://hg.mozilla.org/integration/mozilla-inbound/rev/393b895ef10e https://hg.mozilla.org/integration/mozilla-inbound/rev/7d96e3a7b84c https://hg.mozilla.org/integration/mozilla-inbound/rev/4b108c0fa4c9
Comment 42•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dd9e7767d112 https://hg.mozilla.org/mozilla-central/rev/425633c8f994 https://hg.mozilla.org/mozilla-central/rev/e07d0d4457bd https://hg.mozilla.org/mozilla-central/rev/393b895ef10e https://hg.mozilla.org/mozilla-central/rev/7d96e3a7b84c https://hg.mozilla.org/mozilla-central/rev/4b108c0fa4c9
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox49:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Comment 43•8 years ago
|
||
This went perma-orange on all desktop platforms as well as android when merged to fx-team, which is now closed because of it. Any chance you have any idea why that would be? :-)
Flags: needinfo?(bugmail.mozilla)
Assignee | ||
Updated•8 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•