no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / docshell / test / browser / browser_bug554155.js
blob223f6241de80730e55e3fb2cef36f8fcd95308e4
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;
8       let listener = {
9         onLocationChange(browser, webProgress, request, uri, flags) {
10           info("location change: " + (uri && uri.spec));
11           numLocationChanges++;
12         },
13       };
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");
21       });
23       await Promise.resolve();
25       gBrowser.removeTabsProgressListener(listener);
26       is(
27         numLocationChanges,
28         1,
29         "pushState should cause exactly one LocationChange event."
30       );
31     }
32   );
33 });