tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

browser_test_urlbar.js (1407B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const { UrlbarTestUtils } = ChromeUtils.importESModule(
      8  "resource://testing-common/UrlbarTestUtils.sys.mjs"
      9 );
     10 
     11 // Checking that the awesomebar popup gets COMBOBOX_LIST role instead of
     12 // LISTBOX, since its parent is a <panel> (see Bug 1422465)
     13 add_task(async function testAutocompleteRichResult() {
     14  let tab = await openNewTab("data:text/html;charset=utf-8,");
     15  let accService = await initAccessibilityService();
     16 
     17  info("Opening the URL bar and entering a key to show the urlbar panel");
     18  await UrlbarTestUtils.promiseAutocompleteResultPopup({
     19    window,
     20    waitForFocus,
     21    value: "a",
     22  });
     23 
     24  info("Waiting for accessibility to be created for the results list");
     25  let resultsView;
     26  resultsView = gURLBar.view.panel.querySelector(".urlbarView-results");
     27  await TestUtils.waitForCondition(() =>
     28    accService.getAccessibleFor(resultsView)
     29  );
     30 
     31  info("Confirming that the special case is handled in XULListboxAccessible");
     32  let accessible = accService.getAccessibleFor(resultsView);
     33  is(accessible.role, ROLE_COMBOBOX_LIST, "Right role");
     34 
     35  BrowserTestUtils.removeTab(tab);
     36 });
     37 
     38 registerCleanupFunction(async function () {
     39  await shutdownAccessibilityService();
     40 });