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

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

Issue 216343002: Add a test that confirms there's no crash on accessing properties of AccesibilityObject at the init… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 function collectPropertiesHelper(object, path) 72 function collectPropertiesHelper(object, path)
73 { 73 {
74 if (path.length > 20) 74 if (path.length > 20)
75 throw 'Error: probably looping'; 75 throw 'Error: probably looping';
76 76
77 for (var property in object) { 77 for (var property in object) {
78 // Skip the properties which are hard to expect a stable result. 78 // Skip the properties which are hard to expect a stable result.
79 // As for 'accessibilityController', we can hardly estimate the states 79 // As for 'accessibilityController', we can hardly estimate the states
80 // of the cached WebAXObjects. 80 // of the cached WebAXObjects.
81 // FIXME: We can't access accessibilityController's properties here
dmazzoni 2014/03/28 06:30:32 It looks like you're deleting the FIXME, but the s
hajimehoshi 2014/03/28 07:23:46 Done.
82 // because some property accesses might crash (crbug/351195).
83 if (property == 'accessibilityController') 81 if (property == 'accessibilityController')
84 continue; 82 continue;
85 // As for 'localStorage', local storage is not reliably cleared between tests. 83 // As for 'localStorage', local storage is not reliably cleared between tests.
86 if (property == 'localStorage') 84 if (property == 'localStorage')
87 continue; 85 continue;
88 path.push(property); 86 path.push(property);
89 var type = typeof(object[property]); 87 var type = typeof(object[property]);
90 if (type == "object") { 88 if (type == "object") {
91 if (object[property] === null) { 89 if (object[property] === null) {
92 emitExpectedResult(path, "null"); 90 emitExpectedResult(path, "null");
93 } else if (!object[property].Window 91 } else if (!object[property].Window
94 && !(object[property] instanceof Node) 92 && !(object[property] instanceof Node)
95 && !(object[property] instanceof MimeTypeArray) 93 && !(object[property] instanceof MimeTypeArray)
96 && !(object[property] instanceof PluginArray)) { 94 && !(object[property] instanceof PluginArray)) {
97 // Skip some traversing through types that will end up in cycles ... 95 // Skip some traversing through types that will end up in cycles ...
98 collectPropertiesHelper(object[property], path); 96 collectPropertiesHelper(object[property], path);
99 } 97 }
100 } else if (type == "string") { 98 } else if (type == "string") {
101 emitExpectedResult(path, "''"); 99 emitExpectedResult(path, "''");
102 } else if (type == "number") { 100 } else if (type == "number") {
103 emitExpectedResult(path, "0"); 101 emitExpectedResult(path, "0");
104 } else if (type == "boolean") { 102 } else if (type == "boolean") {
105 emitExpectedResult(path, "false"); 103 emitExpectedResult(path, "false");
106 } 104 }
107 path.pop(); 105 path.pop();
108 } 106 }
109 } 107 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698