Adding a sandboxed file system via `window.webkitRequestFileSystem` to
hosted mode enables using local overrides in hosted mode. Since e2e-
tests run in hosted mode, this enables adding e2e tests for local
overrides. This CL adds a first such e2e-test testing a simple response
header override.
Bug: 1313436
Change-Id: I6eb3e2ff9de336fa62648647fe48042009743d18
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3620364
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
This is a reland of commit 1b596f3b4b.
Changes:
1. Gated behind an experiment
2. Removed changes that are currently not used since it's gated
(i.e. test changes)
Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I19553ddac9530fa3ccac6b245a3dd89da88c6d51
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3542248
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
This refactors the test cases to avoid racing with the Revealer in the
devtools-frontend by explicitly opening the desired files ahead of time
and only checking that DevTools doesn't reveal a second copy of the
file.
Drive-by-fix: Also fix the checking for hitting the correct breakpoint
by aligning the testing logic here with how it's done in other places
(the old CodeMirror execution line detection no longer works anyways).
Bug: 670180
Fixed: 1157455
Change-Id: I382a7956bef66df53d3fb95571cb31cc086d9105
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3581032
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Eric Leese <leese@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
This simplifies the test added with https://crrev.com/c/2704585 to check
that breakpoints are set in multiple scripts correctly in the presence
of code splitting, by just loading the two scripts straight into the
page, which still catches regressions, but avoids the race between the
sourcemap parsing logic and the invocation of the function from the
second script.
Fixed: chromium:1272490
Bug: chromium:979000, chromium:1180794, chromium:1142705
Change-Id: I49f4973a12c7e350784d2495474eafec38b4424d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3529449
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Victor Porof <victorporof@chromium.org>
Commit-Queue: Victor Porof <victorporof@chromium.org>
Sourcemap entries don't contain end positions, but assume that they just
span until the next entry, which works fine, except for the last entry
in a sourcemap for which we don't know the end line/column. Previously
we put the pair Infinity:0 there, but the Infinity cannot be transfered
as `line` in a `ScriptPosition`, since the CDP has type int32 for this
field.
This changes the sentinel position to use the maximum signed 32-bit
integer for both end line and end column for the last sourcemap entry,
which is definitely outside any valid script and can safely be
transfered to V8.
Bug: chromium:1232347
Fixed: chromium:1305956
Change-Id: I7775b67d0d9c8a086bb65e08759e13e334754bcb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3522023
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
The hover preview for private field accesses was broken if there was a
sourcemap, because it was removing the private id token from the
expression string. It was also broken in many cases for keyed property
accesses.
This refactors the tokenization logic to properly recognize (and
support) private id tokens, and to allow arbitrary text in between
'[' and ']' tokens, in particular things like `obj[x + 1]` will now
work correctly.
This adds a bunch of unit tests and also two e2e tests that check that
the popover preview works correctly in case of sourcemaps coming from
either TypeScript or Terser.
Fixed: chromium:1303407
Change-Id: I9ed76fe444af552e7e11ab7097d699b499fee395
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3513352
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
This reverts commit 1b596f3b4b.
Reason for revert: closed the tree, more blink tests to adapt
Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I9eccdf065820854746ec7ad4643362859c9960e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3506653
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Owners-Override: Kim-Anh Tran <kimanh@chromium.org>
This CL introduces the synchronization point for setting
breakpoints on new scripts using instrumentation breakpoints.
Instrumentation breakpoints will trigger at the first statement
of a newly run script. Afterwards we wait for all resources
that we need to set a breakpoint (if one is cached for that
particular script), set it, and resume.
Note: this will not correctly synchronize the case where we
just opened DevTools or just created a new target, as at this
point some scripts might have started running. For this, we
need to synchronize the Debugger.enable call, which is something
that is left to take care of.
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
This is a first step towards evaluating expressions with source map
resolution in the console.
This patch only replaces single variables expressions with the name
inferred from the source map. The feature is behind a flag because it is
still far from being usable (e.g., no support for more complex
expressions, auto-complete, partial expression evaluation, fallback UI,
etc.).
Bug: chromium:1297047
Change-Id: I5d4a233f65cf27112c370eeb81c509cd3e14623d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3461558
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
This CL adds a test where we:
1) Edit a page script
2) Set a breakpoint in the edited script
3) Reload the page (this reverts the script)
Ideally the breakpoint moves in the reverted script in a smart way.
We have some infrastructure for that in place on the V8 side, but the
DevTools frontend does not account for it correctly.
Once the bug is fixed we can update the test expectations accordingly.
Rather than landing a skipped test, we expect the bugged state so we
get notified if the test starts breaking for unrelated reaons.
R=kimanh@chromium.org
Bug: 1216904
Change-Id: Ife4f4538b216c42888013363ef5e6cefb9b1392a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3447410
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
This patch makes the scope chain pane listen to ithe source map attach
event so that it can update itself when a source map is added or
replaced. This also fixes a race where scope variable names are not
updated if the source map is fully loaded only after the first
breakpoint is hit.
As part of this patch we also started tracking source maps in the scope
resolution cache so that we can ignore the cached scope if it was
computed against an old source map.
The E2E test here adds a source map to a script without a source map and
checks that the scopes view is eventually updated according to the
source map.
Bug: chromium:1294682
Change-Id: Ia2b091ebbc0d50520f0388f35b0d727821bce0d1
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3439918
Auto-Submit: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
We set the parent URL on child targets (such as workers) so that
sourceURL and sourceMappingURL are resolved relative to the
frame URL. We also add a test that checks that the source-mapped
file appears in the Source/Page pane.
Bug: chromium:1277002
Change-Id: I107b21d806420c98f39344bdf5902072fd398da0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3342111
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Previously we would forward F8 events on the target page
to the SourcesPanel. This would trigger two separate resume actions,
one in the inspector overlay, and one in DevTools front-end. The
forwarding is still required, as we are tracking the user metrics.
This adds a check to the SourcesPanel to only act on the resume,
if it's not coming from the forwarding, and if the overlay is enabled.
Fixed: chromium:937130
Change-Id: I17bebd95b53d9c8e802a5b2a0320e7b4225f144d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3220152
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
This change updates the DebuggerPlugin class's decorationByBreakpoint
map to key on both Breakpoint and UILocation when adding and removing
breakpoing decorators in the UI. Before this change, if a Breakpoint was
associated with multiple UILocations, then attempting to remove that
breakpoint would not update all of its decorators correctly. This is
because the first breakpointRemoved event that was received would
remove the Breakpoint entry from decorationByBreakpoint, and then any
subsequent breakpointRemoved events for the same Breakpoint with a
different UILocation would have no effect.
After the change, breakpoints with multiple UILocations and decorators
are updated correctly. An e2e test has been added to verify this.
Bug: 1251675
Change-Id: Ia33593af5a3efcb08cf219d2e21932406760f3fd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3205603
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Brandon Walderman <brwalder@microsoft.com>
With https://crrev.com/c/3172834 we previously aligned the stepping
behavior of sourcemaps (both JavaScript and WebAssembly) with that
of DWARF (WebAssembly only), but we still gated that adjustment
behind the 'Empty sourcemap auto-stepping' experiment.
This enables the aligned behavior by default and removes the (confusing)
and according to usage metrics almost completely unused experiment.
Bug: chromium:1232347
Change-Id: Idfa62a2cfa337d4ced3486baa3249cb95a8d8c16
Fixed: chromium:1018234
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3197720
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@google.com>
This reverts commit a09263601b.
This change did not cause the original breakage, so we are relanding
the original CL as is.
Original change's description:
> Improve stepping with source maps
>
> This aligns stepping through source maps with stepping through
> Wasm+Dwarf: when stepping from a location, we lookup the corresponding
> source location and then make sure we skip all the raw/compiled
> locations that correspond to that source location.
>
> To implement the skipping, we reuse the skipList mechanism that is
> already used for stepping through Wasm+Dwarf.
>
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3093161
Bug: crbug.com/1232347
Change-Id: Ibe83e035aea73f070949902051dd8f100dde6f32
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3172834
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
This aligns stepping through source maps with stepping through
Wasm+Dwarf: when stepping from a location, we lookup the corresponding
source location and then make sure we skip all the raw/compiled
locations that correspond to that source location.
To implement the skipping, we reuse the skipList mechanism that is
already used for stepping through Wasm+Dwarf.
Bug: crbug.com/1232347
Change-Id: Ib19695b2078256282189df5b10d9165633849799
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3093161
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>