OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <meta charset="utf-8" /> |
| 5 <title>window.performance.timing.redirect attributes on a cross-origin s
erver 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-navig
ation-timing-interface"/> |
| 8 <script src="/resources/testharness.js"></script> |
| 9 <script src="/resources/testharnessreport.js"></script> |
| 10 <script src="resources/webperftestharness.js"></script> |
| 11 <script src="/common/utils.js"></script> |
| 12 <script> |
| 13 setup({explicit_done: true}); |
| 14 |
| 15 // |
| 16 // Test configuration |
| 17 // |
| 18 |
| 19 var subdomain = "www"; |
| 20 |
| 21 // |
| 22 // Tests |
| 23 // |
| 24 function onload_test() |
| 25 { |
| 26 test_namespace('navigation'); |
| 27 if (performanceNamespace === undefined) |
| 28 { |
| 29 // avoid script errors |
| 30 done(); |
| 31 return; |
| 32 } |
| 33 |
| 34 performanceNamespace = document.getElementById("frameContext").c
ontentWindow.performance; |
| 35 test_equals(performanceNamespace.navigation.type, |
| 36 performanceNamespace.navigation.TYPE_NAVIGATE, |
| 37 'timing.navigation.type is TYPE_NAVIGATE',{help:"http://
www.w3.org/TR/navigation-timing/#sec-navigation-info-interface"}); |
| 38 test_equals(performanceNamespace.navigation.redirectCount, 0, 'n
avigation.redirectCount == 0 on a cross-origin server redirected navigation', {h
elp:"http://www.w3.org/TR/navigation-timing/#sec-navigation-info-interface"}); |
| 39 |
| 40 test_timing_greater_than('navigationStart', 0); |
| 41 |
| 42 test_equals(performanceNamespace.timing.redirectStart, 0, 'timin
g.redirectStart == 0 on a server redirected navigation from another domain'); |
| 43 test_equals(performanceNamespace.timing.redirectEnd, 0, 'timing.
redirectEnd == 0 on a server redirected navigation from another domain'); |
| 44 |
| 45 done(); |
| 46 } |
| 47 </script> |
| 48 |
| 49 </head> |
| 50 <body> |
| 51 <h1>Description</h1> |
| 52 <p>This test validates the values of the window.performance.redirectCoun
t and the |
| 53 window.performance.timing.redirectStart/End times for a cross-origin
server side redirect navigation.</p> |
| 54 |
| 55 <div id="log"></div> |
| 56 <br /> |
| 57 <iframe id="frameContext" src="" style="width: 250px; height: 250px;"></
iframe> |
| 58 <script> |
| 59 // combine the page origin and redirect origin into the IFRAME's src
URL |
| 60 var destUrl = make_absolute_url({subdomain: subdomain, |
| 61 path: "/common/redirect.py", |
| 62 query: "location=" + make_absolute_
url( |
| 63 {path: "/navigation-tim
ing/resources/blank_page_green.html"}) |
| 64 }); |
| 65 var frameContext = document.getElementById("frameContext"); |
| 66 frameContext.onload = onload_test; |
| 67 frameContext.src = destUrl; |
| 68 </script> |
| 69 </body> |
| 70 </html> |
OLD | NEW |