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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
5 <script>
6 function test()
7 {
8 InspectorTest.evaluateInConsole("\
9 function foo()\n\
10 {\n\
11 throw {a:239};\n\
12 }\n\
13 function boo()\n\
14 {\n\
15 foo();\n\
16 }\n\
17 boo();", afterEvaluate);
18
19 function afterEvaluate()
20 {
21 InspectorTest.dumpConsoleMessages();
22
23 var viewMessages = WebInspector.ConsolePanel._view()._visibleViewMessage s;
24 var uiMessage = viewMessages[viewMessages.length - 1];
25 var message = uiMessage.consoleMessage();
26 var stackTrace = message.stackTrace;
27
28 InspectorTest.assertGreaterOrEqual(stackTrace.length, 3, 'Not complete s tack trace');
vsevik 2014/07/17 13:13:22 Please don't use assert in tests, dump the values
kozyatinskiy1 2014/07/17 14:02:51 Done.
29 assertStackFrame(stackTrace[0], {functionName: "foo", lineNumber: 4, url : ""});
30 assertStackFrame(stackTrace[1], {functionName: "boo", lineNumber: 8, url : ""});
31 assertStackFrame(stackTrace[2], {functionName: "", lineNumber: 10, url: ""});
32
33 InspectorTest.completeTest();
34 }
35
36 function assertStackFrame(actual, expected)
37 {
38 InspectorTest.assertEquals(expected.functionName, actual.functionName, ' bad frame function name');
39 InspectorTest.assertEquals(expected.lineNumber, actual.lineNumber, 'bad frame line number');
40 InspectorTest.assertEquals(expected.url, actual.url, 'bad frame url');
41 }
42 }
43
44 </script>
45 </head>
46 <body onload="runTest()">
47 <p>
48 Tests that evaluating an expression with an exception in the console provide cor rect exception information.
49 </p>
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698