gecko-dev/browser/base/content/test/general/browser_minimize.js
neha f88ff18658 Bug 1530182 - Replaced promiseWaitForCondition with TestUtils.waitForCondition in browser_minimize.js. r=johannh
Replaced promiseWaitForCondition with TestUtils.waitForCondition. Replaced all occurences of promiseWaitForCondition with TstUtils.waitForCondition, in mozilla-central/browser/base/content/test/general/browser_minimize.js

Differential Revision: https://phabricator.services.mozilla.com/D21036

--HG--
extra : moz-landing-system : lando
2019-02-25 19:06:40 +00:00

18 lines
906 B
JavaScript

/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
add_task(async function() {
registerCleanupFunction(function() {
window.restore();
});
function waitForActive() { return gBrowser.selectedTab.linkedBrowser.docShellIsActive; }
function waitForInactive() { return !gBrowser.selectedTab.linkedBrowser.docShellIsActive; }
await TestUtils.waitForCondition(waitForActive);
is(gBrowser.selectedTab.linkedBrowser.docShellIsActive, true, "Docshell should be active");
window.minimize();
await TestUtils.waitForCondition(waitForInactive);
is(gBrowser.selectedTab.linkedBrowser.docShellIsActive, false, "Docshell should be Inactive");
window.restore();
await TestUtils.waitForCondition(waitForActive);
is(gBrowser.selectedTab.linkedBrowser.docShellIsActive, true, "Docshell should be active again");
});