Index: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js |
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js |
index 603ca5c33488ffed390b68044ac82a763eead7cc..6ae518af155d4f0aa6996b62b4cedbe7b907ae11 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js |
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js |
@@ -247,6 +247,21 @@ InspectorTest.dumpDeepInnerHTML = function(element) |
innerHTML("", element) |
} |
+InspectorTest.deepTextContent = function(element) |
+{ |
+ if (!element) |
+ return ""; |
+ if (element.nodeType === Node.TEXT_NODE && element.nodeValue) |
+ return !element.parentElement || element.parentElement.nodeName !== "STYLE" ? element.nodeValue : ""; |
+ var res = ""; |
+ var children = element.childNodes; |
+ for (var i = 0; i < children.length; ++i) |
+ res += InspectorTest.deepTextContent(children[i]); |
+ if (element.shadowRoot) |
+ res += InspectorTest.deepTextContent(element.shadowRoot); |
+ return res; |
+} |
+ |
InspectorTest.dump = function(value, customFormatters, prefix, prefixWithName) |
{ |
prefixWithName = prefixWithName || prefix; |
@@ -710,7 +725,7 @@ InspectorTest.addSnifferPromise = function(receiver, methodName) |
// In case of exception the override won't be called. |
try { |
Array.prototype.push.call(arguments, result); |
- resolve.apply(this, arguments); |
+ resolve.call(this, arguments); |
} catch (e) { |
reject("Exception in overriden method '" + methodName + "': " + e); |
} |