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

Side by Side Diff: LayoutTests/fast/dom/Window/resources/window-property-collector.js

Issue 362993004: Implement Blink-in-JS for DOM attributes (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 function collectProperties() 1 function collectProperties()
2 { 2 {
3 // Collect properties of the top-level window, since touching the properties 3 // Collect properties of the top-level window, since touching the properties
4 // of a DOMWindow affects its internal C++ state. 4 // of a DOMWindow affects its internal C++ state.
5 collectPropertiesHelper(window, []); 5 collectPropertiesHelper(window, []);
6 6
7 propertiesToVerify.sort(function (a, b) 7 propertiesToVerify.sort(function (a, b)
8 { 8 {
9 if (a.property < b.property) 9 if (a.property < b.property)
10 return -1 10 return -1
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 insertExpectedResult(path, expected); 80 insertExpectedResult(path, expected);
81 } 81 }
82 82
83 function collectPropertiesHelper(object, path) 83 function collectPropertiesHelper(object, path)
84 { 84 {
85 if (path.length > 20) 85 if (path.length > 20)
86 throw 'Error: probably looping'; 86 throw 'Error: probably looping';
87 87
88 for (var property in object) { 88 for (var property in object) {
89 // Skip internals properties, since they aren't web accessible.
90 if (property === 'internals')
91 continue;
89 path.push(property); 92 path.push(property);
90 var type = typeof(object[property]); 93 var type = typeof(object[property]);
91 if (type == "object") { 94 if (type == "object") {
92 if (object[property] === null) { 95 if (object[property] === null) {
93 emitExpectedResult(path, "null"); 96 emitExpectedResult(path, "null");
94 } else if (!object[property].Window 97 } else if (!object[property].Window
95 && !(object[property] instanceof Node) 98 && !(object[property] instanceof Node)
96 && !(object[property] instanceof MimeTypeArray) 99 && !(object[property] instanceof MimeTypeArray)
97 && !(object[property] instanceof PluginArray)) { 100 && !(object[property] instanceof PluginArray)) {
98 // Skip some traversing through types that will end up in cycles ... 101 // Skip some traversing through types that will end up in cycles ...
99 collectPropertiesHelper(object[property], path); 102 collectPropertiesHelper(object[property], path);
100 } 103 }
101 } else if (type == "string") { 104 } else if (type == "string") {
102 emitExpectedResult(path, "''"); 105 emitExpectedResult(path, "''");
103 } else if (type == "number") { 106 } else if (type == "number") {
104 emitExpectedResult(path, "0"); 107 emitExpectedResult(path, "0");
105 } else if (type == "boolean") { 108 } else if (type == "boolean") {
106 emitExpectedResult(path, "false"); 109 emitExpectedResult(path, "false");
107 } 110 }
108 path.pop(); 111 path.pop();
109 } 112 }
110 } 113 }
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/private_script_unittest.html » ('j') | Source/bindings/core/v8/PrivateScriptRunner.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698