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

Unified Diff: LayoutTests/inspector/console/console-uncaught-promise.html

Issue 657063002: Show stack traces in console for unhandled promise rejection messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed debugger-pause-on-promise-rejection.html test 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/inspector/console/console-uncaught-promise.html
diff --git a/LayoutTests/inspector/console/console-uncaught-promise.html b/LayoutTests/inspector/console/console-uncaught-promise.html
index ee47a7151042db9dd430fdc34077dac51acdc1b5..d2c3c05ad263b581495594b463bcd2f2bbba2928 100644
--- a/LayoutTests/inspector/console/console-uncaught-promise.html
+++ b/LayoutTests/inspector/console/console-uncaught-promise.html
@@ -33,29 +33,33 @@ function onload()
runTest();
}
+function runPromisesFromInspector()
+{
+ // setTimeout to cut off VM call frames from the stack trace.
+ setTimeout(function timeout() {
+ runPromises("inspector")
+ }, 0);
+}
+
function test()
{
- InspectorTest.addConsoleViewSniffer(addMessage, true);
+ InspectorTest.addConsoleViewSniffer(checkConsoleMessages, true);
+ WebInspector.console.showPromise().done();
- WebInspector.console.showPromise().then(function() {
- InspectorTest.evaluateInPage("runPromises('inspector')");
- });
+ checkConsoleMessages();
- var count = 0;
- function addMessage(uiMessage)
+ function checkConsoleMessages()
{
- if (uiMessage.toString().indexOf("inspector.err") !== -1)
- ++count;
+ var count = InspectorTest.consoleMessagesCount();
if (count === 2)
+ InspectorTest.evaluateInPage("runPromisesFromInspector()");
+ else if (count === 4)
InspectorTest.expandConsoleMessages(dump);
}
function dump()
{
- // Sort console messages from async Promises to avoid flakiness.
- var results = InspectorTest.dumpConsoleMessagesIntoArray(false, false, InspectorTest.textContentWithLineBreaks);
- results.sort();
- InspectorTest.addResults(results);
+ InspectorTest.dumpConsoleMessages(false, false, InspectorTest.textContentWithLineBreaks);
InspectorTest.completeTest();
}
}
« no previous file with comments | « LayoutTests/http/tests/inspector/console-test.js ('k') | LayoutTests/inspector/console/console-uncaught-promise-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698