| Index: LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
|
| diff --git a/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html b/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..14a44bd21257fa7f6628006eb860818b6ffbfc0a
|
| --- /dev/null
|
| +++ b/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash.html
|
| @@ -0,0 +1,72 @@
|
| +<html>
|
| +<head>
|
| +<script src="../../../http/tests/inspector/inspector-test.js"></script>
|
| +<script src="../../../http/tests/inspector/debugger-test.js"></script>
|
| +<script src="../../../http/tests/inspector/console-test.js"></script>
|
| +<script>
|
| +var functions;
|
| +
|
| +function testFunction()
|
| +{
|
| + console.clear();
|
| + // This used to be a racy crash. Test some sequence of functions.
|
| + functions = [f2, f1, f2, f1, f2, f1, f2, f1];
|
| + functions.push(function() {});
|
| + functions.shift()();
|
| +}
|
| +
|
| +function f1() {
|
| + setTimeout(functions.shift(), 0);
|
| + document.body.appendChild("<throw_exception>");
|
| +}
|
| +
|
| +function f2() {
|
| + setTimeout(functions.shift(), 0);
|
| + new Range().compareBoundaryPoints(1, 2);
|
| +}
|
| +
|
| +var test = function()
|
| +{
|
| + var expectedErrorsCount = 8;
|
| +
|
| + InspectorTest.setQuiet(true);
|
| + InspectorTest.startDebuggerTest(step1);
|
| +
|
| + function step1()
|
| + {
|
| + DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
|
| + InspectorTest.runTestFunctionAndWaitUntilPaused(didPause);
|
| + }
|
| +
|
| + function didPause(callFrames, reason, breakpointIds, asyncStackTrace)
|
| + {
|
| + --expectedErrorsCount;
|
| + if (!expectedErrorsCount) {
|
| + InspectorTest.waitUntilNthMessageReceived(1, step2);
|
| + InspectorTest.resumeExecution();
|
| + } else {
|
| + InspectorTest.resumeExecution(InspectorTest.waitUntilPaused.bind(InspectorTest, didPause));
|
| + }
|
| + }
|
| +
|
| + function step2()
|
| + {
|
| + InspectorTest.dumpConsoleMessages();
|
| + completeTest();
|
| + }
|
| +
|
| + function completeTest()
|
| + {
|
| + DebuggerAgent.setPauseOnExceptions(WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions);
|
| + InspectorTest.completeDebuggerTest();
|
| + }
|
| +}
|
| +
|
| +</script>
|
| +</head>
|
| +<body onload="window.testRunner ? runTest() : testFunction()">
|
| +<p>
|
| +Tests that pausing on uncaught exceptions thrown from C++ bindings will not crash.
|
| +</p>
|
| +</body>
|
| +</html>
|
|
|