This CL adds a component that can be used to link to a network request.
The component optionally uses a RequestResolver to resolve the request
if only a requestId (in the form of an affected request) is provided.
The component updates its state once the request becomes available,
thereby supporting plasticity of the UI.
This is a plain reland of https://crrev.com/c/2960617. Landing
the CL originally uncovered a deficiency in the way our tests
were written, see crbug.com/1223300.
Bug: chromium:1217975
Change-Id: Ideccf4f9e64cf451a8c28583a9d72e717ff6706f
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_mac_rel
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2983021
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
A CSSStyleSheet imported as a CSS module script has the constructed
flag set
(https://wicg.github.io/construct-stylesheets/#cssstylesheet-constructed-flag).
This is because it is useful to treat imported CSSStyleSheets the same
way as stylesheets created via `new`. For example we want to be able
to add both to document.adoptedStyleSheets, and we want both to treat
@import rules the same way.
Up to this point DevTools didn't show sources for constructed
stylesheets because they were all assumed to be sheets created
with `new`. But, we do want to show sources for constructed sheets
created for CSS module script imports.
So, this change checks for an empty sourceURL when deciding whether
or not to show source for a constructed stylesheet.
This requires the Blink change [1], which starts passing an empty
sourceURL for `new`ed stylesheets.
[1] Blink change: https://chromium-review.googlesource.com/c/chromium/src/+/2964539
Bug: 1125357
Change-Id: I7163966c66c990647e40a72d0ef9d6ba30f41cfb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2964580
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Dan Clark <daniec@microsoft.com>
This refactors some of the issue tests to await the table contents
instead of just checking it. This refactoring allows to test content
that may change dynamically, e.g. when new information becomes available
such as a network request.
Bug: chromium:1223300
Change-Id: Iadced03ffbec6c23f521093168c7dcab82edc424
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2983020
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
This change adds the "copy" context menu and "store as global variable"
menu item for console evaluations that return primitive values.
These features was previously only enabled for objects and primitive
values inside objects.
We also fix a bug where we would send an invalid CDP command when users
copied primivites inside objects.
Bug: 1208389
Change-Id: I28a85d1bcfb8325098d4d35cee7f3e83e919185c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978352
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
This CL is a mix of changes within the DataGrid that improve the logic
around focusable cells. Prior to this CL the DataGrid stored one
value, which was the cell that the user would select if they tabbed
into the DataGrid. That got confusing as we used that value to also
represent the currently active cell that the user has clicked on.
This CL splits those concerns up into two properties, and improves how
we track when the user is or isn't focusing within the data-grid. It
also moves some event handlers from `click` to `focus` for the table
cells which is just a nice tidy up.
Bug: 1211346
Change-Id: If6449f5381134892705f7f42f24b226f8dbf170a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2935284
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
This is a reland of crrev.com/c/2959898 which caused the roll to fail.
This has been fixed by updating expectations in `front_end/Tests.js`
Original change's description:
> Improve Console display of strings
>
> We recently changed how we display the output to ensure that we always
> display valid JavaScript literals. Unfortunately, the current solution
> can be confusing to users, who might feel that the amount of escaping is
> excessive and makes the output unreadable.
>
> This change introduces `formatAsJSLiteral` that given a string escapes
> appropriate special characters and wraps the string in either single
> quotes, double quotes, or back ticks depending on the string content.
> The function furthermore escapes script tags to ensure that the result
> can be safely copied to HTML.
>
> Both regular Console output and preview have been updated to use this
> formatter instead of JSON.stringify for displaying strings.
>
> This change adds unit tests for the new formatter and rebaselines all
> e2e tests that depend on Console outputs.
>
> Doc: https://goo.gle/devtools-strings
> Bug: 1208389
> Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
> Commit-Queue: Johan Bay <jobay@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
Bug: 1208389
Change-Id: I6f443e65364d9707d02aeaab0227bd691300b417
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978351
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
When an e2e test times out, running promises aren't aborted. Instead,
any errors that are thrown are silently swallowed. When not being
careful, in-flight promises can still mess up state, or even never
detect timeouts. waitForFunction is especially vulnerable to this,
because it's running an infinite loop inside the test process. This CL
extends AsyncScopes to carry a flag when a timeout was triggered, which
allows waitForFunction to bail.
Bug: none
Change-Id: I30ebcc45419c4000a1b2a25096ca1211bf2400a0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978374
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
This CL adds offsetX/offsetY to click events allowing to be more
precise when clicking an element. This solves a problem
of clicking on complex inputs such as date inputs where it matters
where exactly the click happened.
As a drive-by I fixed the wrong viewport measurements being captured.
Happy to extract to a separate CL if the clicking part will be
controversial.
Bug: chromium:1221043
Change-Id: I9e18a3e77ddb99f93712f1065da1a0fe3a1cbfa7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2975282
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
This CL adds a component that can be used to link to a network request.
The component optionally uses a RequestResolver to resolve the request
if only a requestId (in the form of an affected request) is provided.
The component updates its state once the request becomes available,
thereby supporting plasticity of the UI.
Bug: chromium:1217975
Change-Id: I94faa598bb520d4cbdf003ca7858ec759fcc8a6c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2960617
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
With this patch, when running the unit tests with coverage enabled,
you can now specify the subset of folders you want. This allows us
engineers to run coverage reporting for the folders that they are
interested in, while ignoring all the other folders. Doing so
significantly speeds up coverage collection and therefore the
developer cycle on working on unit tests + coverage.
An example invocations of the unit tests with specific folders:
COVERAGE_FOLDERS='front_end/{ui/components,core/common}' npm run auto-unittest
COVERAGE_FOLDERS='front_end/ui/components' npm run auto-unittest
R=aerotwist@chromium.org
Bug: none
Change-Id: Ia29657bcf9848364e83ea99873c5a7e0d61f54be
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2969245
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
This is a reland of 9242d13569
which caused a failure on the chromeos bot. This has been fixed
in this CL by updating a test expectation in `front_end/Tests.js`
Original change's description:
> Improve Console display of strings
>
> We recently changed how we display the output to ensure that we always
> display valid JavaScript literals. Unfortunately, the current solution
> can be confusing to users, who might feel that the amount of escaping is
> excessive and makes the output unreadable.
>
> This change introduces `formatAsJSLiteral` that given a string escapes
> appropriate special characters and wraps the string in either single
> quotes, double quotes, or back ticks depending on the string content.
> The function furthermore escapes script tags to ensure that the result
> can be safely copied to HTML.
>
> Both regular Console output and preview have been updated to use this
> formatter instead of JSON.stringify for displaying strings.
>
> This change adds unit tests for the new formatter and rebaselines all
> e2e tests that depend on Console outputs.
>
> Doc: https://goo.gle/devtools-strings
> Bug: 1208389
> Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
> Commit-Queue: Johan Bay <jobay@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
Bug: 1208389
Change-Id: I63b343c5251611f688029c5b833fb7e1f777c6cc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2974927
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
This reverts commit 9242d13569.
Reason for revert: causes a failure on the chromeos bots which can be
fixed by updating an expectation file on the devtools side.
We therefore revert this CL and re-land with the expectation patched.
Original change's description:
> Improve Console display of strings
>
> We recently changed how we display the output to ensure that we always
> display valid JavaScript literals. Unfortunately, the current solution
> can be confusing to users, who might feel that the amount of escaping is
> excessive and makes the output unreadable.
>
> This change introduces `formatAsJSLiteral` that given a string escapes
> appropriate special characters and wraps the string in either single
> quotes, double quotes, or back ticks depending on the string content.
> The function furthermore escapes script tags to ensure that the result
> can be safely copied to HTML.
>
> Both regular Console output and preview have been updated to use this
> formatter instead of JSON.stringify for displaying strings.
>
> This change adds unit tests for the new formatter and rebaselines all
> e2e tests that depend on Console outputs.
>
> Doc: https://goo.gle/devtools-strings
> Bug: 1208389
> Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
> Commit-Queue: Johan Bay <jobay@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
Bug: 1208389
Change-Id: I4ab58ab724ffe8833d4a44c91da05e191d3a41bc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2974923
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
elements
With this CL, when the user focuses on an input element, the client
enters a special mode that handles event slightly differently:
- it publishes keyup events from the previous keyboard navigation
immediately.
- it captures the rest of keyboard events into a buffer.
- when a change or blur event is sent to the element, it interprets
the buffer and correctly publishes keyboard events that lead
to the navigation.
This way we lose some precise events that happen during interaction
with an input as we capture only the final result but we are also
able to maintain keyboard navigation events and handle complex
inputs like input[type=color|slider] where keyboard or mouse events
are not enough to capture the input. Additionally, we achieve shorter
scripts because keyboard events are grouped into a change event again.
Fixed: chromium:1221037, chromium:1221046
Change-Id: Id2949c1ec88c5becbffd262e5b95628d6e6300f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2972784
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
We recently changed how we display the output to ensure that we always
display valid JavaScript literals. Unfortunately, the current solution
can be confusing to users, who might feel that the amount of escaping is
excessive and makes the output unreadable.
This change introduces `formatAsJSLiteral` that given a string escapes
appropriate special characters and wraps the string in either single
quotes, double quotes, or back ticks depending on the string content.
The function furthermore escapes script tags to ensure that the result
can be safely copied to HTML.
Both regular Console output and preview have been updated to use this
formatter instead of JSON.stringify for displaying strings.
This change adds unit tests for the new formatter and rebaselines all
e2e tests that depend on Console outputs.
Doc: https://goo.gle/devtools-strings
Bug: 1208389
Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
This adds a setting to DevTools to disable auto-focusing on the
sources panel if a Debugger.paused event is received.
The context here is that extensions may be attached that do not
want that behavior (e.g. if source debugging is happening in
another panel that is provided by the extension).
Bug: b/182581017
Change-Id: I7a50c0c6eb7d5eb7abe45bcfafc40e394a4b8e17
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2960171
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Mraz Marian <mraz@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
This patch does a few things to allow network throttling conditions to
persist. 1: It enhances `Setting` with custom serializer support. This
is because 2: All fields on `NetworkManager.Conditions` values are
considered to uniquely identify instances, and one of those fields is
a title, which may or may not be localized. Since localization strings
may change (or users might decide to use different locales between
sessions), when instances are persisted, localized titles should not be
irrecoverably baked. Therefore 3. A custom serializer "massages" the
serialization data to properly persist these titles, using i18n keys
when needed, or the baked title when these values are user-provided and
no localization is used.
In the future, it might be worthwhile to consider avoiding mixing up
presentation state (e.g.: displayed titles) with behavioral
state (e.g.: the throttling amounts). In this particular case, the
title (along with other properties) doubles as both part of group of
fields which (loosely) uniquely identify instances, as well as the
literal string displayed in the UI, which leads to these complications.
Fixing this however does not seem to be in the scope of this bug.
Tracked by bug 1219425.
R=mathias@chromium.org
Bug: 986267
Change-Id: I47d42d454f945412e97b5e747a6253d54f888ee0
Signed-off-by: Victor Porof <victorporof@chromium.com>
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2947255
Commit-Queue: Victor Porof <victorporof@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Sometimes variables have values that have a special semantic name, such
as nullptr or enumerator labels. With this change, formatters can return
a description along with a formatted value that will be used as the
description of the remote object presenting the value.
Bug: 1217613
Change-Id: I52558b5e82c62bbf9216f200f6463bf24645d76e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2951134
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Change test that ensures that "Pending activities" are present.
Before this CL, we would test that a root group "Pending activities"
exists which contains the actual pending activities, e.g. MediaQueryList
in the test.
After the CL, we ensure a different graph where a that a regular object
named "Pending activities" retains the pending activities. In addition,
we test the the object retains the activities via some intermediate
backing store represented as InternalNode.
Blink dependency: https://crrev.com/c/2954763
Follow up removing old behavior: https://crrev.com/c/2960454
Bug: chromium:1056170
Change-Id: I1cfd3c13c55ca2d4c29056fdb2ac9fabbcbbc0bb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2956328
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
The intial AR CL got the interface wrong. This CL fixes the
corresponding `fromInspectorIssue` so it takes a complete protocol
issue object instead of just the details.
Drive-by: Issues without "Learn more" links currently have a somewhat
large empty bottom margin. This CL skips adding the link container div
when there are no links specified.
R=sigurds@chromium.org
Bug: chromium:1190735
Change-Id: Ia6c251020a0061d9b9b08fa12a9f80a1b07a3e90
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2960616
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>