set-breakpoint-before-enabling.js 1.25 KB
Newer Older
1 2 3 4
// Copyright 2016 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.

5 6
let {session, contextGroup, Protocol} = InspectorTest.start('Tests that setting breakpoint before enabling debugger produces an error');

7
Protocol.Debugger.setBreakpointByUrl({ url: "http://example.com", lineNumber: 10  }).then(didSetBreakpointByUrlBeforeEnable);
8 9 10

function didSetBreakpointByUrlBeforeEnable(message)
{
11 12
  InspectorTest.log("setBreakpointByUrl error: " + JSON.stringify(
      InspectorTest.trimErrorMessage(message).error, null, 2));
13
  Protocol.Debugger.setBreakpoint({location: { scriptId: "4", lineNumber: 0, columnNumber: 0 }}).then(didSetBreakpointBeforeEnable);
14 15 16 17
}

function didSetBreakpointBeforeEnable(message)
{
18 19
  InspectorTest.log("setBreakpoint error: " + JSON.stringify(
      InspectorTest.trimErrorMessage(message).error, null, 2));
20 21 22 23 24 25 26
  Protocol.Debugger.setBreakpointOnFunctionCall({objectId: "4"}).then(didSetBreakpointOnFunctionCallBeforeEnable);
}

function didSetBreakpointOnFunctionCallBeforeEnable(message)
{
  InspectorTest.log("setBreakpointOnFunctionCall error: " + JSON.stringify(
    InspectorTest.trimErrorMessage(message).error, null, 2));
27 28
  InspectorTest.completeTest();
}