Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger / rethrow-error-from-bindings-crash.html
bloba98a556448c67c3bb9cae7a7394de70f73522747
1 <html>
2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../../../http/tests/inspector/console-test.js"></script>
6 <script>
7 var functions;
9 function testFunction()
11 console.clear();
12 // This used to be a racy crash. Test some sequence of functions.
13 functions = [f2, f1, f2, f1, f2, f1, f2, f1];
14 functions.push(function() {});
15 functions.shift()();
18 function f1() {
19 setTimeout(functions.shift(), 0);
20 document.body.appendChild("<throw_exception>");
23 function f2() {
24 setTimeout(functions.shift(), 0);
25 new Range().compareBoundaryPoints(1, 2);
28 var test = function()
30 var expectedErrorsCount = 8;
32 InspectorTest.setQuiet(true);
33 InspectorTest.startDebuggerTest(step1);
35 function step1()
37 InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
38 InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
41 function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
43 --expectedErrorsCount;
44 if (!expectedErrorsCount) {
45 InspectorTest.waitUntilNthMessageReceived(1, step2);
46 InspectorTest.resumeExecution();
47 } else {
48 InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
52 function step2()
54 InspectorTest.dumpConsoleMessages();
55 completeTest();
58 function completeTest()
60 InspectorTest.DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
61 InspectorTest.completeDebuggerTest();
65 </script>
66 </head>
67 <body onload="window.testRunner ? runTest() : testFunction()">
68 <p>
69 Tests that pausing on uncaught exceptions thrown from C++ bindings will not crash.
70 </p>
71 </body>
72 </html>