blob: bba27598911b812231852175f1eab0e507c239b1 [file] [log] [blame]
<html>
<head>
<script src="../../http/tests/inspector/resources/protocol-test.js"></script>
<script>
function appendBadScript()
{
let script = document.createElement("script");
script.src = "resources/file-with-syntax-error.js";
document.body.appendChild(script);
}
function test()
{
InspectorProtocol.sendCommand("Debugger.enable", {});
InspectorProtocol.sendCommand("Debugger.setPauseOnExceptions", {state: "all"}, InspectorProtocol.checkForError);
InspectorProtocol.sendCommand("Debugger.setBreakpointsActive", {active: true});
let suite = ProtocolTest.createAsyncSuite("TopLevelSyntaxError");
suite.addTestCase({
name: "TopLevelSyntaxErrorDontCrash",
description: "Make sure exceptions from top-level syntax errors don't cause us to crash.",
test(resolve, reject) {
InspectorProtocol.eventHandler["Debugger.paused"] = function(messageObject) {
InspectorProtocol.sendCommand("Debugger.resume");
ProtocolTest.pass("Paused on the breakpoint after syntax error at top level without crashing.");
resolve();
}
ProtocolTest.evaluateInPage("appendBadScript()");
}
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Making sure we don't crash when having a top-level syntax error.</p>
</body>
</html>