gecko-dev/browser/base/content/test/urlbar/browser_bug562649.js
Mark Banner 427e3b23dc Bug 1342459 - Fix various no-undef issues in browser/base. r=mossop
MozReview-Commit-ID: CRYxu7copKb

--HG--
extra : rebase_source : bc176c5e6890ffc6a4e26cb9bc9d441d9486ce7b
2017-04-04 13:42:33 +01:00

24 lines
1 KiB
JavaScript

function test() {
const URI = "data:text/plain,bug562649";
window.browserDOMWindow.openURI(makeURI(URI),
null,
Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI");
is(gURLBar.value, URI, "location bar value matches test URI");
gBrowser.selectedTab = gBrowser.addTab();
gBrowser.removeCurrentTab({ skipPermitUnload: true });
is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI after switching tabs");
is(gURLBar.value, URI, "location bar value matches test URI after switching tabs");
waitForExplicitFinish();
BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser).then(() => {
is(gBrowser.userTypedValue, null, "userTypedValue is null as the page has loaded");
is(gURLBar.value, URI, "location bar value matches test URI as the page has loaded");
gBrowser.removeCurrentTab({ skipPermitUnload: true });
finish();
});
}