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

Categories

(Testing :: Mochitest, defect)

defect

Tracking

(Not tracked)

People

(Reporter: miker, Unassigned, Mentored)

References

(Depends on 1 open bug)

Details

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

Attachments

(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.

STR:
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:
/Users/mratcliffe/Desktop/fx-team/browser/devtools/layoutview/view.js
elt.addEventListener("mouseover", onmouseover, true);

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

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

  return false;
}.bind(window);

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:
EventUtils.disableNonTestMouseEvents(true)

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.

Attachment

General

Created:
Updated:
Size: