mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
31 lines
790 B
JavaScript
31 lines
790 B
JavaScript
function test() {
|
|
waitForExplicitFinish();
|
|
|
|
let tab = gBrowser.addTab("http://example.com");
|
|
|
|
tab.linkedBrowser.addEventListener('load', function() {
|
|
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);
|
|
}
|