| OLD | NEW |
| (Empty) |
| 1 window.performance = window.performance || {}; | |
| 2 var navigation = performance.navigation || {}; | |
| 3 var timing = performance.timing || {}; | |
| 4 var originalTiming = {}; | |
| 5 | |
| 6 window.addEventListener("load", function() { setTimeout(testTimingWithDocumentOp
en, 0); }, false); | |
| 7 | |
| 8 function testTimingWithDocumentOpen() | |
| 9 { | |
| 10 for (property in timing) { | |
| 11 originalTiming[property] = timing[property]; | |
| 12 } | |
| 13 | |
| 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(); | |
| 23 | |
| 24 description("This test verifies that the NavigationTimings don't change afte
r a document.open()."); | |
| 25 | |
| 26 setTimeout(finishTest, 0); | |
| 27 } | |
| 28 | |
| 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]); | |
| 33 } | |
| 34 | |
| 35 finishJSTest(); | |
| 36 } | |
| 37 | |
| 38 jsTestIsAsync = true; | |
| OLD | NEW |