tor-browser

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

browser_rich_listbox.js (2203B)


      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 /* import-globals-from ../../mochitest/attributes.js */
      8 loadScripts({ name: "attributes.js", dir: MOCHITESTS_DIR });
      9 
     10 addAccessibleTask(
     11  "mac/doc_rich_listbox.xhtml",
     12  async (browser, accDoc) => {
     13    const categories = getNativeInterface(accDoc, "categories");
     14    const categoriesChildren = categories.getAttributeValue("AXChildren");
     15    is(categoriesChildren.length, 4, "Found listbox and 4 items");
     16 
     17    const general = getNativeInterface(accDoc, "general");
     18    is(
     19      general.getAttributeValue("AXTitle"),
     20      "general",
     21      "general has appropriate title"
     22    );
     23    is(
     24      categoriesChildren[0].getAttributeValue("AXTitle"),
     25      general.getAttributeValue("AXTitle"),
     26      "Found general listitem"
     27    );
     28    is(
     29      general.getAttributeValue("AXEnabled"),
     30      1,
     31      "general is enabled, not dimmed"
     32    );
     33 
     34    const home = getNativeInterface(accDoc, "home");
     35    is(home.getAttributeValue("AXTitle"), "home", "home has appropriate title");
     36    is(
     37      categoriesChildren[1].getAttributeValue("AXTitle"),
     38      home.getAttributeValue("AXTitle"),
     39      "Found home listitem"
     40    );
     41    is(home.getAttributeValue("AXEnabled"), 1, "Home is enabled, not dimmed");
     42 
     43    const search = getNativeInterface(accDoc, "search");
     44    is(
     45      search.getAttributeValue("AXTitle"),
     46      "search",
     47      "search has appropriate title"
     48    );
     49    is(
     50      categoriesChildren[2].getAttributeValue("AXTitle"),
     51      search.getAttributeValue("AXTitle"),
     52      "Found search listitem"
     53    );
     54    is(
     55      search.getAttributeValue("AXEnabled"),
     56      1,
     57      "search is enabled, not dimmed"
     58    );
     59 
     60    const privacy = getNativeInterface(accDoc, "privacy");
     61    is(
     62      privacy.getAttributeValue("AXTitle"),
     63      "privacy",
     64      "privacy has appropriate title"
     65    );
     66    is(
     67      categoriesChildren[3].getAttributeValue("AXTitle"),
     68      privacy.getAttributeValue("AXTitle"),
     69      "Found privacy listitem"
     70    );
     71  },
     72  { topLevel: false, chrome: true }
     73 );