tor-browser

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

request-cache-default.any.js (1400B)


      1 // META: global=window,worker
      2 // META: title=Request cache - default
      3 // META: script=/common/utils.js
      4 // META: script=/common/get-host-info.sub.js
      5 // META: script=request-cache.js
      6 
      7 var tests = [
      8  {
      9    name: 'RequestCache "default" mode checks the cache for previously cached content and goes to the network for stale responses',
     10    state: "stale",
     11    request_cache: ["default", "default"],
     12    expected_validation_headers: [false, true],
     13    expected_no_cache_headers: [false, false],
     14  },
     15  {
     16    name: 'RequestCache "default" mode checks the cache for previously cached content and avoids going to the network if a fresh response exists',
     17    state: "fresh",
     18    request_cache: ["default", "default"],
     19    expected_validation_headers: [false],
     20    expected_no_cache_headers: [false],
     21  },
     22  {
     23    name: 'Responses with the "Cache-Control: no-store" header are not stored in the cache',
     24    state: "stale",
     25    cache_control: "no-store",
     26    request_cache: ["default", "default"],
     27    expected_validation_headers: [false, false],
     28    expected_no_cache_headers: [false, false],
     29  },
     30  {
     31    name: 'Responses with the "Cache-Control: no-store" header are not stored in the cache',
     32    state: "fresh",
     33    cache_control: "no-store",
     34    request_cache: ["default", "default"],
     35    expected_validation_headers: [false, false],
     36    expected_no_cache_headers: [false, false],
     37  },
     38 ];
     39 run_tests(tests);