1 add_task(async function test() {
2 await BrowserTestUtils.withNewTab(
3 // eslint-disable-next-line @microsoft/sdl/no-insecure-url
4 { gBrowser, url: "http://example.com" },
5 async function (browser) {
6 let numLocationChanges = 0;
9 onLocationChange(browser, webProgress, request, uri) {
10 info("location change: " + (uri && uri.spec));
15 gBrowser.addTabsProgressListener(listener);
17 await SpecialPowers.spawn(browser, [], function () {
18 // pushState to a new URL (http://example.com/foo"). This should trigger
19 // exactly one LocationChange event.
20 content.history.pushState(null, null, "foo");
23 await Promise.resolve();
25 gBrowser.removeTabsProgressListener(listener);
29 "pushState should cause exactly one LocationChange event."