gecko-dev/browser/base/content/test/browser_utilityOverlay.js
Gavin Sharp eaf57306e9 Bug 512784: add Services.jsm module to allow easy global access to common services, r=dao, r=Mossop
--HG--
extra : rebase_source : 1827809b6e8ce51e4fb238e962f36aaf30b6ad15
2010-01-28 13:31:45 -05:00

36 lines
1.2 KiB
JavaScript

var gTestTab;
function test() {
waitForExplicitFinish();
is(getTopWin(), window, "got top window");
is(getBoolPref("general.startup.browser", false), true, "getBoolPref");
is(getBoolPref("this.pref.doesnt.exist", true), true, "getBoolPref fallback");
is(getBoolPref("this.pref.doesnt.exist", false), false, "getBoolPref fallback #2");
gTestTab = openNewTabWith("http://example.com");
gBrowser.selectedTab = gTestTab;
gTestTab.linkedBrowser.addEventListener("load", function () {
gTestTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
is(gTestTab.linkedBrowser.currentURI.spec, "http://example.com/", "example.com loaded");
test_openUILink();
}, true);
}
function test_openUILink() {
gTestTab.linkedBrowser.addEventListener("load", function () {
gTestTab.linkedBrowser.removeEventListener("load", arguments.callee, true);
is(gTestTab.linkedBrowser.currentURI.spec, "http://example.org/", "example.org loaded");
gBrowser.removeTab(gTestTab);
finish();
}, true);
//openUILink(url, e, ignoreButton, ignoreAlt, allowKeywordFixup, postData, referrerUrl);
openUILink("http://example.org"); // defaults to "current"
}