Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / script-tests / webtiming-document-open.js
blob52d949880f8a5f1754bb48fd1cd786f27eeb77c3
1 window.performance = window.performance || {};
2 var navigation = performance.navigation || {};
3 var timing = performance.timing || {};
4 var originalTiming = {};
6 window.addEventListener("load", function() { setTimeout(testTimingWithDocumentOpen, 0); }, false);
8 function testTimingWithDocumentOpen()
10 for (property in timing) {
11 originalTiming[property] = timing[property];
14 document.open();
15 document.write("<html>");
16 document.write("<head>");
17 document.write("<script src=\"../../resources/js-test.js\"></script>");
18 document.write("</head>");
19 document.write("<body>");
20 document.write("</body>");
21 document.write("</html>");
22 document.close();
24 description("This test verifies that the NavigationTimings don't change after a document.open().");
26 setTimeout(finishTest, 0);
29 function finishTest() {
30 var properties = getAllPropertyNames(timing);
31 for (var i = 0; i < properties.length; ++i) {
32 shouldBe("timing." + properties[i], "originalTiming." + properties[i]);
35 finishJSTest();
38 jsTestIsAsync = true;