diff -r 000000000000 -r 6474c204b198 docshell/test/browser/browser_bug554155.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docshell/test/browser/browser_bug554155.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,32 @@ +function test() { + waitForExplicitFinish(); + + let tab = gBrowser.addTab("http://example.com"); + + tab.linkedBrowser.addEventListener("load", function() { + tab.linkedBrowser.removeEventListener("load", arguments.callee, true); + + let numLocationChanges = 0; + + let listener = { + onLocationChange: function() { + numLocationChanges++; + } + }; + + gBrowser.addTabsProgressListener(listener); + + // pushState to a new URL (http://example.com/foo"). This should trigger + // exactly one LocationChange event. + tab.linkedBrowser.contentWindow.history.pushState(null, null, "foo"); + + executeSoon(function() { + gBrowser.removeTab(tab); + gBrowser.removeTabsProgressListener(listener); + is(numLocationChanges, 1, + "pushState should cause exactly one LocationChange event."); + finish(); + }); + + }, true); +}