mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 23:38:38 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
|
|
@ -0,0 +1,49 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
// Test RDM menu item is checked when expected, on multiple windows.
|
||||
|
||||
const TEST_URL = "data:text/html;charset=utf-8,";
|
||||
|
||||
const { getMostRecentBrowserWindow } = require("sdk/window/utils");
|
||||
|
||||
const isMenuCheckedFor = ({document}) => {
|
||||
let menu = document.getElementById("menu_responsiveUI");
|
||||
return menu.getAttribute("checked") === "true";
|
||||
};
|
||||
|
||||
add_task(function* () {
|
||||
const window1 = yield BrowserTestUtils.openNewBrowserWindow();
|
||||
let { gBrowser } = window1;
|
||||
|
||||
yield BrowserTestUtils.withNewTab({ gBrowser, url: TEST_URL },
|
||||
function* (browser) {
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
|
||||
is(window1, getMostRecentBrowserWindow(),
|
||||
"The new window is the active one");
|
||||
|
||||
ok(!isMenuCheckedFor(window1),
|
||||
"RDM menu item is unchecked by default");
|
||||
|
||||
yield openRDM(tab);
|
||||
|
||||
ok(isMenuCheckedFor(window1),
|
||||
"RDM menu item is checked with RDM open");
|
||||
|
||||
yield closeRDM(tab);
|
||||
|
||||
ok(!isMenuCheckedFor(window1),
|
||||
"RDM menu item is unchecked with RDM closed");
|
||||
});
|
||||
|
||||
yield BrowserTestUtils.closeWindow(window1);
|
||||
|
||||
is(window, getMostRecentBrowserWindow(),
|
||||
"The original window is the active one");
|
||||
|
||||
ok(!isMenuCheckedFor(window),
|
||||
"RDM menu item is unchecked");
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue