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