tor-browser

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

browser_treeupdate_hidden.js (1048B)


      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/role.js */
      8 loadScripts({ name: "role.js", dir: MOCHITESTS_DIR });
      9 
     10 async function setHidden(browser, value) {
     11  let onReorder = waitForEvent(EVENT_REORDER, "container");
     12  await invokeSetAttribute(browser, "child", "hidden", value);
     13  await onReorder;
     14 }
     15 
     16 addAccessibleTask(
     17  '<div id="container"><input id="child"></div>',
     18  async function (browser, accDoc) {
     19    let container = findAccessibleChildByID(accDoc, "container");
     20 
     21    testAccessibleTree(container, { SECTION: [{ ENTRY: [] }] });
     22 
     23    // Set @hidden attribute
     24    await setHidden(browser, "true");
     25    testAccessibleTree(container, { SECTION: [] });
     26 
     27    // Remove @hidden attribute
     28    await setHidden(browser);
     29    testAccessibleTree(container, { SECTION: [{ ENTRY: [] }] });
     30  },
     31  { iframe: true, remoteIframe: true }
     32 );