redirects.html (2395B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>Resource Timing: resources fetched through same-origin redirects</title> 6 <link rel="author" title="Google" href="http://www.google.com/" /> 7 <link rel="help" href="https://www.w3.org/TR/resource-timing-2/#sec-performanceresourcetiming"/> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/common/get-host-info.sub.js"></script> 11 <script src="resources/resource-loaders.js"></script> 12 <script src="resources/entry-invariants.js"></script> 13 <script> 14 const {HTTPS_NOTSAMESITE_ORIGIN} = get_host_info(); 15 const redirect_url = `/common/redirect.py`; 16 const url_prefix = `${redirect_url}?location=/resource-timing/resources/`; 17 const https_url_prefix = `${redirect_url}?location=${HTTPS_NOTSAMESITE_ORIGIN}/resource-timing/resources/`; 18 19 attribute_test( 20 load.stylesheet, url_prefix + "resource_timing_test0.css", 21 invariants.assert_same_origin_redirected_resource, 22 "Verify attributes of a redirected stylesheet's PerformanceResourceTiming"); 23 24 attribute_test( 25 load.image, url_prefix + "blue.png", 26 invariants.assert_same_origin_redirected_resource, 27 "Verify attributes of a redirected image's PerformanceResourceTiming"); 28 29 attribute_test( 30 load.iframe, url_prefix + "green.html", 31 invariants.assert_same_origin_redirected_resource, 32 "Verify attributes of a redirected iframe's PerformanceResourceTiming"); 33 34 attribute_test( 35 load.script, url_prefix + "empty_script.js", 36 invariants.assert_same_origin_redirected_resource, 37 "Verify attributes of a redirected script's PerformanceResourceTiming"); 38 39 attribute_test( 40 load.xhr_sync, url_prefix + "green.html?id=xhr", 41 invariants.assert_same_origin_redirected_resource, 42 "Verify attributes of a redirected synchronous XMLHttpRequest's " + 43 "PerformanceResourceTiming"); 44 45 attribute_test( 46 load.xhr_sync, https_url_prefix + "green.html?id=xhr", 47 invariants.assert_cross_origin_redirected_resource, 48 "Verify attributes of a synchronous XMLHttpRequest's " + 49 "PerformanceResourceTiming where the initial HTTP request is redirected " + 50 "to a cross-origin HTTPS resource." 51 ); 52 53 </script> 54 </head> 55 <body> 56 <h1>Description</h1> 57 <p>This test validates that, when a fetching resources that encounter 58 same-origin redirects, attributes of the PerformanceResourceTiming entry 59 conform to the specification.</p> 60 </body> 61 </html>