OLD | NEW |
1 if (window.GCController) | 1 if (window.GCController) |
2 GCController.collectAll(); | 2 GCController.collectAll(); |
3 | 3 |
4 var initialize_InspectorTest = function() { | 4 var initialize_InspectorTest = function() { |
5 Protocol.InspectorBackend.Options.suppressRequestErrors = true; | 5 Protocol.InspectorBackend.Options.suppressRequestErrors = true; |
6 var results = []; | 6 var results = []; |
7 | 7 |
8 function consoleOutputHook(messageType) | 8 function consoleOutputHook(messageType) |
9 { | 9 { |
10 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); | 10 InspectorTest.addResult(messageType + ": " + Array.prototype.slice.call(argu
ments, 1)); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 InspectorTest.addResult(prefix + openTag.join(" ")); | 240 InspectorTest.addResult(prefix + openTag.join(" ")); |
241 for (var child = element.firstChild; child; child = child.nextSibling) | 241 for (var child = element.firstChild; child; child = child.nextSibling) |
242 innerHTML(prefix + " ", child); | 242 innerHTML(prefix + " ", child); |
243 if (element.shadowRoot) | 243 if (element.shadowRoot) |
244 innerHTML(prefix + " ", element.shadowRoot); | 244 innerHTML(prefix + " ", element.shadowRoot); |
245 InspectorTest.addResult(prefix + "</" + element.nodeName + ">"); | 245 InspectorTest.addResult(prefix + "</" + element.nodeName + ">"); |
246 } | 246 } |
247 innerHTML("", element) | 247 innerHTML("", element) |
248 } | 248 } |
249 | 249 |
| 250 InspectorTest.deepTextContent = function(element) |
| 251 { |
| 252 if (!element) |
| 253 return ""; |
| 254 if (element.nodeType === Node.TEXT_NODE && element.nodeValue) |
| 255 return !element.parentElement || element.parentElement.nodeName !== "STY
LE" ? element.nodeValue : ""; |
| 256 var res = ""; |
| 257 var children = element.childNodes; |
| 258 for (var i = 0; i < children.length; ++i) |
| 259 res += InspectorTest.deepTextContent(children[i]); |
| 260 if (element.shadowRoot) |
| 261 res += InspectorTest.deepTextContent(element.shadowRoot); |
| 262 return res; |
| 263 } |
| 264 |
250 InspectorTest.dump = function(value, customFormatters, prefix, prefixWithName) | 265 InspectorTest.dump = function(value, customFormatters, prefix, prefixWithName) |
251 { | 266 { |
252 prefixWithName = prefixWithName || prefix; | 267 prefixWithName = prefixWithName || prefix; |
253 if (prefixWithName && prefixWithName.length > 80) { | 268 if (prefixWithName && prefixWithName.length > 80) { |
254 InspectorTest.addResult(prefixWithName + "was skipped due to prefix leng
th limit"); | 269 InspectorTest.addResult(prefixWithName + "was skipped due to prefix leng
th limit"); |
255 return; | 270 return; |
256 } | 271 } |
257 if (value === null) | 272 if (value === null) |
258 InspectorTest.addResult(prefixWithName + "null"); | 273 InspectorTest.addResult(prefixWithName + "null"); |
259 else if (value && value.constructor && value.constructor.name === "Array") | 274 else if (value && value.constructor && value.constructor.name === "Array") |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 _output("[page] " + text); | 1304 _output("[page] " + text); |
1290 } | 1305 } |
1291 | 1306 |
1292 function _output(result) | 1307 function _output(result) |
1293 { | 1308 { |
1294 if (!outputElement) | 1309 if (!outputElement) |
1295 createOutputElement(); | 1310 createOutputElement(); |
1296 outputElement.appendChild(document.createTextNode(result)); | 1311 outputElement.appendChild(document.createTextNode(result)); |
1297 outputElement.appendChild(document.createElement("br")); | 1312 outputElement.appendChild(document.createElement("br")); |
1298 } | 1313 } |
OLD | NEW |