v8/test/inspector/debugger/set-script-source-exception.js
Alexey Kozyatinskiy 5e57f660ae [inspector] prepare inspector tests for liveedit rework
Extracted from https://chromium-review.googlesource.com/c/v8/v8/+/1105493

R=dgozman@chromium.org

Bug: v8:7862
Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Ibd2fb5341e617929b07b26abea31a1579a456d93
Reviewed-on: https://chromium-review.googlesource.com/1107312
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53899}
2018-06-20 21:40:46 +00:00

27 lines
914 B
JavaScript

// Copyright 2017 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} = InspectorTest.start(
'Check that setScriptSource completes correctly when an exception is' +
' thrown.');
Protocol.Debugger.enable();
InspectorTest.runAsyncTestSuite([
async function testIncorrectScriptId() {
InspectorTest.logMessage(await Protocol.Debugger.setScriptSource(
{scriptId: '-1', scriptSource: '0'}));
},
async function testSourceWithSyntaxError() {
contextGroup.addScript('function foo() {}');
const {params} = await Protocol.Debugger.onceScriptParsed();
const msg = await Protocol.Debugger.setScriptSource({
scriptId: params.scriptId,
scriptSource: 'function foo() {\n return a # b;\n}'
});
InspectorTest.logMessage(msg);
}
]);