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

NEW
Unassigned

Status

4 years ago
9 months ago

People

(Reporter: miker, Unassigned, Mentored)

Tracking

(Depends on: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

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

Attachments

(1 attachment)

Created attachment 8444392 [details] [diff] [review]
layout-view-guides-994729.patch

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]
(Assignee)

Updated

9 months ago
Component: Mochitest Chrome → Mochitest
Product: Testing → Testing
You need to log in before you can comment on or make changes to this bug.