test-no-previous-document.html (1949B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title>window.performance.timing attributes on an initial navigation</title> 6 <link rel="author" title="Google" href="http://www.google.com/" /> 7 <link rel="help" href="http://www.w3.org/TR/navigation-timing/#sec-navigation-timing-interface"/> 8 <link rel="help" href="http://www.w3.org/TR/navigation-timing/#sec-navigation-info-interface"/> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 <script src="/common/performance-timeline-utils.js"></script> 12 <script src="resources/webperftestharness.js"></script> 13 14 <script> 15 setup({explicit_done: true}); 16 17 var frame; 18 function onload_test() 19 { 20 frame = document.getElementById("frameContext"); 21 test_namespace('navigation'); 22 if (performanceNamespace) 23 { 24 test_true(frame.contentWindow.performance.navigation.type == performanceNamespace.navigation.TYPE_NAVIGATE, 25 'timing.navigation.type is TYPE_NAVIGATE'); 26 27 test_equals(frame.contentWindow.performance.timing.unloadEventStart, 0, 'timing.unloadEventStart == 0 on navigation with no previous document'); 28 test_equals(frame.contentWindow.performance.timing.unloadEventEnd, 0, 'timing.unloadEventEnd == 0 navigation with no previous document'); 29 } 30 done(); 31 } 32 </script> 33 34 </head> 35 <body onload="onload_test();"> 36 <h1>Description</h1> 37 <p>This test validates the unload event times are 0 when there is no previous document.</p> 38 39 <div id="log"></div><br /> 40 <iframe id="frameContext" src="resources/blank_page_green.html" style="width: 250px; height: 250px;"></iframe> 41 </body> 42 </html>