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

Unified Diff: LayoutTests/inspector/console/console-eval-throw.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
Index: LayoutTests/inspector/console/console-eval-throw.html
diff --git a/LayoutTests/inspector/console/console-eval-throw.html b/LayoutTests/inspector/console/console-eval-throw.html
new file mode 100644
index 0000000000000000000000000000000000000000..8d85bd198e60c4735bc7a8be6bb608c10a7991d7
--- /dev/null
+++ b/LayoutTests/inspector/console/console-eval-throw.html
@@ -0,0 +1,56 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/console-test.js"></script>
+<script>
+function test()
+{
+ function dumpMessages(next, message)
+ {
+ InspectorTest.dumpConsoleMessages();
+ WebInspector.consoleModel.requestClearMessages();
+
+ WebInspector.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared);
+
+ function afterCleared() {
+ WebInspector.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared);
+ next();
+ }
+ }
+
+ InspectorTest.runTestSuite([
+ function testThrowUndefined(next)
+ {
+ InspectorTest.evaluateInConsole('throw undefined', dumpMessages.bind(null, next));
+ },
+
+ function testThrowNumber(next)
+ {
+ InspectorTest.evaluateInConsole('throw 1', dumpMessages.bind(null, next));
+ },
+
+ function testThrowString(next)
+ {
+ InspectorTest.evaluateInConsole('throw \'asdf\'', dumpMessages.bind(null, next));
+ },
+
+ function testThrowObject(next)
+ {
+ InspectorTest.evaluateInConsole('throw {a:42}', dumpMessages.bind(null, next));
+ },
+
+ function testThrowError(next)
+ {
+ InspectorTest.evaluateInConsole('throw new Error(\'asdf\')', dumpMessages.bind(null, next));
+ }
+ ]);
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+Tests that evaluating 'throw undefined|1|string|object|Error' in the console won't crash the browser and correctly reported.
+<a href="https://bugs.webkit.org/show_bug.cgi?id=59611">Bug 59611.</a>
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698