tor-browser

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

browser_prune_children.js (1003B)


      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 /**
      8 * Test pruning of children from meter.
      9 */
     10 addAccessibleTask(
     11  `
     12 <div id="meter"
     13     role="meter"
     14     aria-valuemin="0"
     15     aria-valuemax="100"
     16     aria-valuenow="33"
     17     aria-valuetext="33% (Prepared)">
     18  <span>Prepared</span>
     19  <span>Shipped</span>
     20  <span>Delivered</span>
     21 </div>
     22  `,
     23  async function testPruneChildren() {
     24    const meterChildCount = await runPython(`
     25      global meter
     26      doc = getDoc()
     27      meter = findByDomId(doc, "meter")
     28      return meter.childCount
     29    `);
     30    is(meterChildCount, 0, "Meter is pruned");
     31 
     32    const hasTextIface = await runPython(`
     33      try:
     34        findByDomId(doc, "meter").queryText()
     35      except:
     36        return False
     37 
     38      return True
     39    `);
     40    ok(!hasTextIface, "Meter should not have text interface");
     41  }
     42 );