OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8" /> |
| 5 <title>resource timing information for cross-origin redirect</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 var crossOrigin = "localhost:8000"; |
| 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_equals(entry.redirectStart, 0, "redirectStart should be 0 i
n cross-origin redirect!"); |
| 24 test_equals(entry.redirectEnd, 0, "redirectEnd should be 0 in cr
oss-origin redirect!"); |
| 25 test_equals(entry.domainLookupStart, 0, "domainLookupStart shoul
d be 0 in cross-origin redirect!"); |
| 26 test_equals(entry.domainLookupEnd, 0, "domainLookupEnd should be
0 in cross-origin redirect!"); |
| 27 test_equals(entry.connectStart, 0, "connectStart should be 0 in
cross-origin redirect!"); |
| 28 test_equals(entry.connectEnd, 0, "connectEnd should be 0 in cros
s-origin redirect!"); |
| 29 test_equals(entry.requestStart, 0, "requestStart should be 0 in
cross-origin redirect!"); |
| 30 test_equals(entry.responseStart, 0, "responseStart should be 0 i
n cross-origin redirect!"); |
| 31 test_equals(entry.secureConnectionStart, 0, "secureConnectionSta
rt should be 0 in cross-origin redirect!"); |
| 32 test_greater_than(entry.fetchStart, 0, "fetchStart should be gre
ater than 0 in cross-origin redirect!"); |
| 33 test_greater_than(entry.responseEnd, 0, "responseEnd should be g
reater than 0 in cross-origin redirect!"); |
| 34 done(); |
| 35 } |
| 36 </script> |
| 37 |
| 38 </head> |
| 39 <body> |
| 40 <h1>Description</h1> |
| 41 <p>This test validates the values in resource timing for a cross-origin
redirect.</p> |
| 42 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></
iframe> |
| 43 <script> |
| 44 test_equals(document.location.host, pageOrigin, 'Starting document.l
ocation.hostname is correct (' + pageOrigin + ')'); |
| 45 |
| 46 var destUrl = 'http://' + pageOrigin + '/w3c/webperf/resources/redir
ect.php'; |
| 47 destUrl += '?location=http://' + crossOrigin + "/w3c/webperf/resourc
es/blank_page_green.htm"; |
| 48 |
| 49 var frameContext = document.getElementById("frameContext"); |
| 50 frameContext.onload = onload_test; |
| 51 frameContext.src = destUrl; |
| 52 </script> |
| 53 </body> |
| 54 </html> |
OLD | NEW |