Commit 0708d535 authored by aandrey@chromium.org's avatar aandrey@chromium.org

DevTools: Add a test on a crash fix in ScriptDebugServer::wrapCallFrames.

This was fixed in V8 in r23858.

BUG=411196
TBR=loislo, yangguo

Review URL: https://codereview.chromium.org/558333003

git-svn-id: svn://svn.chromium.org/blink/trunk@181920 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent f455a2f8
CONSOLE ERROR: line 25: Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
CONSOLE ERROR: line 20: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
CONSOLE ERROR: line 25: Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
CONSOLE ERROR: line 20: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
CONSOLE ERROR: line 25: Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
CONSOLE ERROR: line 20: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
CONSOLE ERROR: line 25: Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
CONSOLE ERROR: line 20: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
Tests that pausing on uncaught exceptions thrown from C++ bindings will not crash.
Set timer for test function.
rethrow-error-from-bindings-crash.html:11 Console was cleared
rethrow-error-from-bindings-crash.html:25 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
rethrow-error-from-bindings-crash.html:20 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
rethrow-error-from-bindings-crash.html:25 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
rethrow-error-from-bindings-crash.html:20 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
rethrow-error-from-bindings-crash.html:25 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
rethrow-error-from-bindings-crash.html:20 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
rethrow-error-from-bindings-crash.html:25 Uncaught TypeError: Failed to execute 'compareBoundaryPoints' on 'Range': parameter 2 is not of type 'Range'.
rethrow-error-from-bindings-crash.html:20 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
<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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment