forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevTools] take into account column in uiLocationToRawLocation with s…
…ourceMap .. otherwise inline breakpoints are just broken for files with source map. R=lushnikov@chromium.org Bug: chromium:760229 Change-Id: I2658258ac6f4b6f255583bdea16ede4ad99940f3 Reviewed-on: https://chromium-review.googlesource.com/716660 Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Reviewed-by: Andrey Lushnikov <lushnikov@chromium.org> Cr-Commit-Position: refs/heads/master@{#508443}
- Loading branch information
Showing
6 changed files
with
90 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...tests/devtools/sources/debugger-breakpoints/inline-breakpoint-with-sourcemap-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Checks inline breakpoint in file with sourcemap | ||
Setting breakpoint at second line.. | ||
breakpoint at 2 | ||
inline breakpoint at (2, 4) | ||
inline breakpoint at (2, 26) disabled | ||
inline breakpoint at (2, 41) disabled | ||
inline breakpoint at (2, 56) disabled | ||
inline breakpoint at (2, 71) disabled | ||
inline breakpoint at (2, 84) disabled | ||
inline breakpoint at (2, 85) disabled | ||
Disabling first breakpoint and enable forth breakpoint at line.. | ||
breakpoint at 2 | ||
inline breakpoint at (2, 4) disabled | ||
inline breakpoint at (2, 26) disabled | ||
inline breakpoint at (2, 41) disabled | ||
inline breakpoint at (2, 56) | ||
inline breakpoint at (2, 71) disabled | ||
inline breakpoint at (2, 84) disabled | ||
inline breakpoint at (2, 85) disabled | ||
Calling function foo.. | ||
Script execution paused. | ||
Paused at: (2, 56) | ||
Call stack: | ||
0) (arrow.ts:3) | ||
1) foo (arrow.ts:5) | ||
2) (:1) | ||
Script execution resumed. | ||
|
46 changes: 46 additions & 0 deletions
46
...ests/http/tests/devtools/sources/debugger-breakpoints/inline-breakpoint-with-sourcemap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
(async function test() { | ||
TestRunner.addResult('Checks inline breakpoint in file with sourcemap'); | ||
await TestRunner.loadModule('sources_test_runner'); | ||
await TestRunner.showPanel('sources'); | ||
|
||
await SourcesTestRunner.startDebuggerTestPromise(); | ||
/* arrow.ts, js generated with tsc arrow.ts --inlineSourceMap --inlineSources | ||
function foo() { | ||
function create() { | ||
return (a: number) => (b: number) => (c: number) => (d: number) => a + b + c + d; | ||
} | ||
create()(1)(2)(3); | ||
} | ||
*/ | ||
await TestRunner.evaluateInPageAnonymously(`function foo() { | ||
function create() { | ||
return function (a) { return function (b) { return function (c) { return function (d) { return a + b + c + d; }; }; }; }; | ||
} | ||
create()(1)(2)(3); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyb3cuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJhcnJvdy50cyJdLCJuYW1lcyI6WyJmb28iLCJmb28uY3JlYXRlIl0sIm1hcHBpbmdzIjoiQUFBQTtJQUNFQTtRQUNFQyxNQUFNQSxDQUFDQSxVQUFDQSxDQUFTQSxJQUFLQSxPQUFBQSxVQUFDQSxDQUFTQSxJQUFLQSxPQUFBQSxVQUFDQSxDQUFTQSxJQUFLQSxPQUFBQSxVQUFDQSxDQUFTQSxJQUFLQSxPQUFBQSxDQUFDQSxHQUFHQSxDQUFDQSxHQUFHQSxDQUFDQSxHQUFHQSxDQUFDQSxFQUFiQSxDQUFhQSxFQUE1QkEsQ0FBNEJBLEVBQTNDQSxDQUEyQ0EsRUFBMURBLENBQTBEQSxDQUFDQTtJQUNuRkEsQ0FBQ0E7SUFDREQsTUFBTUEsRUFBRUEsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0EsQ0FBQ0E7QUFDcEJBLENBQUNBIiwic291cmNlc0NvbnRlbnQiOlsiZnVuY3Rpb24gZm9vKCkge1xuICBmdW5jdGlvbiBjcmVhdGUoKSB7XG4gICAgcmV0dXJuIChhOiBudW1iZXIpID0+IChiOiBudW1iZXIpID0+IChjOiBudW1iZXIpID0+IChkOiBudW1iZXIpID0+IGEgKyBiICsgYyArIGQ7XG4gIH1cbiAgY3JlYXRlKCkoMSkoMikoMyk7XG59XG4iXX0=`); | ||
|
||
let sourceFrame = await new Promise(resolve => SourcesTestRunner.showScriptSource('arrow.ts', resolve)); | ||
TestRunner.addResult('Setting breakpoint at second line..'); | ||
SourcesTestRunner.toggleBreakpoint(sourceFrame, 2, false); | ||
await SourcesTestRunner.waitJavaScriptSourceFrameBreakpoints(sourceFrame); | ||
await SourcesTestRunner.dumpJavaScriptSourceFrameBreakpoints(sourceFrame); | ||
|
||
TestRunner.addResult('Disabling first breakpoint and enable forth breakpoint at line..'); | ||
SourcesTestRunner.clickJavaScriptSourceFrameBreakpoint(sourceFrame, 2, 0); | ||
SourcesTestRunner.clickJavaScriptSourceFrameBreakpoint(sourceFrame, 2, 3); | ||
await SourcesTestRunner.waitJavaScriptSourceFrameBreakpoints(sourceFrame); | ||
await SourcesTestRunner.dumpJavaScriptSourceFrameBreakpoints(sourceFrame); | ||
|
||
TestRunner.addResult('Calling function foo..'); | ||
TestRunner.evaluateInPageAnonymously('foo()'); | ||
let callFrames = await SourcesTestRunner.waitUntilPausedPromise(); | ||
let pausedLocation = Bindings.debuggerWorkspaceBinding.rawLocationToUILocation(callFrames[0].location()); | ||
TestRunner.addResult(`Paused at: (${pausedLocation.lineNumber}, ${pausedLocation.columnNumber})`); | ||
SourcesTestRunner.captureStackTrace(callFrames); | ||
SourcesTestRunner.completeDebuggerTest(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters