no-report-on-unexpired-cached-response.https.html (1113B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title> 5 Test that NEL reports are not sent for cached responses that don't hit the 6 network 7 </title> 8 <script src='/resources/testharness.js'></script> 9 <script src='/resources/testharnessreport.js'></script> 10 <script src='./support/nel.sub.js'></script> 11 </head> 12 <body> 13 <script> 14 nel_test(async t => { 15 // Fetch a resource that can be cached without validation. Do this 16 // *before* fetching the NEL policy for this origin, to ensure that we 17 // don't generate any report about this request. 18 await fetchCachedResource(); 19 // Fetch the NEL policy for this origin. 20 await fetchResourceWithBasicPolicy(); 21 // Fetch the now-cached resource again. This should not generate a new 22 // network request. 23 await fetchCachedResource(); 24 // Because the cached request did not generate a network request, we 25 // should never receive a report about the request. 26 assert_false(await reportExists({ 27 url: getURLForCachedResource(), 28 type: "network-error", 29 })); 30 }); 31 </script> 32 </body> 33 </html>