1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../../js-test-resources/js-test.js"></script>
7 <p id=
"description"></p>
8 <div id=
"console"></div>
10 description("Web Timing should report zeros for redirects and unload since there was no preceding page.");
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", "unloadEventStart", "unloadEventEnd"];
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");
29 shouldBeNonZero("timing." + timingProperties
[i
]);
31 shouldBe("navigation.redirectCount", "0");
36 window
.addEventListener("load", performTest
);
38 var jsTestIsAsync
= true;