Commit Graph
123 Commits
Author SHA1 Message Date
Jack Franklin e839c0cf22 Enable long import wrapping for JS imports
DISABLE_THIRD_PARTY_CHECK=big clang format run against all files in
front_end and test/

Bug: 1319340
Change-Id: I1fff63cb07544ccd0e3059fc901f9a48ff4af13b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3598879
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2022-05-03 10:22:12 +00:00
Wolfgang Beyer c4b6220179 Un-flake issues-toolbar e2e tests
Fixed: 1317582
Change-Id: I78c4f04c9304137c7a2707ca8e30483a3d5d1e40
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3602505
Auto-Submit: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-04-25 05:39:36 +00:00
Kim-Anh Tran fe90c54f96 [e2e] Disable flaky issues-toolbar tests
These tests are flaky on the mac bot, e.g.:
https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/7238/overview
https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/7235/overview

Bug: 1317582
Change-Id: I012352903f7b61a4ec818ba1b7608cf1e3f9e29c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3593394
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2022-04-19 12:48:37 +00:00
Benedikt Meurer 89174020fd [console] Fix live expression e2e test.
Bug: chromium:1260744
Change-Id: I001298ec21e42d6f469548dc2c82fb9e8f283e04
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3566004
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2022-04-04 07:03:42 +00:00
Benedikt Meurer f6f73b8d9e [console] Commit live expressions with 'Enter'.
The live expression editor in the Console tab didn't commit the live
expression when hitting 'Enter', but was adding new lines instead. That
was quite different from other parts of the DevTools UI. Instead the
user would have to hit 'Ctrl-Enter'. This CL changes the editor to also
commit on 'Enter' (leaving the 'Ctrl-Enter' shortcut as well for now).

Fixed: chromium:1260744
Change-Id: I1cf54f26508be43cc8f6ffb915c577898bc6df93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3563077
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2022-04-01 14:09:01 +00:00
Benedikt Meurer 9751653723 [console] Fix 'Expand recursively' to not go on forever.
This limits the max depth for 'Expand recursively' in the objects UI
(primarily in the Console tab) to 100 and also adds some smarts to the
component to not expand [[Prototype]] this way, as that's very likely
not what the developer had in mind.

Fixed: chromium:1272450
Bug: chromium:1199286
Change-Id: Id96a57051c05c3cb8448c52c687d08ae72eddf0f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3553118
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-03-28 13:21:47 +00:00
Jaroslav Sevcik 4819559329 Block urls in console.log %c formatter styles
We block some URL schemes (such as http or file) from style values in
the %c formatter for console.log. This is to prevent the requests from
bypassing security policies and leaking data.

Bug: chromium:1223475
Change-Id: I779cb95f523fcfbc84ce5edf1320d1ffde4d94fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3522264
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-03-15 10:55:37 +00:00
Jaroslav Sevcik 73229f7556 E2E tests for console log formatters
Bug: chromium:1223475
Change-Id: I413b7d0f85dd69b2e94d72564506dac3727c9f21
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3516094
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2022-03-14 07:59:16 +00:00
Kim-Anh Tran bbb5232d14 Revert "Enable synchronization on instrumentation breakpoints"
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>
2022-03-08 13:45:41 +00:00
Kim-Anh Tran 1b596f3b4b 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>
2022-03-08 12:08:41 +00:00
Benedikt Meurer 941f2a44ac [e2e] Add tests for invoking getters via (...) in the console.
This adds test cases for regular getters, getters installed on symbols,
and private getters, covering fixes that landed before as part of
https://crrev.com/c/3477097, https://crrev.com/c/3477112, as well as
https://crrev.com/c/3479594.

Bug: chromium:1296855
Change-Id: If584a8d779060f97da57b297fbe704595319554d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3504065
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-03-07 08:58:44 +00:00
Tim van der Lippe 0bc6fb0d2d Add back console autocompletion for map.get
With the upgrade to CodeMirror 6, we didn't include the autocompletion
for maps yet. This CL adds back for detection of `map.get(` which will
list all available keys on the map.

If the object is not a map, then the `evaluateExpression` will contain a
`result.exceptionDetails`, which means we gracefully ignore the result.
However, if it is map, we traverse the array and obtain all keys (which
are strings). The autocompletion will then also include the closing
paraenthesis, so that the result would become:

```js
const map = new Map([["somekey", 5], ["some other key"]]);
map.get(<auto-complete><press tab>
map.get("somekey")
```

The keys of the map are ordered based on the original appearance in the
keys array to ensure a deterministic autocompletion value.

Corresponding unit and e2e tests are written that verify the user story.

R=bmeurer@chromium.org

Bug: 1293807
Change-Id: I53dd9559e4a7e13fe4e36e934b66a693f606ec86
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3497704
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-03-03 12:20:36 +00:00
Juba Borgohain 2af14943bb Rename SameSiteCookieIssue to CookieIssue
These changes rename SameSiteCookieIssue to CookieIssue. A follow-up
CL will make the file name change. It rolls the browser_protocol.pdl
from Chromium to DevTools frontend. Removes the compatibility changes
introduced in [1].

DISABLE_THIRD_PARTY_CHECK=changes required due to renaming

[1]: https://crrev.com/c/3478766

Bug: 1254192
Change-Id: I45b86611edfa469238f7f30bf0006556e8f07fd2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3499339
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Juba Borgohain <chromiumjuba@gmail.com>
2022-03-02 14:20:02 +00:00
Tim van der Lippe 2d9a95ce7b Suppress all existing promise races
To suppress the races, we mark these invocations with `void` per
the instructions of `no-floating-promises`. This explicitly marks
these statements as side-effect promises.

Engineers can later analyze these void statements and determine
whether the promise races are intentional or accidental.

R=jacktfranklin@chromium.org

Bug: 1239617
Change-Id: I6b7a24cf21029d6ff73b112b3e8255ebab8c60ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3366467
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-04 16:08:08 +00:00
Yang Guo 94734947c4 Implement intuitive filter for console groups
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>
2022-01-03 15:38:16 +00:00
Tim Van der Lippe 7dd3791741 Revert "Add e2e-test for quoted key autocompletions in console"
This reverts commit 2bd951fb03.

Reason for revert: https://ci.chromium.org/ui/p/devtools-frontend/builders/try/devtools_frontend_win64_rel/b8828240229246668881/overview

Original change's description:
> Add e2e-test for quoted key autocompletions in console
>
> In https://crrev.com/c/3310606 I initially requested a unit test
> to be added to verify the bug in crbug.com/1275553 doesn't regress
> again. However, to reproduce the bug we need to evaluate expressions
> and use these in the later autocompletions.
>
> Therefore, let's add an e2e-test for this behavior and verify that both
> single quoted and double quoted keys are working as expected.
>
> R=​jacktfranklin@chromium.org
>
> Bug: 1275553
> Change-Id: I822ac2a778cda8bf2f8d13e5f1f9671707fb7c9f
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3323173
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>

Bug: 1275553
Change-Id: Ib57bbe8ba3b0eb13cf6edeb37f883dc7762498c6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3330257
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-12-10 13:49:32 +00:00
Tim van der Lippe 2bd951fb03 Add e2e-test for quoted key autocompletions in console
In https://crrev.com/c/3310606 I initially requested a unit test
to be added to verify the bug in crbug.com/1275553 doesn't regress
again. However, to reproduce the bug we need to evaluate expressions
and use these in the later autocompletions.

Therefore, let's add an e2e-test for this behavior and verify that both
single quoted and double quoted keys are working as expected.

R=jacktfranklin@chromium.org

Bug: 1275553
Change-Id: I822ac2a778cda8bf2f8d13e5f1f9671707fb7c9f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3323173
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2021-12-09 11:41:56 +00:00
Marijn Haverbeke f034f0b144 Reland "Port the console prompt to CodeMirror 6"
This reverts commit d635360712.

Reason for revert: tests should be fixed now

Original change's description:
> Revert "Port the console prompt to CodeMirror 6"
>
> This reverts commit 71cd14a337.
>
> Reason for revert: This CL caused the waterfall to go red
> https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/6200/test-results
>
> Original change's description:
> > Port the console prompt to CodeMirror 6
> >
> > And fix some autocompletion issues that came up when testing it.
> >
> > R=​tvanderlippe@chromium.org
> >
> > Bug: 1241848
> > Change-Id: I70d7fefa5fe3c9e09429d0b9a8fc4e39f0fe3f44
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289305
> > Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> > Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
>
> Bug: 1241848
> Change-Id: Ied3d3eb14ddf495e70445a1cb7076cdfab5f38fa
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291584
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Commit-Queue: Nancy Li <nancyly@chromium.org>
> Auto-Submit: Nancy Li <nancyly@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

Bug: 1241848
Change-Id: If88bafb86bd1730a0b81a0f362ed781584013289
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3295531
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Victor Porof <victorporof@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-22 16:10:18 +00:00
Nancy Li d635360712 Revert "Port the console prompt to CodeMirror 6"
This reverts commit 71cd14a337.

Reason for revert: This CL caused the waterfall to go red
https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/6200/test-results

Original change's description:
> Port the console prompt to CodeMirror 6
>
> And fix some autocompletion issues that came up when testing it.
>
> R=​tvanderlippe@chromium.org
>
> Bug: 1241848
> Change-Id: I70d7fefa5fe3c9e09429d0b9a8fc4e39f0fe3f44
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289305
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>

Bug: 1241848
Change-Id: Ied3d3eb14ddf495e70445a1cb7076cdfab5f38fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3291584
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Nancy Li <nancyly@chromium.org>
Auto-Submit: Nancy Li <nancyly@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-18 15:40:37 +00:00
Marijn Haverbeke 71cd14a337 Port the console prompt to CodeMirror 6
And fix some autocompletion issues that came up when testing it.

R=tvanderlippe@chromium.org

Bug: 1241848
Change-Id: I70d7fefa5fe3c9e09429d0b9a8fc4e39f0fe3f44
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3289305
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-18 13:04:57 +00:00
Jaroslav Sevcik 5c80b14d6f Re-enable a console e2e test
Re-enabling after a successful chromium roll. The test expectations
have been already updated in the disabling CL.

Bug: chromium:1268293
Change-Id: I2ef46bfc3748395870dba4744dd946c90a3dc476
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3270341
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2021-11-10 11:35:33 +00:00
Jaroslav Sevcik da95241a7a Disable a console e2e test with updated expectations
This is to unblock the roll (see the referenced bug).

We also update to the new expectations here.

Bug: chromium:1268293
Change-Id: Ie53af1cf16a4214d962da55b5ae83c64d75fa394
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3269826
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-11-09 09:24:32 +00:00
Tim van der Lippe 5841c2bf19 Revert "Include group children if group parent header is filtered"
This reverts commit cf6a634062.

Reason for revert: crbug.com/1263070

Original change's description:
> Include group children if group parent header is filtered
>
> This CL adds groupParent and groupChildren to consoleMessage. These are used to filter the console message if group parent or child has the filtered text.
>
> Test link: https://codepen.io/noobtiger/pen/QWpYamX
>
> Example gif: https://i.imgur.com/8RyRdcI.gif
>
> Bug:363796
> Change-Id: I874c9fd82d72ebb532d14b8b8ec46c529cdfd0b2
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3024878
> Commit-Queue: Chait Pinnamaneni <cpinnamaneni@microsoft.com>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>

Bug: 363796
Fixed: 1263070
Change-Id: I8fbc85ddd79cc16c85373d0b1b7fbcb1f0665d10
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3247430
Reviewed-by: Chait Pinnamaneni <cpinnamaneni@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2021-10-28 09:56:06 +00:00
Benedikt Meurer 277ee38b07 [console] Include column numbers in formatted errors.
In particular for minified JavaScript, having easy access to the column
number is crucial for debugging, and V8 already provides the column
information for errors, we just removed it so far when we pretty printed
the error stack.

Before: https://imgur.com/Y6uDiUy.png
After: https://imgur.com/0BWpQUD.png
Fixed: chromium:1073064
Change-Id: I3e26115ed129139f6e57eb07fda179d495cc848a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3234177
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>
2021-10-20 11:23:04 +00:00
Danil Somsikov 82873eeb1c Add option to hide CORS errors in console
Bug: 1251176
Change-Id: I321fc4864bbbb15bfd7ad46e5a1a7f7d066a0ebf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3175286
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-09-30 10:51:17 +00:00
chait pinnamaneni cf6a634062 Include group children if group parent header is filtered
This CL adds groupParent and groupChildren to consoleMessage. These are used to filter the console message if group parent or child has the filtered text.

Test link: https://codepen.io/noobtiger/pen/QWpYamX

Example gif: https://i.imgur.com/8RyRdcI.gif

Bug:363796
Change-Id: I874c9fd82d72ebb532d14b8b8ec46c529cdfd0b2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3024878
Commit-Queue: Chait Pinnamaneni <cpinnamaneni@microsoft.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-08-26 17:00:25 +00:00
Benedikt Meurer 60f6292764 [test][e2e] Rebaseline for ECMAScript accessors in previews.
This rebaselines the test expectations for the DevTools front-end after
https://crrev.com/c/3070701 landed in V8, and reenables the relevant
tests.

Fixed: chromium:1238221
Bug: chromium:1076820, chromium:1199247
Change-Id: I986185cad30912745f07a5b637d294402fb3bfaa
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3087347
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-08-11 09:01:36 +00:00
Alex Rudenko a041215e73 Disable tests blocking Chromium roll
Bug: chromium:1238221
Change-Id: Icc700b9cf140204a9d5bef7dfcc17c1952c2a2ed
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3083704
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2021-08-10 06:19:29 +00:00
Tim van der Lippe 72f2d4bcc8 Add e2e-tests for focus interactions of console messages
This replaces http/tests/devtools/console/viewport-testing/console-key-navigation.js
as an e2e-test.

R=aerotwist@chromium.org

Bug: 1203169
Change-Id: I461f742e84f13e44eecc74553ced77b5041d3340
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3010115
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-07-07 10:23:47 +00:00
Johan Bay 29236e333a Add "Copy string as {JavaScript, JSON} literal" context menu items
This change also fixes issues when copying other primitive values such
as -0, NaN, and bigints.

Bug: 1208389
Change-Id: I4dfb36679b87376b0e94bbc7b36fe7ecb513cac5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2982132
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-06-23 13:42:47 +00:00
Johan Bay 5715a7b980 Enable "copy" context menu for primitive values
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>
2021-06-22 13:08:48 +00:00
Johan Bay 9ea04a81e0 Reland "Improve Console display of strings"
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>
2021-06-22 11:19:09 +00:00
Tim van der Lippe 8b2737f432 Revert "Reland "Improve Console display of strings""
This reverts commit daf25bd29c.

Reason for revert: Test expectation failures in some browser tests https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8843811406261131888/+/steps/browser_tests__retry_shards_with_patch__on_Windows-10-18363/0/logs/Deterministic_failure:_DevToolsTest.TestDeviceEmulation__status_FAILURE_/0

Original change's description:
> Reland "Improve Console display of strings"
>
> 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>

Bug: 1208389
Change-Id: I446ad5502d946a22feddaa342be5a86c1854f1c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2974932
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-06-21 14:51:13 +00:00
Johan Bay daf25bd29c Reland "Improve Console display of strings"
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>
2021-06-21 10:43:58 +00:00
Johan Bay 10dcd44ac4 Revert "Improve Console display of strings"
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>
2021-06-21 07:58:38 +00:00
Johan Bay 9242d13569 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>
2021-06-18 12:13:54 +00:00
Sigurd Schneider a38d50d7d2 Ensure we're not hitting quirks mode in some e2e tests
Bug: chromium:1072335
Change-Id: I234d2ed0b23c8f55c2c6972a5751f0efa632f33b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2897289
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-05-14 16:13:50 +00:00
Jack Franklin a75ae7cbb3 Enforce import type when importing TS types.
Bug: none
Change-Id: I02ef1182143b7fe091ce92d59f04ac2188903e0d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2886925
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-05-11 14:00:22 +00:00
Benedikt Meurer 75003f999f Update and re-enable tests after [[Prototype]] change.
Fixed: chromium:1199243, chromium:1197019
Change-Id: Ic63e929fbfc0ce2ffe7979a3353a501aa69e70c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2835767
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2021-04-19 14:45:43 +00:00
Sigurd Schneider 2094d2ea25 Re-enable SAB-related UMA test
Drive-by: Deduplicate 4 copies of empty.html

Bug: chromium:1196618
Change-Id: I582ad73ec2b67a507e3ad1cdd7926def55fff5ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2831433
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-04-16 10:15:25 +00:00
Wolfgang Beyer 9566185260 Update DevTools Chromium DEPS.
TBR=machenbach@chromium.org,liviurau@chromium.org

Bug: none
Change-Id: I828b5677469bfd4e9bc63f1f2df6e79d0b2a5f33
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2827771
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Devtools Autoroller <devtools-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2021-04-15 08:45:52 +00:00
Tim van der Lippe 90d1c17188 Fix ESLint configuration with regards to spacing
ESLint and clang-format previously disagreed on whether there should
be a space before the arrow parentheses. Clang enforces the space
should be removed, which ESLint didn't want to.

Instead, we can configure ESLint to not add the extra space, to avoid
this inconsistency.

Bug: 1177242
Change-Id: Icc4435e86d6f6d9a0861f23f6b1cc95a5fd4d14f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2799753
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Brandon Goddard <brgoddar@microsoft.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-04-01 14:09:33 +00:00
Simon Zünd 95ba946d80 [e2e] Wait for preview to actually have content
The preview div 'console-eager-inner-preview' is always shown,
regardless whether a REPL evaluation has completed. Waiting for
a content span does actually wait for the Runtime.evaluate preview
call to complete.

This hopefully fixes the `uniqueContextId` error we see from time
to time on the mac bot.

Bug: chromium:1192052
Change-Id: Ie23f4ba17dcbf09408b963ca651408cd98d0954c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2790862
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2021-03-29 12:20:33 +00:00
Sigurd Schneider a82a68de5b Close autocomplete window in test
This is an attempt to ensure that no outstanding autocomplete
callbacks are present when the test finishes.

Bug: chromium:1192052, chromium:1134579
Change-Id: Ia1a4e3829199249a8d305180ff2bee4f2084e3b4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2784722
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-03-25 10:06:18 +00:00
Benedikt Meurer aef3b59541 [console] Correctly symbolize stack traces with async frames.
This is a pragmatic fix for the issue. It adds an E2E test to
specifically test for the relevant case. We clearly need to refactor
this logic in the future.

Fixed: chromium:1189091
Change-Id: I9f2a4937bb49435137568fcf7a634b36f61fa033
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2767267
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2021-03-17 17:01:26 +00:00
Sigurd Schneider 8d0fe54ba6 Apply source maps to all outputs that look like an Error stack
Previously, we'd only try to apply source maps to the following
error names:
  EvalError, ReferenceError, SyntaxError,
  TypeError, RangeError, Error, URIError

This CL applies it to everything ending in Error. This is a
developer pain point, and we're landing this band-aid until
we have a way to report structured stack traces from V8.

Bug: b/173826328
Change-Id: Ie6a0465c64ab3b442ac5359517e800dcacb88cb0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2766902
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
2021-03-17 13:49:37 +00:00
Sigurd Schneider f45f4e86f4 Visually distinguish issues by kind
This CL distinguishes the issues visually according to their kind,
and lists issue numbers per kind in the console tab as well. This
makes it possible to easily learn about the number of issues of
each kind from the console tab.

Bug: chromium:1183241
Change-Id: Idca745da99e3daef47c9b5d86494efa91ea9f55c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2763865
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-03-16 15:28:24 +00:00
Peter Marshall 51eb600f67 [tests] Enable console e2e tests
Wait for the final console evaluation to complete so that we don't
have pending evaluations when we navigate the devtools renderer.
This caused flaky errors after the context group had been destroyed.

I ran a stressor on the trybots with iterations=20 before and after
the fix.

Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_mac_rel
Fixed: 1134579
Change-Id: Ib5fdbc57d8aa18f6a1eb018516cc27f0cac30e00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2537966
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
2021-03-15 06:45:12 +00:00
Wolfgang Beyer 681ae6ae81 Hide ignore-listed sources in stack traces
We do not want source locations which are on the ignore-list to show up
in stack traces. Ignore-listed stack frames should only be shown after
clicking a 'show more' link.

This behaviour was broken, most likely since the introduction of async
live source locations.

This CL fixes the behaviour by updating the stack traces after the
LiveLocations have been updated.

Screenshots:
(before clicking 'show more') https://i.imgur.com/Gzrv5uw.png
(after clicking 'show more') https://i.imgur.com/DVj7EJ2.png

Bug: 1183325
Change-Id: I2fea963acbed6c6f18ea2426fd3a60960158b18d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2727495
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2021-03-09 13:04:55 +00:00
Sigurd Schneider 779e4e2501 Rename function to make waiting explicit in the name
Bug: chromium:1140516
Change-Id: I86ff9eab78f8c6c38f7b847a6332b6530e65a10b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2720364
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-02-26 09:26:25 +00:00