| OLD | NEW |
| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 break; | 55 break; |
| 56 } | 56 } |
| 57 | 57 |
| 58 insertExpectedResult(path, expected); | 58 insertExpectedResult(path, expected); |
| 59 } | 59 } |
| 60 | 60 |
| 61 function collectPropertiesHelper(object, path) | 61 function collectPropertiesHelper(object, path) |
| 62 { | 62 { |
| 63 if (path.length > 20) | 63 if (path.length > 20) |
| 64 throw 'Error: probably looping'; | 64 throw 'Error: probably looping'; |
| 65 |
| 65 for (var property in object) { | 66 for (var property in object) { |
| 67 // Skip the properties which are hard to expect a stable result. |
| 68 // As for 'accessibilityController', we can hardly estimate the states |
| 69 // of the cached WebAXObjects. |
| 70 if (property == 'accessibilityController') |
| 71 continue; |
| 66 if (!object[property]) | 72 if (!object[property]) |
| 67 continue; | 73 continue; |
| 68 path.push(property); | 74 path.push(property); |
| 69 var type = typeof(object[property]); | 75 var type = typeof(object[property]); |
| 70 if (type == "object") { | 76 if (type == "object") { |
| 71 // Skip some traversing through types that will end up in cycles... | 77 // Skip some traversing through types that will end up in cycles... |
| 72 if (!object[property].Window | 78 if (!object[property].Window |
| 73 && !(object[property] instanceof Node) | 79 && !(object[property] instanceof Node) |
| 74 && !(object[property] instanceof MimeTypeArray) | 80 && !(object[property] instanceof MimeTypeArray) |
| 75 && !(object[property] instanceof PluginArray)) { | 81 && !(object[property] instanceof PluginArray)) { |
| 76 collectPropertiesHelper(object[property], path); | 82 collectPropertiesHelper(object[property], path); |
| 77 } | 83 } |
| 78 } else if (type == "string") { | 84 } else if (type == "string") { |
| 79 emitExpectedResult(path, "''"); | 85 emitExpectedResult(path, "''"); |
| 80 } else if (type == "number") { | 86 } else if (type == "number") { |
| 81 emitExpectedResult(path, "0"); | 87 emitExpectedResult(path, "0"); |
| 82 } else if (type == "boolean") { | 88 } else if (type == "boolean") { |
| 83 emitExpectedResult(path, "false"); | 89 emitExpectedResult(path, "false"); |
| 84 } | 90 } |
| 85 path.pop(); | 91 path.pop(); |
| 86 } | 92 } |
| 87 } | 93 } |
| 88 | |
| OLD | NEW |