OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8" /> |
| 5 <title>Navigation Timing 2 WPT</title> |
| 6 <link rel="author" title="Google" href="http://www.google.com/" /> |
| 7 <link rel="help" href="http://www.w3.org/TR/navigation-timing-2/#sec-Per
formanceNavigationTiming"/> |
| 8 <script src="/resources/testharness.js"></script> |
| 9 <script src="/resources/testharnessreport.js"></script> |
| 10 <script src="/common/utils.js"></script> |
| 11 <script> |
| 12 |
| 13 function onload_test() |
| 14 { |
| 15 var performanceNamespace = document.getElementById("frameContext
").contentWindow.performance; |
| 16 assert_equals(performanceNamespace.getEntriesByType("navigation"
)[0].type, |
| 17 "navigate", |
| 18 "Expected navigation type to be navigate."); |
| 19 assert_equals(performanceNamespace.getEntriesByType("navigation"
)[0].redirectCount, 0, |
| 20 "Expected redirectCount to be 0."); |
| 21 assert_equals(performanceNamespace.getEntriesByType("navigation"
)[0].redirectStart, 0, |
| 22 "Expected redirectStart to be 0."); |
| 23 assert_equals(performanceNamespace.getEntriesByType("navigation"
)[0].redirectEnd, 0, |
| 24 "Expected redirectEnd to be 0."); |
| 25 |
| 26 done(); |
| 27 } |
| 28 </script> |
| 29 |
| 30 </head> |
| 31 <body> |
| 32 <h1>Description</h1> |
| 33 <p>This test validates the values of the window.performance.getEntriesBy
Type("navigation")[0].redirectCount and the |
| 34 window.performance.getEntriesByType("navigation")[0].redirectStart/En
d times for a cross-origin server side redirect navigation.</p> |
| 35 |
| 36 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></
iframe> |
| 37 <script> |
| 38 // combine the page origin and redirect origin into the IFRAME's src
URL |
| 39 var destUrl = make_absolute_url({subdomain: "www", |
| 40 path: "/common/redirect.py", |
| 41 query: "location=" + make_absolute_
url( |
| 42 {path: "/navigation-tim
ing/resources/blank_page_green.html"}) |
| 43 }); |
| 44 var frameContext = document.getElementById("frameContext"); |
| 45 frameContext.onload = onload_test; |
| 46 frameContext.src = destUrl; |
| 47 </script> |
| 48 </body> |
| 49 </html> |
OLD | NEW |