blob: 0f4de3716435dc04e22623cde0da397eb2ec3d60 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../js-test-resources/js-test-pre.js"></script>
</head>
<body>
<p id="description"></p>
<div id="console"></div>
<script>
description("If the destination and previous page have the same origin, then Web Timing should report unload timing.");
window.performance = window.performance || {};
var navigation = performance.navigation || {};
var timing = performance.timing || {};
function performTest() {
// FIXME: Need a way to synchronize the test so that loadEventEnd is non-zero.
var shouldBeZeroList = ["loadEventEnd", "redirectStart", "redirectEnd", "secureConnectionStart", "unloadEventEnd", "unloadEventStart"];
var timingProperties = new Array;
for (var property in timing) {
timingProperties.push(property);
}
timingProperties.sort();
for (var i = 0; i < timingProperties.length; ++i) {
if (shouldBeZeroList.indexOf(timingProperties[i]) >= 0)
shouldBe("timing." + timingProperties[i], "0");
else
shouldBeNonZero("timing." + timingProperties[i]);
}
shouldBe("navigation.redirectCount", "0");
finishJSTest();
}
window.addEventListener("load", performTest);
var jsTestIsAsync = true;
</script>
<script src="../../js-test-resources/js-test-post.js"></script>
</body>
</html>