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

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

Issue 625943002: Catch uncaught promise rejections from V8 and log to console. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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: LayoutTests/http/tests/inspector/console-test.js
diff --git a/LayoutTests/http/tests/inspector/console-test.js b/LayoutTests/http/tests/inspector/console-test.js
index 5d27524d4e2d7ecc5b38f8071e3e14bd6da41735..d59d68ea23c4fe60fc07290f3028df92318f81af 100644
--- a/LayoutTests/http/tests/inspector/console-test.js
+++ b/LayoutTests/http/tests/inspector/console-test.js
@@ -74,6 +74,11 @@ InspectorTest.fixConsoleViewportDimensions = function(width, height)
InspectorTest.dumpConsoleMessages = function(printOriginatingCommand, dumpClassNames, formatter)
{
+ InspectorTest.addResults(InspectorTest.dumpConsoleMessagesIntoArray(printOriginatingCommand, dumpClassNames, formatter));
+}
+
+InspectorTest.dumpConsoleMessagesIntoArray = function(printOriginatingCommand, dumpClassNames, formatter)
+{
formatter = formatter || InspectorTest.prepareConsoleMessageText;
var result = [];
InspectorTest.disableConsoleViewport();
@@ -94,21 +99,21 @@ InspectorTest.dumpConsoleMessages = function(printOriginatingCommand, dumpClassN
}
}
- if (InspectorTest.dumpConsoleTableMessage(uiMessage, false)) {
+ if (InspectorTest.dumpConsoleTableMessage(uiMessage, false, result)) {
if (dumpClassNames)
- InspectorTest.addResult(classNames.join(" > "));
+ result.push(classNames.join(" > "));
} else {
var messageText = formatter(element, message);
- InspectorTest.addResult(messageText + (dumpClassNames ? " " + classNames.join(" > ") : ""));
+ result.push(messageText + (dumpClassNames ? " " + classNames.join(" > ") : ""));
}
if (printOriginatingCommand && uiMessage.consoleMessage().originatingMessage())
- InspectorTest.addResult("Originating from: " + uiMessage.consoleMessage().originatingMessage().messageText);
+ result.push("Originating from: " + uiMessage.consoleMessage().originatingMessage().messageText);
}
return result;
}
-InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate)
+InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate, results)
{
if (forceInvalidate)
WebInspector.ConsolePanel._view()._viewport.invalidate();
@@ -121,7 +126,7 @@ InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate)
for (var i = 0; i < headers.length; i++)
headerLine += headers[i].textContent + " | ";
- InspectorTest.addResult("HEADER " + headerLine);
+ addResult("HEADER " + headerLine);
var rows = table.querySelectorAll(".data-container tr");
@@ -133,8 +138,17 @@ InspectorTest.dumpConsoleTableMessage = function(viewMessage, forceInvalidate)
rowLine += items[j].textContent + " | ";
if (rowLine.trim())
- InspectorTest.addResult("ROW " + rowLine);
+ addResult("ROW " + rowLine);
+ }
+
+ function addResult(x)
+ {
+ if (results)
+ results.push(x);
+ else
+ InspectorTest.addResult(x);
}
+
return true;
}
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-format-es6.html » ('j') | Source/bindings/core/v8/V8Initializer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698