https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 34dfe32379a4e905b318f825fd6eab4c96bfc8c4 authored by Luke Bjerring on 11 May 2018, 19:30:08 UTC
Merge branch 'master' into idlharness-dependencies
Tip revision: 34dfe32
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