tor-browser

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

head.js (997B)


      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 /* exported testChildrenIds */
      8 
      9 // Load the shared-head file first.
     10 Services.scriptloader.loadSubScript(
     11  "chrome://mochitests/content/browser/accessible/tests/browser/shared-head.js",
     12  this
     13 );
     14 
     15 // Loading and common.js from accessible/tests/mochitest/ for all tests, as
     16 // well as promisified-events.js.
     17 loadScripts(
     18  { name: "common.js", dir: MOCHITESTS_DIR },
     19  { name: "promisified-events.js", dir: MOCHITESTS_DIR }
     20 );
     21 
     22 /*
     23 * A test function for comparing the IDs of an accessible's children
     24 * with an expected array of IDs.
     25 */
     26 function testChildrenIds(acc, expectedIds) {
     27  let ids = arrayFromChildren(acc).map(child => getAccessibleDOMNodeID(child));
     28  Assert.deepEqual(
     29    ids,
     30    expectedIds,
     31    `Children for ${getAccessibleDOMNodeID(acc)} are wrong.`
     32  );
     33 }