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> |
| 11 |
| 12 function onload_test() |
| 13 { |
| 14 var reload_frame = document.getElementById("frameContext"); |
| 15 reload_frame.onload = do_test; |
| 16 reload_frame.contentWindow.location.reload(true); |
| 17 } |
| 18 |
| 19 function do_test() |
| 20 { |
| 21 var newNavTiming = document.getElementById("frameContext").conte
ntWindow.performance.getEntriesByType("navigation")[0]; |
| 22 assert_true(newNavTiming.unloadEventStart > 0, "Expected unloadE
ventStart to be greater than 0."); |
| 23 assert_true(newNavTiming.unloadEventEnd > 0, "Expected unloadEve
ntEnd to be greater than 0."); |
| 24 done(); |
| 25 } |
| 26 </script> |
| 27 </head> |
| 28 <body> |
| 29 <h1>Description</h1> |
| 30 <p>This test validates the value of window.performance.getEntriesByType(
"navigation")[0].(type/unloadEventEnd/unloadEventStart) with a reloaded navigati
on.</p> |
| 31 |
| 32 <p>This page should be loaded with a green background frame below. The
frame will be automatically reloaded |
| 33 and then verified that |
| 34 <ul> |
| 35 <li>The window.performance.getEntriesByType("navigation").unloadEven
tStart > 0 after reload</li> |
| 36 <li>The window.performance.getEntriesByType("navigation").unloadEven
tEnd > 0 after reload</li> |
| 37 </ul> |
| 38 </p> |
| 39 |
| 40 <iframe id="frameContext" onload="onload_test();" src="resources/blank_p
age_green.html" style="width: 250px; height: 250px;"></iframe> |
| 41 </body> |
| 42 </html> |
OLD | NEW |