Closed Bug 1254091 Opened 4 years ago Closed 4 years ago

Rewrite test_mousecapture.xul to be e10s-compatible

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla48
Tracking Status
e10s + ---
firefox47 --- affected
firefox48 --- fixed

People

(Reporter: Gijs, Assigned: Gijs)

References

(Blocks 2 open bugs)

Details

(Whiteboard: btpp-followup-2016-03-18)

Attachments

(3 files, 1 obsolete file)

This bug is part of our effort to ensure we have adequate e10s-compatible test coverage for features currently tested as part of mochitest-chrome (which doesn't run in e10s).

From a quick DXR search it seems we added a test in bug 582771 as well, https://dxr.mozilla.org/mozilla-central/source/layout/base/tests/test_bug582771.html , which runs in e10s.

Olli/Neil, is that test sufficient to ensure that mouse capture from the child process by a web page is working? If so, we might not need to write a separate test.
Flags: needinfo?(enndeakin)
Flags: needinfo?(bugs)
test_mousecapture.xul tests a variety of different elements that use mouse capturing:

<xul:splitter>, <frameset> borders, selection dragging, mouse capture while dragging, plus general testing of setCapture/releaseCapture. It also tests <html:select>.

The test will need to be extensively rewritten.
Flags: needinfo?(enndeakin)
Flags: needinfo?(bugs)
tracking-e10s: --- → ?
Summary: Might need e10s-compatible HTML tests for toolkit's test_mousecapture.xul → Rewrite test_mousecapture.xul to be e10s-compatible
Neil, can you take this?
Flags: needinfo?(enndeakin)
Whiteboard: btpp-followup-2016-03-18
Taking this per discussion with Neil.
Assignee: nobody → gijskruitbosch+bugs
Status: NEW → ASSIGNED
Flags: needinfo?(enndeakin)
(In reply to Neil Deakin from comment #1)
> test_mousecapture.xul tests a variety of different elements that use mouse
> capturing:
> 
> <xul:splitter>, <frameset> borders, selection dragging, mouse capture while
> dragging, plus general testing of setCapture/releaseCapture. It also tests
> <html:select>.
> 
> The test will need to be extensively rewritten.

So this isn't an extensive rewrite by any means... but it seems to work both in e10s and non-e10s, and preserves the testing surface pretty much exactly (though we're now using HTML rather than XUL iframes to test the frameset things), and so it should at least be relatively easy to review. :-)
Comment on attachment 8731284 [details]
MozReview Request: Bug 1254091 - convert test_mousecapture.xul to mochitest-plain so we can run it in e10s, r?enndeakin

https://reviewboard.mozilla.org/r/40473/#review37065

Looks ok, but I don't think the tooltip part will work in a xhtml document. I think it tests that a tooltip opening doesn't affect the capture. The call that uses it is commented out though (line 164), so maybe it doesn't matter. Maybe file a bug so I can examine why later.
Attachment #8731284 - Flags: review?(enndeakin) → review+
Blocks: 1257482
Had to back this out because it seems to cause a frequent intermittent M-e10s(5) on OS X 10.10 opt. KWierso will start some retriggers on the runs which had passed.

Backout: https://hg.mozilla.org/integration/fx-team/rev/1477dcbfb8ec

Test runs with failures:
https://treeherder.mozilla.org/logviewer.html#?job_id=8087280&repo=fx-team
https://treeherder.mozilla.org/logviewer.html#?job_id=8082333&repo=fx-team

07:56:09     INFO -  3788 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | setCapture on body retargets to root node mousemove event fired
07:56:09     INFO -  3789 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml |  target for point 52,52
07:56:09     INFO -  3790 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | frameset after drag (2)
07:56:09     INFO -  3791 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml |  target for point 75,75
07:56:09     INFO -  3792 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | frameset after drag (25)
07:56:09     INFO -  3793 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml |  target for point 4050,4050
07:56:09     INFO -  3794 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | frameset after drag (4000)
07:56:09     INFO -  3795 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml |  target for point 38,38
07:56:09     INFO -  3796 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | frameset after drag (-12)
07:56:09     INFO -  3797 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | frameset after drag (0)
07:56:09     INFO -  3798 INFO TEST-PASS | toolkit/content/tests/mochitest/test_mousecapture.xhtml | scroll select
07:56:09     INFO -  3799 INFO must wait for focus
07:56:09     INFO -  3800 INFO TEST-UNEXPECTED-FAIL | toolkit/content/tests/mochitest/test_mousecapture.xhtml | Test timed out.
07:56:09     INFO -      reportError@SimpleTest/TestRunner.js:114:7
07:56:09     INFO -      TestRunner._checkForHangs@SimpleTest/TestRunner.js:134:7
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:09     INFO -      TestRunner.runTests@SimpleTest/TestRunner.js:366:5
07:56:09     INFO -      RunSet.runtests@SimpleTest/setup.js:186:3
07:56:09     INFO -      RunSet.runall@SimpleTest/setup.js:165:5
07:56:09     INFO -      hookupTests@SimpleTest/setup.js:258:5
07:56:09     INFO -  EventHandlerNonNull*getTestManifest@http://mochi.test:8888/manifestLibrary.js:45:3
07:56:09     INFO -      hookup@SimpleTest/setup.js:238:5
07:56:09     INFO -  EventHandlerNonNull*@http://mochi.test:8888/tests?autorun=1&closeWhenDone=1&consoleLevel=INFO&hideResultsTable=1&manifestFile=tests.json&dumpOutputDirectory=%2Fvar%2Ffolders%2Fkx%2Fqvhm4_gn43dcvvj7tsq112q000000w%2FT:11:1
07:56:10     INFO -  Not taking screenshot here: see the one that was previously logged
07:56:10     INFO -  3801 INFO TEST-UNEXPECTED-FAIL | toolkit/content/tests/mochitest/test_mousecapture.xhtml | [SimpleTest.finish()] waitForFocus() was called a different number of times from the number of callbacks run.  Maybe the test terminated prematurely -- be sure to use SimpleTest.waitForExplicitFinish(). - got 1, expected +0
07:56:10     INFO -      SimpleTest.is@SimpleTest/SimpleTest.js:267:5
07:56:10     INFO -      SimpleTest.finish/afterCleanup@SimpleTest/SimpleTest.js:1044:13
07:56:10     INFO -      SimpleTest.finish/executeCleanupFunction@SimpleTest/SimpleTest.js:1086:13
07:56:10     INFO -      SimpleTest.finish@SimpleTest/SimpleTest.js:1105:5
07:56:10     INFO -      killTest@SimpleTest/TestRunner.js:122:7
07:56:10     INFO -      delayedKillTest@SimpleTest/TestRunner.js:149:47
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:149:7
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:155:5
07:56:10     INFO -      TestRunner.runTests@SimpleTest/TestRunner.js:366:5
07:56:10     INFO -      RunSet.runtests@SimpleTest/setup.js:186:3
07:56:10     INFO -      RunSet.runall@SimpleTest/setup.js:165:5
07:56:10     INFO -      hookupTests@SimpleTest/setup.js:258:5
07:56:10     INFO -  EventHandlerNonNull*getTestManifest@http://mochi.test:8888/manifestLibrary.js:45:3
07:56:10     INFO -      hookup@SimpleTest/setup.js:238:5
07:56:10     INFO -  EventHandlerNonNull*@http://mochi.test:8888/tests?autorun=1&closeWhenDone=1&consoleLevel=INFO&hideResultsTable=1&manifestFile=tests.json&dumpOutputDirectory=%2Fvar%2Ffolders%2Fkx%2Fqvhm4_gn43dcvvj7tsq112q000000w%2FT:11:1
Flags: needinfo?(gijskruitbosch+bugs)
Took a while, but figured this out. The specialpowers fix will also help fix bug 1237146, I think.
Flags: needinfo?(gijskruitbosch+bugs)
See Also: → 1237146
Attachment #8731284 - Attachment is obsolete: true
Attachment #8732301 - Flags: review?(enndeakin)
Attachment #8732302 - Flags: review?(enndeakin)
Attachment #8732301 - Flags: review?(enndeakin) → review+
Attachment #8732302 - Flags: review?(enndeakin) → review+
Need to catch exceptions when aWindow isn't a content window and doesn't have a message manager, as the code as-is dies in mochitest-chrome cases where we pass XUL windows, apparently (surprising to me, because I assumed we only took the SpecialPowers path for non-privileged mochitest-plain stuff... but anyway).

remote:   https://treeherder.mozilla.org/#/jobs?repo=try&revision=7454d062a771
https://hg.mozilla.org/mozilla-central/rev/18fca568ae42
https://hg.mozilla.org/mozilla-central/rev/3169edcea9d9
https://hg.mozilla.org/mozilla-central/rev/3dc5292ed66a
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Depends on: 1258896
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.