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>
The change [1] added style pane support for indicating that highlight
rules are overridden in the highight cascade (showing them as
crossed-out). However, custom highlights were left out because custom
highlights of different names would otherwise be shown as overriding
each other, since all custom highlights were grouped into the same
cascade.
This change enables support for custom highlights by splitting
them up into separate cascades for each highlight name.
See [2] for a screenshot of this.
An alternative approach would be to change the inspector protocol
and the StyleResolver on the Blink side such that custom
highlights start out grouped by highlight name. However the
necessary style resolver changes look to be complex enough that
it's probably simpler (or at least not more complicated overall)
to arrange things on the DevTools side.
[1] https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3563627
[2] https://docs.google.com/document/d/1WHYEp6JfMjsAZLghCJa03HG5FEQEzRCi-naa5dmlQr4/edit?usp=sharing
Bug: 1024156, 1164461
Change-Id: Ib684889b347d9797b6f9c993fe6626053deb8c1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3603063
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
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>
The main request for a Service Worker scripts currently gets stuck in
the "(pending)" state.
This test will currently fail like:
```
1) network/network-datagrid_test.ts: The Network Tab
shows the main service worker request as complete:
AssertionError: expected { Object (status, time, ...) } to have property 'status' of '200OK', but got '(pending)'
+ expected - actual
-(pending)
+200OK
```
The issue appears to be rooted in the misalignment of network request ids
between the inial network CDP event for the request compared with
subsequent events.
Running this test with an executable built from https://chromium-review.googlesource.com/c/chromium/src/+/3544685
passes.
Bug: 1304795
Change-Id: I14f8d64d58fad16e4ddb0acf2058ed4c613c5500
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3566669
Reviewed-by: Eric Leese <leese@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
When filling the iframe that's showing the preview for html requests, we
encode the html contents as a data-url and also set the sandbox property
on the frame. This avoids remaking the request from within devtools.
It's still possible for the iframe to spawn some requests. With this CL
we prevent requests by setting the csp for the iframe.
Bug: 833147
Change-Id: Id77321465c91fd68e5d6c6c3681e48b39cb32d14
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3557989
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@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>
Until now, console group titles were always shown despite filter.
Now, a console message is shown if:
- its message content matches the filter
- the title of the group (or parent group, grand-parent group, etc.
matches the filter.
If a console message is shown, then the group it belongs to
(including parent group, grand-parent group, etc.) are also shown.
Fixed: 1068788
Change-Id: I04f280b185d183bd9992b9b65ef9a9d20da0a36f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3364094
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@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>
This CL adds content to the endpoints table in the Application panel's
Reporting API view. For each endpoint it shows the origin which
configured the endpoint, the endpoint name and the endpoint URL.
Bug: 1200732
Change-Id: Ie3b94bd81d85d7c6001fd38484434d989a32f9cf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291155
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
The click event only fires for elements that receive both a mousedown
and a mouseup event. Since DataGrid elements in the Network panel get
replaced every time a message is received on WebSockets, the click
event doesn't get fired if you click before a message and release after
the message. To fix this we'll listen for the mousedown event instead.
This has the added benefit that the request panel becomes visible
sooner, making it feel more responsive.
Fixed: 1222382
Change-Id: Ia44c47a90b4822530081caf63aec682e9f32186c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3293092
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@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>
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>