OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8" /> |
| 5 <title>redirectStart and redirectEnd information in same-origin redirect
resource timing</title> |
| 6 <link rel="author" title="Intel" href="http://www.intel.com/" /> |
| 7 <link rel="help" href="http://www.w3.org/TR/resource-timing/#performance
resourcetiming"/> |
| 8 <script src="/w3c/resources/testharness.js"></script> |
| 9 <script src="/w3c/resources/testharnessreport.js"></script> |
| 10 <script src="/w3c/webperf/resources/webperftestharness.js"></script> |
| 11 <script src="/w3c/webperf/resources/webperftestharnessextension.js"></sc
ript> |
| 12 |
| 13 <script> |
| 14 |
| 15 setup({explicit_done: true}); |
| 16 var pageOrigin = "127.0.0.1:8000"; |
| 17 |
| 18 function onload_test() |
| 19 { |
| 20 var context = new PerformanceContext(performance); |
| 21 var entry = context.getEntriesByName(document.getElementById("fr
ameContext").src, "resource")[0]; |
| 22 |
| 23 test_greater_than(entry.redirectStart, 0, "redirectStart should
be greater than 0 in same-origin redirect!"); |
| 24 test_equals(entry.redirectStart, entry.startTime, "redirectStart
should be equal to startTime in same-origin redirect!"); |
| 25 test_noless_than(entry.redirectEnd, entry.redirectStart, "redire
ctEnd should be no less than redirectStart in same-origin redirect!"); |
| 26 test_noless_than(entry.fetchStart, entry.redirectEnd, "fetchStar
t should be no less than redirectEnd in same-origin redirect!"); |
| 27 done(); |
| 28 } |
| 29 </script> |
| 30 |
| 31 </head> |
| 32 <body> |
| 33 <h1>Description</h1> |
| 34 <p>This test validates the values of the redirectStart/End in resource t
iming for a same-origin resource redirect.</p> |
| 35 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></
iframe> |
| 36 <script> |
| 37 test_equals(document.location.host, pageOrigin, 'Starting document.l
ocation.hostname is correct (' + pageOrigin + ')'); |
| 38 |
| 39 var destUrl = 'http://' + pageOrigin + '/w3c/webperf/resources/redir
ect.php'; |
| 40 destUrl += '?location=http://' + pageOrigin + "/w3c/webperf/resource
s/blank_page_green.htm"; |
| 41 |
| 42 var frameContext = document.getElementById("frameContext"); |
| 43 frameContext.onload = onload_test; |
| 44 frameContext.src = destUrl; |
| 45 </script> |
| 46 </body> |
| 47 </html> |
OLD | NEW |