test-performance-attributes.sub.html (1324B)
1 <!DOCTYPE HTML> 2 <html> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <!-- Use https to ensure secureConnectionStart is nontrivial, if it is supported. --> 6 <iframe src="https://{{host}}:{{ports[https][0]}}/navigation-timing/resources/performance-attribute-sender.html"></iframe> 7 <body> 8 <script> 9 async_test(function(t) { 10 window.addEventListener('message', t.step_func_done(function(event) { 11 const connectStart = event.data[0]; 12 const navigationStart = event.data[1]; 13 const secureConnectionStart = event.data[2]; 14 const connectEnd = event.data[3]; 15 assert_greater_than_equal(connectStart, navigationStart, 16 'performance.timing.connectStart >= performance.timing.navigationStart'); 17 // secureConnectionStart is an optional attribute. 18 if (secureConnectionStart == undefined) { 19 return; 20 } 21 assert_greater_than_equal(secureConnectionStart, connectStart, 22 'performance.timing.secureConnectionStart >= performance.timing.connectStart'); 23 assert_greater_than_equal(connectEnd, secureConnectionStart, 24 'performance.timing.connectEnd >= performance.timing.secureConnectionStart'); 25 })); 26 }, 'Check that performance.timing has reasonable values for secureConnectionStart and other attributes'); 27 </script> 28 </body> 29 </html>