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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js

Issue 2886393003: DevTools: Use badges to render products in timeline details. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698