michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: gPrefService.setBoolPref("dom.disable_open_during_load", false); michael@0: michael@0: var browser = gBrowser.selectedBrowser; michael@0: browser.addEventListener("load", function () { michael@0: browser.removeEventListener("load", arguments.callee, true); michael@0: michael@0: if (gPrefService.prefHasUserValue("dom.disable_open_during_load")) michael@0: gPrefService.clearUserPref("dom.disable_open_during_load"); michael@0: michael@0: findPopup(); michael@0: }, true); michael@0: michael@0: content.location = michael@0: "data:text/html,"; michael@0: } michael@0: michael@0: function findPopup() { michael@0: var enumerator = Services.wm.getEnumerator("navigator:browser"); michael@0: michael@0: while (enumerator.hasMoreElements()) { michael@0: let win = enumerator.getNext(); michael@0: if (win.content.wrappedJSObject == content.wrappedJSObject.popup) { michael@0: testPopupUI(win); michael@0: return; michael@0: } michael@0: } michael@0: michael@0: throw "couldn't find the popup"; michael@0: } michael@0: michael@0: function testPopupUI(win) { michael@0: var doc = win.document; michael@0: michael@0: ok(win.gURLBar, "location bar exists in the popup"); michael@0: isnot(win.gURLBar.clientWidth, 0, "location bar is visible in the popup"); michael@0: ok(win.gURLBar.readOnly, "location bar is read-only in the popup"); michael@0: isnot(doc.getElementById("Browser:OpenLocation").getAttribute("disabled"), "true", michael@0: "'open location' command is not disabled in the popup"); michael@0: michael@0: let historyButton = doc.getAnonymousElementByAttribute(win.gURLBar, "anonid", michael@0: "historydropmarker"); michael@0: is(historyButton.clientWidth, 0, "history dropdown button is hidden in the popup"); michael@0: michael@0: EventUtils.synthesizeKey("t", { accelKey: true }, win); michael@0: is(win.gBrowser.browsers.length, 1, "Accel+T doesn't open a new tab in the popup"); michael@0: michael@0: EventUtils.synthesizeKey("w", { accelKey: true }, win); michael@0: ok(win.closed, "Accel+W closes the popup"); michael@0: michael@0: if (!win.closed) michael@0: win.close(); michael@0: gBrowser.addTab(); michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: }