OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE HTML> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8" /> |
| 5 <title>resource timing information for timing allowed cross-origin redir
ect chain</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 setup({explicit_done: true}); |
| 15 setup({timeout: 30000}); |
| 16 test_namespace(); |
| 17 var pageOrigin = "127.0.0.1:8000"; |
| 18 var crossOrigin = "localhost:8000"; |
| 19 |
| 20 function onload_test() |
| 21 { |
| 22 var context = new PerformanceContext(performance); |
| 23 var entry = context.getEntriesByName(document.getElementById("fr
ameContext").src, "resource")[0]; |
| 24 |
| 25 test_greater_than(entry.redirectStart, 0, "redirectStart should
be greater than 0 in timing allowed cross-origin redirect! "); |
| 26 test_equals(entry.redirectStart, entry.startTime, "redirectStart
should be equal to startTime in timing allowed cross-origin redirect!"); |
| 27 test_greater_or_equals(entry.redirectEnd, entry.redirectStart +
3000, "redirectEnd should be 3 secs later than redirectStart"); |
| 28 test_greater_or_equals(entry.fetchStart, entry.redirectEnd, "fet
chStart should be no less than redirectEnd in timing allowed cross-origin redire
ct!"); |
| 29 done(); |
| 30 } |
| 31 </script> |
| 32 |
| 33 </head> |
| 34 <body> |
| 35 <h1>Description</h1> |
| 36 <p>This test validates the values in resource timing for a timing allowe
d cross-origin redirect chain.</p> |
| 37 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></
iframe> |
| 38 <script> |
| 39 test_equals(document.location.host, pageOrigin, 'Starting document.l
ocation.hostname is correct (' + pageOrigin + ')'); |
| 40 |
| 41 var destUrl = 'http://' + crossOrigin + '/w3c/webperf/resources/mult
i_redirect.php?'; |
| 42 destUrl += 'pageOrigin=' + 'http://' + pageOrigin; |
| 43 destUrl += '&crossOrigin=' + 'http://' + crossOrigin; |
| 44 destUrl += '&timingAllow=1'; |
| 45 var frameContext = document.getElementById("frameContext"); |
| 46 frameContext.onload = onload_test; |
| 47 frameContext.src = destUrl; |
| 48 </script> |
| 49 <div id="log"></div> |
| 50 </body> |
| 51 </html> |
OLD | NEW |