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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 function test() {
     2   const URI = "data:text/plain,bug562649";
     3   browserDOMWindow.openURI(makeURI(URI),
     4                            null,
     5                            Ci.nsIBrowserDOMWindow.OPEN_NEWTAB,
     6                            Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
     8   ok(XULBrowserWindow.isBusy, "window is busy loading a page");
     9   is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI");
    10   is(gURLBar.value, URI, "location bar value matches test URI");
    12   gBrowser.selectedTab = gBrowser.addTab();
    13   gBrowser.removeCurrentTab();
    14   is(gBrowser.userTypedValue, URI, "userTypedValue matches test URI after switching tabs");
    15   is(gURLBar.value, URI, "location bar value matches test URI after switching tabs");
    17   waitForExplicitFinish();
    18   gBrowser.selectedBrowser.addEventListener("load", function () {
    19     gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
    21     is(gBrowser.userTypedValue, null, "userTypedValue is null as the page has loaded");
    22     is(gURLBar.value, URI, "location bar value matches test URI as the page has loaded");
    24     gBrowser.removeCurrentTab();
    25     finish();
    26   }, true);
    27 }

mercurial