summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/tests/browser/browser_searchSettings.js
blob: 2cded38c9970f7dcf5f51d8c63cef9f809b579c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Any copyright is dedicated to the Public Domain.
   http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

add_task(async function () {
  await BrowserTestUtils.withNewTab(
    { gBrowser, url: "about:blank" },
    async function () {
      await UrlbarTestUtils.promiseAutocompleteResultPopup({
        window,
        value: "a",
      });

      // Since the current tab is blank the preferences pane will load there
      let loaded = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
      await UrlbarTestUtils.promisePopupClose(window, () => {
        let button = document.getElementById("urlbar-anon-search-settings");
        EventUtils.synthesizeMouseAtCenter(button, {});
      });
      await loaded;

      is(
        gBrowser.selectedBrowser.currentURI.spec,
        "about:preferences#search",
        "Should have loaded the right page"
      );
    }
  );
});