browser/base/content/test/general/browser_bug562649.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/test/general/browser_bug562649.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +function test() {
     1.5 +  const URI = "data:text/plain,bug562649";
     1.6 +  browserDOMWindow.openURI(makeURI(URI),
     1.7 +                           null,
     1.8 +                           Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
     1.9 +                           Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
    1.10 +
    1.11 +  ok(XULBrowserWindow.isBusy, "window is busy loading a page");
    1.12 +  is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI");
    1.13 +  is(gURLBar.value, URI, "location bar value matches test URI");
    1.14 +
    1.15 +  gBrowser.selectedTab = gBrowser.addTab();
    1.16 +  gBrowser.removeCurrentTab();
    1.17 +  is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI after switching tabs");
    1.18 +  is(gURLBar.value, URI, "location bar value matches test URI after switching tabs");
    1.19 +
    1.20 +  waitForExplicitFinish();
    1.21 +  gBrowser.selectedBrowser.addEventListener("load", function () {
    1.22 +    gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    1.23 +
    1.24 +    is(gBrowser.userTypedValue, null, "userTypedValue is null as the page has loaded");
    1.25 +    is(gURLBar.value, URI, "location bar value matches test URI as the page has loaded");
    1.26 +
    1.27 +    gBrowser.removeCurrentTab();
    1.28 +    finish();
    1.29 +  }, true);
    1.30 +}

mercurial