Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / console / console-eval-throw.html
blobd80b03bedd868ecb08c61fb32b78200f84a4185c
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()
8 function dumpMessages(next, message)
10 InspectorTest.dumpConsoleMessagesIgnoreErrorStackFrames();
11 InspectorTest.consoleModel.requestClearMessages();
13 InspectorTest.consoleModel.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared);
15 function afterCleared() {
16 InspectorTest.consoleModel.removeEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, afterCleared);
17 next();
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));
46 ]);
48 </script>
49 </head>
50 <body onload="runTest()">
51 <p>
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>
54 </p>
55 </body>
56 </html>