Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / misc / resources / webtiming-cross-origin-and-back2.html
blobf8ed7eba68b004bf290adad650b7a5ad0fefebc1
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10 description("If the destination and previous page have the same origin, then Web Timing should report unload timing.");
12 window.performance = window.performance || {};
13 var navigation = performance.navigation || {};
14 var timing = performance.timing || {};
16 function performTest() {
17 // FIXME: Need a way to synchronize the test so that loadEventEnd is non-zero.
18 var shouldBeZeroList = ["loadEventEnd", "redirectStart", "redirectEnd", "secureConnectionStart", "unloadEventEnd", "unloadEventStart"];
20 var timingProperties = new Array;
21 for (var property in timing) {
22 timingProperties.push(property);
24 timingProperties.sort();
25 for (var i = 0; i < timingProperties.length; ++i) {
26 if (shouldBeZeroList.indexOf(timingProperties[i]) >= 0)
27 shouldBe("timing." + timingProperties[i], "0");
28 else
29 shouldBeNonZero("timing." + timingProperties[i]);
31 shouldBe("navigation.redirectCount", "0");
33 finishJSTest();
36 window.addEventListener("load", performTest);
38 var jsTestIsAsync = true;
39 </script>
40 </body>
41 </html>