2010-05-02 01:31:07 -07:00
|
|
|
function test() {
|
|
|
|
waitForExplicitFinish();
|
|
|
|
|
|
|
|
let tab = gBrowser.addTab("http://example.com");
|
|
|
|
|
2011-06-07 07:45:26 -07:00
|
|
|
tab.linkedBrowser.addEventListener("load", function() {
|
|
|
|
tab.linkedBrowser.removeEventListener("load", arguments.callee, true);
|
|
|
|
|
2010-05-02 01:31:07 -07:00
|
|
|
let numLocationChanges = 0;
|
|
|
|
|
|
|
|
let listener = {
|
|
|
|
onLocationChange: function() {
|
|
|
|
numLocationChanges++;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-06-11 22:43:58 -07:00
|
|
|
gBrowser.addTabsProgressListener(listener);
|
2010-05-02 01:31:07 -07:00
|
|
|
|
|
|
|
// 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() {
|
2010-06-11 22:43:58 -07:00
|
|
|
gBrowser.removeTab(tab);
|
|
|
|
gBrowser.removeTabsProgressListener(listener);
|
2010-05-02 01:31:07 -07:00
|
|
|
is(numLocationChanges, 1,
|
|
|
|
"pushState should cause exactly one LocationChange event.");
|
|
|
|
finish();
|
|
|
|
});
|
|
|
|
|
|
|
|
}, true);
|
|
|
|
}
|