fune/devtools/client/responsive/test/browser/browser_zoom.js
Nicolas Chevobbe 6d089546e6 Bug 1774809 - [devtools] Fix intermittent in browser_zoom.js , r=jdescottes.
Wait for the devices to be loaded to prevent issue when closing RDM

Differential Revision: https://phabricator.services.mozilla.com/D149724
2022-06-21 05:11:17 +00:00

27 lines
738 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const URL = "data:text/html,foo";
addRDMTaskWithPreAndPost(
URL,
async function pre({ browser }) {
info("Setting zoom");
// It's important that we do this so that we don't race with FullZoom's use
// of ContentSettings, which would reset the zoom.
FullZoom.setZoom(2.0, browser);
},
async function task({ browser, ui }) {
is(
ZoomManager.getZoomForBrowser(browser),
2.0,
"Zoom shouldn't have got lost"
);
// wait for the list of devices to be loaded to prevent pending promises
await waitForDeviceAndViewportState(ui);
},
async function post() {}
);