https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e2dc266c6bd1d441938dfe828d552542a0c0b2b7 authored by Geoffrey Sneddon on 09 April 2018, 14:44:16 UTC
fixup! Fix #2669: Add alternate_hosts
Tip revision: e2dc266
test_performance_attributes.sub.html
<!DOCTYPE HTML>
<html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- Use https to ensure secureConnectionStart is nontrivial, if it is supported. -->
<iframe src="https://{{host}}:{{ports[https][0]}}/navigation-timing/resources/performance_attribute_sender.html"></iframe>
<body>
<script>
async_test(function(t) {
  window.addEventListener('message', t.step_func_done(function(event) {
    const connectStart = event.data[0];
    const navigationStart = event.data[1];
    const secureConnectionStart = event.data[2];
    const connectEnd = event.data[3];
    assert_greater_than_equal(connectStart, navigationStart,
      'performance.timing.connectStart >= performance.timing.navigationStart');
    // secureConnectionStart is an optional attribute.
    if (secureConnectionStart == undefined) {
      return;
    }
    assert_greater_than_equal(secureConnectionStart, connectStart,
      'performance.timing.secureConnectionStart >= performance.timing.connectStart');
    assert_greater_than_equal(connectEnd, secureConnectionStart,
      'performance.timing.connectEnd >= performance.timing.secureConnectionStart');
  }));
}, 'Check that performance.timing has reasonable values for secureConnectionStart and other attributes');
</script>
</body>
</html>
back to top