test-timing-server-redirect.html (2268B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>window.performance.timing.redirect attributes on a same-origin server redirected navigation</title> 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 7 <link rel="help" href="http://www.w3.org/TR/navigation-timing/#sec-navigation-timing-interface"/> 8 <script src="/resources/testharness.js"></script> 9 <script src="/resources/testharnessreport.js"></script> 10 <script src="/common/performance-timeline-utils.js"></script> 11 <script src="resources/webperftestharness.js"></script> 12 13 <script> 14 function onload_test() 15 { 16 test_namespace('navigation'); 17 if (performanceNamespace === undefined) 18 { 19 // avoid script errors 20 done(); 21 return; 22 } 23 24 performanceNamespace = document.getElementById("frameContext").contentWindow.performance; 25 test_equals(performanceNamespace.navigation.type, 26 performanceNamespace.navigation.TYPE_NAVIGATE, 27 'timing.navigation.type is TYPE_NAVIGATE'); 28 test_equals(performanceNamespace.navigation.redirectCount, 1, 'navigation.redirectCount == 1 on an server redirected navigation'); 29 30 test_timing_greater_than('navigationStart', 0); 31 32 test_timing_order('redirectStart', 'navigationStart'); 33 test_timing_order('redirectEnd', 'redirectStart'); 34 test_timing_order('fetchStart', 'redirectEnd'); 35 test_timing_order('requestStart', 'fetchStart'); 36 } 37 </script> 38 39 </head> 40 <body> 41 <h1>Description</h1> 42 <p>This test validates the values of the window.performance.redirectCount and the 43 window.performance.timing.redirectStart/End times for a same-origin server side redirect navigation.</p> 44 45 <div id="log"></div> 46 <br /> 47 <iframe id="frameContext" onload="onload_test();" src="/common/redirect.py?location=/navigation-timing/resources/blank_page_green.html" style="width: 250px; height: 250px;"></iframe> 48 </body> 49 </html>