nextHopProtocol-is-tao-protected.https.html (1810B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>Resource Timing - Check that nextHopProtocol is TAO protected</title> 6 <link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 <script src="/common/custom-cors-response.js"></script> 10 <script src="/common/get-host-info.sub.js"></script> 11 <script src="resources/entry-invariants.js"></script> 12 <script src="resources/resource-loaders.js"></script> 13 <script src="resources/tao-response.js"></script> 14 </head> 15 <body> 16 <script> 17 18 const {HTTPS_REMOTE_ORIGIN} = get_host_info(); 19 20 const tao_protected_next_hop_test = (loader, item) => { 21 attribute_test( 22 loader, custom_cors_response({}, HTTPS_REMOTE_ORIGIN), 23 entry => assert_equals(entry.nextHopProtocol, "", 24 "nextHopProtocol should be the empty string."), 25 `Fetch TAO-less ${item} from remote origin. Make sure nextHopProtocol ` + 26 "is the empty string." 27 ); 28 29 attribute_test( 30 loader, remote_tao_response('*'), 31 entry => assert_not_equals(entry.nextHopProtocol, "", 32 "nextHopProtocol should not be the empty string."), 33 `Fetch TAO'd ${item} from remote origin. Make sure nextHopProtocol ` + 34 "is not the empty string." 35 ); 36 } 37 38 tao_protected_next_hop_test(load.font, "font"); 39 tao_protected_next_hop_test(load.iframe, "iframe"); 40 tao_protected_next_hop_test(load.image, "image"); 41 tao_protected_next_hop_test(path => load.object(path, "text/plain"), "object"); 42 tao_protected_next_hop_test(load.script, "script"); 43 tao_protected_next_hop_test(load.stylesheet, "stylesheet"); 44 tao_protected_next_hop_test(load.xhr_sync, "synchronous xhr"); 45 tao_protected_next_hop_test(load.xhr_async, "asynchronous xhr"); 46 47 </script> 48 </body> 49 </html>