Open Bug 1028895 Opened 10 years ago Updated 1 year ago

Mouseover triggered in mochitest-browser & dt according to position of mouse cursor on test box


(Testing :: Mochitest, defect)



(Not tracked)


(Reporter: miker, Unassigned, Mentored)


(Depends on 1 open bug)


(Keywords: good-first-bug, Whiteboard: [lang=js])


(1 file)

I have mochitests failing because the mouse pointer on test machines is triggering mouseover events and breaking tests.

I am sure that we only recognised synthesized mouse events in tests. Has this changed recently?

If we can receive mouseover events from random places in the UI depending on where the test box mouse cursor is it will obviously break stuff.

1. Apply the attached patch to a copy of fx-team.
2. ./mach build
3. Run the test using:
./mach mochitest-devtools browser/devtools/layoutview/test/browser_layoutview_guides.js
4. Move the mouse so that it is over where the padding region of the layout view will be when the test runs.
5. Run the test again.

Extra mouseover events will be triggered and the test will fail, at least for me on OSX Mavericks and on Windows test servers.

Native mouse events really should be disabled on test servers and only synthesized events should be allowed.
This is the code that triggers the issue:
elt.addEventListener("mouseover", onmouseover, true);

let onmouseover = function(e) {
  let region ="data-box");

  this.layoutview.showBoxModel({region: region});

  return false;

showBoxModel: function(options={}) {
  let toolbox = this.inspector.toolbox;
  let nodeFront = this.inspector.selection.nodeFront;

  dump("\n\nview.js showing box model with " + options.toSource() + "\n\n");
  toolbox.highlighterUtils.highlightNodeFront(nodeFront, options);

Even though synthesizeMouse has not been called and the only place this can be triggered is when mousing over the layout view's padding div it is triggered when the test first runs:
04:17:45     INFO -  view.js showing box model with ({region:"padding"})
04:17:45     INFO -  view.js showing box model with ({region:"padding"})
04:17:45     INFO -  view.js showing box model with ({region:"padding"})
04:17:45     INFO -  view.js showing box model with ({region:"padding"})

We need to somehow be smart about blocking native mouse events.
All of our tests should block mouse events using:

When bug 1029451 is fixed (it currently blocks synthetic mouseover) we should add it to our head.js files.
Assignee: nobody → mratcliffe
Assignee: mratcliffe → nobody
Mentor: mratcliffe
Whiteboard: [good first bug][lang=js]
Component: Mochitest Chrome → Mochitest
Keywords: good-first-bug
Whiteboard: [good first bug][lang=js] → [lang=js]

Is this still open?

Severity: normal → S3

Hi, I am an Outreachy applicant interested in fixing this bug. I wish to take up this issue... could you pls guide me?

Hello, As an outreachy applicant, am I eligible to contribute to this bug

You need to log in before you can comment on or make changes to this bug.