request-cache-reload.any.js (1891B)
1 // META: global=window,worker 2 // META: title=Request cache - reload 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 "reload" mode does not check the cache for previously cached content and goes to the network regardless', 10 state: "stale", 11 request_cache: ["default", "reload"], 12 expected_validation_headers: [false, false], 13 expected_no_cache_headers: [false, true], 14 }, 15 { 16 name: 'RequestCache "reload" mode does not check the cache for previously cached content and goes to the network regardless', 17 state: "fresh", 18 request_cache: ["default", "reload"], 19 expected_validation_headers: [false, false], 20 expected_no_cache_headers: [false, true], 21 }, 22 { 23 name: 'RequestCache "reload" mode does store the response in the cache', 24 state: "stale", 25 request_cache: ["reload", "default"], 26 expected_validation_headers: [false, true], 27 expected_no_cache_headers: [true, false], 28 }, 29 { 30 name: 'RequestCache "reload" mode does store the response in the cache', 31 state: "fresh", 32 request_cache: ["reload", "default"], 33 expected_validation_headers: [false], 34 expected_no_cache_headers: [true], 35 }, 36 { 37 name: 'RequestCache "reload" mode does store the response in the cache even if a previous response is already stored', 38 state: "stale", 39 request_cache: ["default", "reload", "default"], 40 expected_validation_headers: [false, false, true], 41 expected_no_cache_headers: [false, true, false], 42 }, 43 { 44 name: 'RequestCache "reload" mode does store the response in the cache even if a previous response is already stored', 45 state: "fresh", 46 request_cache: ["default", "reload", "default"], 47 expected_validation_headers: [false, false], 48 expected_no_cache_headers: [false, true], 49 }, 50 ]; 51 run_tests(tests);