Closed Bug 1421101 Opened 7 years ago Closed 7 years ago

browser/base/content/test/general/browser_ctrlTab.js should disable mouse events on tab previews

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 59
Tracking Status
firefox59 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(1 file)

browser/base/content/test/general/browser_ctrlTab.js fails after bug 1193394 and bug 1414180, because the unexpected tab preview is accidentally selected by mouse cursor, after removing the tab by ctrl+W. https://searchfox.org/mozilla-central/rev/7a8c667bdd2a4a32746c9862356e199627c0896d/browser/base/content/browser-tabPreviews.xml#28 > <handler event="mouseover" action="ctrlTab._mouseOverFocus(this);"/> https://searchfox.org/mozilla-central/rev/7a8c667bdd2a4a32746c9862356e199627c0896d/browser/base/content/test/general/browser_ctrlTab.js#67 > await synthesizeCtrlW(); > ok(!tabToRemove.parentNode, > "Ctrl+Tab*2 -> Ctrl+W removes the second most recently selected tab"); > > await pressCtrlTab(true); > await pressCtrlTab(true); > await releaseCtrl(); > ok(selectedTab.selected, > "Ctrl+Tab*2 -> Ctrl+W -> Ctrl+Shift+Tab*2 keeps the selected tab"); after ctrl+W, the selected tab in preview is expected to remain in the same index, but mouse event changes it, and the selected tab is changed at the last `ok(...)` there, and fails. so, before doing the test, mouse cursor should be moved outside of the tab preview area.
suggested by zombie on IRC, I'm going to apply "pointer-events: none;" on previews while the test, that should be safer.
Summary: browser/base/content/test/general/browser_ctrlTab.js should move mouse cursor out of tab preview box → browser/base/content/test/general/browser_ctrlTab.js should disable mouse events on tab previews
Applied "pointer-events: none" style to preview buttons in tab preview, to avoid accidentally changing the selected tab while automated test.
Attachment #8932825 - Flags: review?(jaws)
Blocks: 1414180
Comment on attachment 8932825 [details] [diff] [review] Disable mouse events on tab preview buttons in browser/base/content/test/general/browser_ctrlTab.js. Review of attachment 8932825 [details] [diff] [review]: ----------------------------------------------------------------- ::: browser/base/content/test/general/browser_ctrlTab.js @@ +8,5 @@ > + // While doing this test, we should make sure the selected tab in the tab > + // preview is not changed by mouse events. That may happen after closing > + // the selected tab with ctrl+W. Disable all mouse events to prevent it. > + for (let n of ctrlTab.previews) { > + n.style.pointerEvents = "none"; s/n/node/ here and below @@ +13,5 @@ > + } > + registerCleanupFunction(function() { > + for (let n of ctrlTab.previews) { > + try { > + n.style.pointerEvents = ""; n.style.removeProperty("pointer-events");
Attachment #8932825 - Flags: review?(jaws) → review+
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b71e6786319f Disable mouse events on tab preview buttons in browser/base/content/test/general/browser_ctrlTab.js. r=jaws
https://hg.mozilla.org/integration/mozilla-inbound/rev/b71e6786319f15b8965f8692a3836d6e35eaebd8 Bug 1421101 - Disable mouse events on tab preview buttons in browser/base/content/test/general/browser_ctrlTab.js. r=jaws
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: