Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: LayoutTests/fast/dom/script-tests/webtiming-document-open.js

Issue 821303006: bindings: Fixes layouttests when moving attributes to prototype chains. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 window.performance = window.performance || {}; 1 window.performance = window.performance || {};
2 var navigation = performance.navigation || {}; 2 var navigation = performance.navigation || {};
3 var timing = performance.timing || {}; 3 var timing = performance.timing || {};
4 var originalTiming = {}; 4 var originalTiming = {};
5 5
6 window.addEventListener("load", function() { setTimeout(testTimingWithDocumentOp en, 0); }, false); 6 window.addEventListener("load", function() { setTimeout(testTimingWithDocumentOp en, 0); }, false);
7 7
8 function testTimingWithDocumentOpen() 8 function testTimingWithDocumentOpen()
9 { 9 {
10 for (property in timing) { 10 for (property in timing) {
11 originalTiming[property] = timing[property]; 11 originalTiming[property] = timing[property];
12 } 12 }
13 13
14 document.open(); 14 document.open();
15 document.write("<html>"); 15 document.write("<html>");
16 document.write("<head>"); 16 document.write("<head>");
17 document.write("<script src=\"../../resources/js-test.js\"></script>"); 17 document.write("<script src=\"../../resources/js-test.js\"></script>");
18 document.write("</head>"); 18 document.write("</head>");
19 document.write("<body>"); 19 document.write("<body>");
20 document.write("</body>"); 20 document.write("</body>");
21 document.write("</html>"); 21 document.write("</html>");
22 document.close(); 22 document.close();
23 23
24 description("This test verifies that the NavigationTimings don't change afte r a document.open()."); 24 description("This test verifies that the NavigationTimings don't change afte r a document.open().");
25 25
26 setTimeout(finishTest, 0); 26 setTimeout(finishTest, 0);
27 } 27 }
28 28
29 function finishTest() { 29 function finishTest() {
30 keys = Object.keys(timing).sort(); 30 var properties = [];
jsbell 2015/01/21 18:09:39 This pattern repeats often. Perhaps we should add
Yuki 2015/01/22 06:53:29 Done.
31 for (var i = 0; i < keys.length; ++i) { 31 for (property in timing) {
32 shouldBe("timing." + keys[i], "originalTiming." + keys[i]); 32 properties.push(property);
33 }
34 properties.sort();
35 for (var i = 0; i < properties.length; ++i) {
36 shouldBe("timing." + properties[i], "originalTiming." + properties[i]);
33 } 37 }
34 38
35 finishJSTest(); 39 finishJSTest();
36 } 40 }
37 41
38 jsTestIsAsync = true; 42 jsTestIsAsync = true;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698