console-line-and-column.js 760 Bytes
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 line and column numbers in console messages');

7
Protocol.Runtime.enable();
8 9

addConsoleMessagePromise("console.log(239)")
10
  .then(message => InspectorTest.logMessage(message))
11
  .then(() => addConsoleMessagePromise("var l = console.log;\n  l(239)"))
12
  .then(message => InspectorTest.logMessage(message))
13 14 15 16
  .then(() => InspectorTest.completeTest());

function addConsoleMessagePromise(expression)
{
17 18 19
  var wait = Protocol.Runtime.onceConsoleAPICalled();
  Protocol.Runtime.evaluate({ expression: expression });
  return wait;
20
}