3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/console-test.js"></script>
8 function dumpMessages(next, message)
10 InspectorTest.dumpConsoleMessages();
11 WebInspector.consoleModel.requestClearMessages();
13 WebInspector.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared);
15 function afterCleared() {
16 WebInspector.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared);
21 InspectorTest.runTestSuite([
22 function testThrowUndefined(next)
24 InspectorTest.evaluateInConsole('throw undefined', dumpMessages.bind(null, next));
27 function testThrowNumber(next)
29 InspectorTest.evaluateInConsole('throw 1', dumpMessages.bind(null, next));
32 function testThrowString(next)
34 InspectorTest.evaluateInConsole('throw \'asdf\'', dumpMessages.bind(null, next));
37 function testThrowObject(next)
39 InspectorTest.evaluateInConsole('throw {a:42}', dumpMessages.bind(null, next));
42 function testThrowError(next)
44 InspectorTest.evaluateInConsole('throw new Error(\'asdf\')', dumpMessages.bind(null, next));
50 <body onload="runTest()">
52 Tests that evaluating 'throw undefined|1|string|object|Error' in the console won't crash the browser and correctly reported.
53 <a href="https://bugs.webkit.org/show_bug.cgi?id=59611">Bug 59611.</a>