OLD | NEW |
---|---|
(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 if (stackTrace.length < 3) { | |
29 InspectorTest.addResult('FAILED: bad stack size'); | |
vsevik
2014/07/17 14:34:02
Stack size too small
kozyatinskiy1
2014/07/17 14:58:44
Done.
| |
30 } else { | |
31 dumpStackFrame(stackTrace[0]); | |
32 dumpStackFrame(stackTrace[1]); | |
33 dumpStackFrame(stackTrace[2]); | |
34 } | |
35 InspectorTest.completeTest(); | |
36 } | |
37 | |
38 function dumpStackFrame(frame) | |
39 { | |
40 InspectorTest.addResult('frame function name:' + frame.functionName); | |
vsevik
2014/07/17 14:34:02
Let's put all of them on one line for better reada
kozyatinskiy1
2014/07/17 14:58:44
Done.
| |
41 InspectorTest.addResult('frame line number:' + frame.lineNumber); | |
42 InspectorTest.addResult('frame url:' + frame.url); | |
43 } | |
44 } | |
45 | |
46 </script> | |
47 </head> | |
48 <body onload="runTest()"> | |
49 <p> | |
50 Tests that evaluating an expression with an exception in the console provide cor rect exception information. | |
51 </p> | |
52 </body> | |
53 </html> | |
OLD | NEW |