tor-browser

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

browser_initial_caching.js (2053B)


      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::InputType, no cache domain
      8 addAccessibleTask(
      9  `<input id="test" type="search"/>`,
     10  async function (browser, docAcc) {
     11    let acc = findAccessibleChildByID(docAcc, "test");
     12    await verifyAttributeCachedNoRetry(acc, "text-input-type");
     13  },
     14  {
     15    topLevel: true,
     16    iframe: true,
     17    remoteIframe: true,
     18    cacheDomains: CacheDomain.None,
     19  }
     20 );
     21 
     22 // CacheKey::MimeType, no cache domain
     23 addAccessibleTask(
     24  ``,
     25  async function (browser, docAcc) {
     26    await verifyAttributeCachedNoRetry(docAcc, "content-type");
     27  },
     28  {
     29    topLevel: true,
     30    iframe: true,
     31    remoteIframe: true,
     32    cacheDomains: CacheDomain.None,
     33  }
     34 );
     35 
     36 // CacheKey::PopupType, no cache domain
     37 addAccessibleTask(
     38  `<div popover id="test">test</div>`,
     39  async function (browser, _) {
     40    info("Showing popover");
     41    let shown = waitForEvent(EVENT_SHOW, "test");
     42    await invokeContentTask(browser, [], () => {
     43      content.document.getElementById("test").showPopover();
     44    });
     45    let popover = (await shown).accessible;
     46    await verifyAttributeCachedNoRetry(popover, "ispopup");
     47  },
     48  {
     49    topLevel: true,
     50    iframe: true,
     51    remoteIframe: true,
     52    cacheDomains: CacheDomain.None,
     53  }
     54 );
     55 
     56 // CacheKey::TagName, no cache domain
     57 addAccessibleTask(
     58  ``,
     59  async function (browser, docAcc) {
     60    await verifyAttributeCachedNoRetry(docAcc, "tag");
     61  },
     62  {
     63    topLevel: true,
     64    iframe: true,
     65    remoteIframe: true,
     66    cacheDomains: CacheDomain.None,
     67  }
     68 );
     69 
     70 // CacheKey::ARIARole, no cache domain
     71 addAccessibleTask(
     72  `<div id="test" role="invalid-role">test</div>`,
     73  async function (browser, docAcc) {
     74    let acc = findAccessibleChildByID(docAcc, "test");
     75    await verifyAttributeCachedNoRetry(acc, "role");
     76  },
     77  {
     78    topLevel: true,
     79    iframe: true,
     80    remoteIframe: true,
     81    cacheDomains: CacheDomain.None,
     82  }
     83 );