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

Unified Diff: LayoutTests/inspector/console/console-eval-exception-report.html

Issue 369333002: DevTools: Added error message when the command is invoked from the console with exception (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@add-evaluate-exception-details
Patch Set: Created 6 years, 5 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
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-eval-exception-report-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/console/console-eval-exception-report.html
diff --git a/LayoutTests/inspector/console/console-eval-exception-report.html b/LayoutTests/inspector/console/console-eval-exception-report.html
new file mode 100644
index 0000000000000000000000000000000000000000..eab0a7a5ad868837b64660208649ae32c3c59a96
--- /dev/null
+++ b/LayoutTests/inspector/console/console-eval-exception-report.html
@@ -0,0 +1,47 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+function test()
+{
+ InspectorTest.evaluateInConsole("\
+ function foo()\n\
+ {\n\
+ throw {a:239};\n\
+ }\n\
+ function boo()\n\
+ {\n\
+ foo();\n\
+ }\n\
+ boo();", afterEvaluate);
+
+ function afterEvaluate()
+ {
+ InspectorTest.dumpConsoleMessages();
+
+ var viewMessages = WebInspector.ConsolePanel._view()._visibleViewMessages;
+ var uiMessage = viewMessages[viewMessages.length - 1];
+ var message = uiMessage.consoleMessage();
+ var stackTrace = message.stackTrace;
+
+ if (stackTrace.length < 3) {
+ InspectorTest.addResult('FAILED: Stack size too small');
+ } else {
+ for (var i = 0; i < 3; ++i) {
+ var frame = stackTrace[i];
+ InspectorTest.addResult('call frame:' + frame.functionName + ' at ' + frame.url + ':' + frame.lineNumber);
+ }
+ }
+ InspectorTest.completeTest();
+ }
+}
+
+</script>
+</head>
+<body onload="runTest()">
+<p>
+Tests that evaluating an expression with an exception in the console provide correct exception information.
+</p>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/inspector/console/console-eval-exception-report-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698