docshell/test/browser/browser_bug554155.js

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:44fdd9454960
1 function test() {
2 waitForExplicitFinish();
3
4 let tab = gBrowser.addTab("http://example.com");
5
6 tab.linkedBrowser.addEventListener("load", function() {
7 tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
8
9 let numLocationChanges = 0;
10
11 let listener = {
12 onLocationChange: function() {
13 numLocationChanges++;
14 }
15 };
16
17 gBrowser.addTabsProgressListener(listener);
18
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");
22
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 });
30
31 }, true);
32 }

mercurial