OLD | NEW |
---|---|
1 function collectProperties(object, windowHasBeenGCed) | 1 function collectProperties(object, windowHasBeenGCed) |
2 { | 2 { |
3 collectPropertiesHelper(object, object, windowHasBeenGCed, []); | 3 collectPropertiesHelper(object, object, windowHasBeenGCed, []); |
4 | 4 |
5 propertiesToVerify.sort(function (a, b) | 5 propertiesToVerify.sort(function (a, b) |
6 { | 6 { |
7 if (a.property < b.property) | 7 if (a.property < b.property) |
8 return -1 | 8 return -1 |
9 if (a.property > b.property) | 9 if (a.property > b.property) |
10 return 1; | 10 return 1; |
11 return 0; | 11 return 0; |
12 }); | 12 }); |
13 } | 13 } |
14 | 14 |
15 function emitExpectedResult(path, expected) | 15 function emitExpectedResult(path, expected) |
16 { | 16 { |
17 // Skip internals properties, since they aren't web accessible. | 17 // Skip internals properties, since they aren't web accessible. |
18 if (path[0] == 'internals' | 18 if (path[0] == 'internals' |
19 || path[0] == 'clientInformation' // Just an alias for navigator. | 19 || path[0] == 'clientInformation' // Just an alias for navigator. |
20 || path[0] == 'testRunner' // Skip testRunner since they are only for te sting. | 20 || path[0] == 'testRunner' // Skip testRunner since they are only for te sting. |
21 || path[0] == 'layoutTestController' // Just an alias for testRunner. | 21 || path[0] == 'layoutTestController' // Just an alias for testRunner. |
22 || path[0] == 'eventSender') { // Skip eventSender since they are only f or testing. | 22 || path[0] == 'eventSender') { // Skip eventSender since they are only f or testing. |
23 return; | 23 return; |
24 } | 24 } |
25 | 25 |
26 // Skip the properties which are hard to expect a stable result. | 26 // Skip the properties which are hard to expect a stable result. |
27 if (path[0] == 'accessibilityController' // we can hardly estimate the state s of the cached WebAXObjects. | 27 if (path[0] == 'accessibilityController' // we can hardly estimate the state s of the cached WebAXObjects. |
28 || path[0] == 'localStorage') { // local storage is not reliably cleared between tests. | 28 // TODO(https://crbug.com/698610): Web storage APIs are not being |
29 // cleared between tests. | |
30 || path[0] == 'localStorage' | |
31 || path[0] == 'sessionStorage') { | |
dcheng
2017/03/06 06:59:47
I plan on fixing this separately
| |
29 return; | 32 return; |
30 } | 33 } |
31 | 34 |
32 // FIXME: Skip MemoryInfo for now, since it's not implemented as a DOMWindow Property, and has | 35 // FIXME: Skip MemoryInfo for now, since it's not implemented as a DOMWindow Property, and has |
33 // no way of knowing when it's detached. Eventually this should have the sam e behavior. | 36 // no way of knowing when it's detached. Eventually this should have the sam e behavior. |
34 if (path.length >= 2 && (path[0] == 'console' || path[0] == 'performance') & & path[1] == 'memory') | 37 if (path.length >= 2 && (path[0] == 'console' || path[0] == 'performance') & & path[1] == 'memory') |
35 return; | 38 return; |
36 | 39 |
37 // Skip things that are assumed to be constants. | 40 // Skip things that are assumed to be constants. |
38 if (path[path.length - 1].toUpperCase() == path[path.length - 1]) | 41 if (path[path.length - 1].toUpperCase() == path[path.length - 1]) |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 } | 131 } |
129 | 132 |
130 function pathExists(object, path) { | 133 function pathExists(object, path) { |
131 for (var i = 0; i < path.length; i++) { | 134 for (var i = 0; i < path.length; i++) { |
132 if (!object || !(path[i] in object)) | 135 if (!object || !(path[i] in object)) |
133 return false; | 136 return false; |
134 object = object[path[i]]; | 137 object = object[path[i]]; |
135 } | 138 } |
136 return true; | 139 return true; |
137 } | 140 } |
OLD | NEW |