tor-browser

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

browser_value_domain.js (3202B)


      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 // CacheKey::MaxValue, CacheDomain::Value
      8 addAccessibleTask(
      9  `<input id="test" type="range" min="0" max="100" value="50"/>`,
     10  async function (browser, docAcc) {
     11    let acc = findAccessibleChildByID(docAcc, "test", [nsIAccessibleValue]);
     12    await testAttributeCachePresence(acc, "max", () => {
     13      acc.maximumValue;
     14    });
     15  },
     16  {
     17    topLevel: true,
     18    iframe: true,
     19    remoteIframe: true,
     20    cacheDomains: CacheDomain.None,
     21  }
     22 );
     23 
     24 // CacheKey::MinValue, CacheDomain::Value
     25 addAccessibleTask(
     26  `<input id="test" type="range" min="0" max="100" value="50"/>`,
     27  async function (browser, docAcc) {
     28    let acc = findAccessibleChildByID(docAcc, "test", [nsIAccessibleValue]);
     29    await testAttributeCachePresence(acc, "min", () => {
     30      acc.minimumValue;
     31    });
     32  },
     33  {
     34    topLevel: true,
     35    iframe: true,
     36    remoteIframe: true,
     37    cacheDomains: CacheDomain.None,
     38  }
     39 );
     40 
     41 // CacheKey::NumericValue, CacheDomain::Value
     42 addAccessibleTask(
     43  `<input id="test" type="range" min="0" max="100" value="50"/>`,
     44  async function (browser, docAcc) {
     45    let acc = findAccessibleChildByID(docAcc, "test", [nsIAccessibleValue]);
     46    await testAttributeCachePresence(acc, "value", () => {
     47      acc.currentValue;
     48    });
     49  },
     50  {
     51    topLevel: true,
     52    iframe: true,
     53    remoteIframe: true,
     54    cacheDomains: CacheDomain.None,
     55  }
     56 );
     57 
     58 // CacheKey::SrcURL, CacheDomain::Value
     59 addAccessibleTask(
     60  `<img id="test" src="image.jpg"/>`,
     61  async function (browser, docAcc) {
     62    let acc = findAccessibleChildByID(docAcc, "test");
     63    await testAttributeCachePresence(acc, "src", () => {
     64      acc.attributes;
     65    });
     66  },
     67  {
     68    topLevel: true,
     69    iframe: true,
     70    remoteIframe: true,
     71    cacheDomains: CacheDomain.None,
     72  }
     73 );
     74 
     75 // CacheKey::Step, CacheDomain::Value
     76 addAccessibleTask(
     77  `<input id="test" type="range" min="0" max="100" value="50"/>`,
     78  async function (browser, docAcc) {
     79    let acc = findAccessibleChildByID(docAcc, "test", [nsIAccessibleValue]);
     80    await testAttributeCachePresence(acc, "step", () => {
     81      acc.minimumIncrement;
     82    });
     83  },
     84  {
     85    topLevel: true,
     86    iframe: true,
     87    remoteIframe: true,
     88    cacheDomains: CacheDomain.None,
     89  }
     90 );
     91 
     92 // CacheKey::TextValue, CacheDomain::Value
     93 addAccessibleTask(
     94  `<div id="test" role="slider" aria-valuetext="value"></div>`,
     95  async function (browser, docAcc) {
     96    let acc = findAccessibleChildByID(docAcc, "test");
     97    await testAttributeCachePresence(acc, "valuetext", () => {
     98      acc.value;
     99    });
    100  },
    101  {
    102    topLevel: true,
    103    iframe: true,
    104    remoteIframe: true,
    105    cacheDomains: CacheDomain.None,
    106  }
    107 );
    108 
    109 // CacheKey::ValueRegion, CacheDomain::Value
    110 addAccessibleTask(
    111  `<meter id="test"/>`,
    112  async function (browser, docAcc) {
    113    let acc = findAccessibleChildByID(docAcc, "test");
    114    await testAttributeCachePresence(acc, "valuetype", () => {
    115      acc.value;
    116    });
    117  },
    118  {
    119    topLevel: true,
    120    iframe: true,
    121    remoteIframe: true,
    122    cacheDomains: CacheDomain.None,
    123  }
    124 );