docshell/test/browser/browser_bug554155.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   waitForExplicitFinish();
     4   let tab = gBrowser.addTab("http://example.com");
     6   tab.linkedBrowser.addEventListener("load", function() {
     7     tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
     9     let numLocationChanges = 0;
    11     let listener = {
    12       onLocationChange: function() {
    13         numLocationChanges++;
    14       }
    15     };
    17     gBrowser.addTabsProgressListener(listener);
    19     // pushState to a new URL (http://example.com/foo").  This should trigger
    20     // exactly one LocationChange event.
    21     tab.linkedBrowser.contentWindow.history.pushState(null, null, "foo");
    23     executeSoon(function() {
    24       gBrowser.removeTab(tab);
    25       gBrowser.removeTabsProgressListener(listener);
    26       is(numLocationChanges, 1,
    27          "pushState should cause exactly one LocationChange event.");
    28       finish();
    29     });
    31   }, true);
    32 }

mercurial