Chromium Code Reviews| 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..e51ab7b34fc4793b08b07805f7b2f7f23487fdfd |
| --- /dev/null |
| +++ b/LayoutTests/inspector/console/console-eval-exception-report.html |
| @@ -0,0 +1,53 @@ |
| +<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: bad stack size'); |
|
vsevik
2014/07/17 14:34:02
Stack size too small
kozyatinskiy1
2014/07/17 14:58:44
Done.
|
| + } else { |
| + dumpStackFrame(stackTrace[0]); |
| + dumpStackFrame(stackTrace[1]); |
| + dumpStackFrame(stackTrace[2]); |
| + } |
| + InspectorTest.completeTest(); |
| + } |
| + |
| + function dumpStackFrame(frame) |
| + { |
| + 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.
|
| + InspectorTest.addResult('frame line number:' + frame.lineNumber); |
| + InspectorTest.addResult('frame url:' + frame.url); |
| + } |
| +} |
| + |
| +</script> |
| +</head> |
| +<body onload="runTest()"> |
| +<p> |
| +Tests that evaluating an expression with an exception in the console provide correct exception information. |
| +</p> |
| +</body> |
| +</html> |