Bug 1633102 - Use disableNonTestMouseEvents to prevent mouse hover or tooltips from affecting mozscreenshots a=test-only

Differential Revision: https://phabricator.services.mozilla.com/D72512
This commit is contained in:
Matthew Noorenberghe 2020-04-25 17:38:01 +00:00
Родитель 086657e157
Коммит df0c47bd53
2 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -141,6 +141,9 @@ var TestRunner = {
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
// Prevent the mouse cursor from causing hover styles or tooltips to appear.
browserWindow.windowUtils.disableNonTestMouseEvents(true);
// When being automated through Marionette, Firefox shows a prominent indication
// in the urlbar and identity block. We don't want this to show when testing browser UI.
// Note that this doesn't prevent subsequently opened windows from showing the automation UI.
@ -252,6 +255,7 @@ var TestRunner = {
browserWindow.restore();
Services.prefs.clearUserPref("ui.caretBlinkTime");
Services.prefs.clearUserPref("ui.prefersReducedMotion");
browserWindow.windowUtils.disableNonTestMouseEvents(false);
},
// helpers

Просмотреть файл

@ -64,7 +64,7 @@ var DevTools = {
let target = await getTargetForSelectedTab();
let toolbox = await gDevTools.showToolbox(target, "inspector", "right");
this.selectors = [selectToolbox.bind(null, toolbox)];
await new Promise(resolve => setTimeout(resolve, 500));
await new Promise(resolve => setTimeout(resolve, 1000));
},
},
undockedToolbox: {
@ -77,7 +77,7 @@ var DevTools = {
"window"
);
this.selectors = [selectToolbox.bind(null, toolbox)];
await new Promise(resolve => setTimeout(resolve, 500));
await new Promise(resolve => setTimeout(resolve, 1000));
},
},
},