Commit Graph
85 Commits
Author SHA1 Message Date
Danil Somsikov 98c7a81dee Reland "Load source maps via chrome-extension:// on the frontend."
This reverts commit e124417c7c.

Reason for revert: Fixed the crash

Original change's description:
> Revert "Load source maps via chrome-extension:// on the frontend."
>
> This reverts commit 1e73eb6295.
>
> Reason for revert: Crashes devtools-on-devtools, see crbug.com/1281823
>
> Original change's description:
> > Load source maps via chrome-extension:// on the frontend.
> >
> > Bug: 212374
> > Change-Id: Ibfebf74d1416b4905f4c2f03124919c5b91ae721
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3306508
> > Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
> > Commit-Queue: Danil Somsikov <dsv@chromium.org>
>
> Bug: 212374
> Bug: 1281823
> Change-Id: Icae256ac8129d258bd1609431d9bc1a4b6866b5a
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3347794
> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
> Owners-Override: Kim-Anh Tran <kimanh@chromium.org>
> Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>

Bug: 212374
Bug: 1281823
Change-Id: I6b7a191dbecf0526fd14be3e5366bafed00ed2e5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3377203
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2022-01-11 10:12:34 +00:00
Danil Somsikov 338debd135 Test for source maps loading via chrome-extension://
Bug: 212374
Change-Id: I035e72df4d6f87e2939925507d6e3011645081e7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3338344
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2021-12-14 13:22:56 +00:00
Danil Somsikov 5393258246 Revert "Add test to verify correct routing of synthetic events"
This reverts commit 12509d78ac.

Reason for revert: Implemented browser test differently on the chromium side

Original change's description:
> Add test to verify correct routing of synthetic events
>
> Bug: 1117173
> Change-Id: I8a4a11394c547303e0a6508c6d9a83113bd58924
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264205
> Commit-Queue: Danil Somsikov <dsv@chromium.org>
> Auto-Submit: Danil Somsikov <dsv@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

Bug: 1117173
Change-Id: I86600c3fd34e394230429dcc01c07605d9029ee6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3284819
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2021-11-17 10:43:29 +00:00
Tim van der Lippe b5fb91dfa5 Move legacy file loading to legacy_test_runner
DevTools startup has slowed down a bit over the last year. The main
suspect that we have is the amount of files that are loaded at startup.
We have historically made significant improvements by removing file
loading out of the critical path, for example by removing the `module.json`
files from various modules. These have all attributed to improvements.

For our shell, we were still loading these legacy files. However, now
that we are fully type-checked with TypeScript, we have for the most part
removed our reliance on globals. There are only a handful of places where
we still rely on globals, most notably `MainImpl` for instantiation of
singletons and a single declaration in `ui/legacy/Panel.ts` which sets
values on `UI.panels`. Other than that, there don't appear to be anymore
usages of globals.

Therefore, we can move these legacy files out of our main shell and into
the legacy_test_runner. Doing so, our production build will now include
fewer files and hopefully also boot faster, while we still load the
legacy files for our layout tests (which still rely on globals).

It isn't clear what the performance impact will be, but cleaning this up
is good and we are relatively confident this will alleviate at least
some of the performance problems that have been reported.

R=yangguo@chromium.org

Bug: none
Change-Id: Ie34fbf6b82f3d1ba11bed623a9cc3d2a03c4c0c7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264212
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2021-11-15 14:39:55 +00:00
Tim van der Lippe 7634cc1a71 Add load method for legacy files
This method will be called in browser tests prior to executing the
test suite itself. These legacy files populate the global scope, which
is required for the JavaScript in this file to refer to these global
values.

R=dsv@chromium.org

Bug: none
Change-Id: I699923255fbe7a47e825b83d4be0e3da43521826
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3275778
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
2021-11-11 16:24:33 +00:00
Tim van der Lippe 264703fc11 Add loadLegacyModule on Runtime for browser tests
Browser tests use their separate test framework in Tests.js. This
specific test requires the full panel to be loaded, which isn't
necessarily true when the JavaScript function is executed.

To combat flakiness, the previous version of this test was explicitly
loading the elements panel using the legacy `loadModulePromise` method.
Instead, we should directly import the module. However, since `Tests.js`
runs in a different scope, we can't use relative imports there and we
have to let the runtime take care of that.

R=caseq@chromium.org

Bug: 1266640
Change-Id: If3448984c1f903d2503e8127f52f1385d95959ca
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3259534
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
2021-11-08 10:57:48 +00:00
Danil Somsikov 12509d78ac Add test to verify correct routing of synthetic events
Bug: 1117173
Change-Id: I8a4a11394c547303e0a6508c6d9a83113bd58924
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264205
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-11-08 09:48:29 +00:00
Danil Somsikov e210181996 Extract a few useful helper functions out of a specific browser test case
Bug: 1117173
Change-Id: Ia35fd52c8f8f88955dd705a968958d8f49e4cd1c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3264204
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2021-11-05 17:32:09 +00:00
Tim van der Lippe d3e05c3fad Remove panels/elements/module.json
R=szuend@chromium.org

Bug: 1127902
Change-Id: I210534efde7b283f98ddb421bbe9563e5f61ea1d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3253021
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-11-03 13:07:41 +00:00
Danil Somsikov 7ee0559917 Add JS code for websocket throttling browser test.
Bug: 423246
Change-Id: I27dcc6fbee60a9827299fdc84185c4590ec48107
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3245371
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-10-27 09:45:56 +00:00
Danil Somsikov 266e53e67b Handle failures from async JS functions in devtools browser tests.
Bug: None
Change-Id: Ic5b4e025a80cf0392892e79a0b812e8521036817
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3242145
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-10-25 16:38:59 +00:00
Danil Somsikov f9a6331c5a Try to speed up testOfflineNetworkConditions to address occasional timeouts
Bug: 1103146
Change-Id: Ibdba806f3bd3e7373e89401f85ae80248296d5f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3197723
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
2021-10-04 09:56:44 +00:00
Sigurd Schneider 9e9a51caf3 Update some test runners after underscore migration
Bug: chromium:1207342
Change-Id: I0ad653fd36421d8e14a013cf8d81cb5c94caffdf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3104561
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-08-19 13:07:43 +00:00
Jan Scheffler 01eab3cff4 [Underscore Migration] Migrate ui/legacy
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

R=tvanderlippe@chromium.org

Bug:chromium:1207342
Change-Id: I5ffc2c13077016933e6a77c34e94b279212ce004
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3093160
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-16 17:58:29 +00:00
Sigurd Schneider 5c91781036 Underscore migration in test runners
Bug: chromium:1207342
No-Tree-Checks: true
Change-Id: I8c3e011885f5eda53f5015e9ad76b1e44f47d949
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3097209
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-08-16 08:39:04 +00:00
Jan Scheffler 77646c7212 [Underscore Migration] Migrate panels/elements
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

R=tvanderlippe@chromium.org

Bug:chromium:1207342
Change-Id: I29215cc92260c73e86f2ae14001d3f78cb508362
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3090591
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-14 09:58:55 +00:00
Jan Scheffler 9befd490ed [Underscore Migration] Migrate panels/console
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

R=tvanderlippe@chromium.org

Bug:chromium:1207342
Change-Id: If2b9feb20552c1e3d10a9044aacd4656b80ec5b4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3090588
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-13 18:41:18 +00:00
Jan Scheffler a222c6375e Reland "[Underscore Migration] Migrate panels/sources"
This is a reland of 198dd8191b

Original change's description:
> [Underscore Migration] Migrate panels/sources
>
> This patch is part of the underscore migration that adds the private
> keyword to all properties that start with an underscore and removes the
> underscore.
>
> R=tvanderlippe@chromium.org
>
> Bug:chromium:1207342
> Change-Id: I0edea64030322835c035c083c8d2df486ef7ad1a
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3079534
> Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
> Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

Bug: chromium:1207342
Change-Id: If36a54ebbee5c69cc6edae08e82070e8f81b76ee
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3089348
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-13 18:06:34 +00:00
Changhao Han 8eb616e81a Revert "[Underscore Migration] Migrate panels/sources"
This reverts commit 198dd8191b.

Reason for revert: caused blink_web_tests to fail and tree closed: https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/DevTools%20Linux/5848/overview

Original change's description:
> [Underscore Migration] Migrate panels/sources
>
> This patch is part of the underscore migration that adds the private
> keyword to all properties that start with an underscore and removes the
> underscore.
>
> R=​tvanderlippe@chromium.org
>
> Bug:chromium:1207342
> Change-Id: I0edea64030322835c035c083c8d2df486ef7ad1a
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3079534
> Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
> Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>

Bug: chromium:1207342
Change-Id: I1e8036a094e5868799f826a5f5ae649b96ae43b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3087345
Auto-Submit: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2021-08-11 05:46:26 +00:00
Jan Scheffler 198dd8191b [Underscore Migration] Migrate panels/sources
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

R=tvanderlippe@chromium.org

Bug:chromium:1207342
Change-Id: I0edea64030322835c035c083c8d2df486ef7ad1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3079534
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-10 17:56:31 +00:00
Jan Scheffler d5bf879558 [Underscore Migration] Migrate entrypoints
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

Bug:chromium:1207342
Change-Id: Iec114859ae3f46457bafa2d823e11add202c6eb2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3077887
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-07 15:52:16 +00:00
Jan Scheffler 4ada331a50 [Underscore Migration] Migrate NetworkManager
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

Bug:chromium:1207342
Change-Id: I92fc31dc97471f4d6386cb2c193f6f2600d73719
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3075381
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-06 10:58:46 +00:00
Jan Scheffler 70f898c509 [Underscore Migration] Migrate DebuggerModel
This patch is part of the underscore migration that adds the private
keyword to all properties that start with an underscore and removes the
underscore.

Bug:chromium:1207342
Change-Id: Ifb76837cc7d343875d7abcca1f6846743a5991f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3074617
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Auto-Submit: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-06 10:15:16 +00:00
Kriti Sapra 56daf78ddb Updated no-multiple-empty-lines to only have 1 as max
DISABLE_THIRD_PARTY_CHECK=updated linting formatting
Bug: 1106746
Change-Id: I371bca95b7cf1e8b7eaa4f9e7c3860af4eedee3e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3057042
Commit-Queue: Kriti Sapra <kritisapra@google.com>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-07-28 14:10:15 +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
Tim van der Lippe eb876c6b1e Generate const enums in protocol.d.ts
Some files currently rely on the Protocol to be available on the
global scope. However, the Protocol definitions are defined in
a .d.ts file, which isn't available on runtime. Therefore,
attempting to import Protocol with non-type imports would retain
the imports in the `.js` files and break on runtime.

Since the only usages of the Protocol on runtime are the enums,
we can make them const, such that they get inlined as intended.
Then, `import * as` will work again, as the enums are inlined and
the import is removed from the `.js` file.

DISABLE_THIRD_PARTY_CHECK=Protocol update
R=jacktfranklin@chromium.org

Bug: 1208357
Change-Id: I749e57c9f51596866b61cab686c59f00bc8a8eb4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2897277
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-14 15:51:00 +00:00
Sigurd Schneider 3fec5ca7c7 Update DevTools Chromium DEPS.
TBR=machenbach@chromium.org,liviurau@chromium.org

DISABLE_THIRD_PARTY_CHECK=unblock roll

Bug: chromium:1209155
Change-Id: I9f029652effc0a8cd8cef8bb67d4d104f099e518
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2897257
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Devtools Autoroller <devtools-ci-autoroll-builder@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-05-14 11:07:59 +00:00
Changhao Han af7ba130f6 Re-enable and update test based on a browser-side change
This CL updates the frontend test case that matches the content of
"content/test/data/devtools/navigation.html" in Chromium with a hard-
coded string. The preceding backend CL is https://crrev.com/c/2879929.

Previous CL that disables the test: https://crrev.com/c/2882769

Bug: chromium:622660
Change-Id: Ic1630b350298991760258510086f993cdd05e24e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2883602
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2021-05-10 16:45:43 +00:00
Changhao Han 8df20e32d9 Temporarily disable test to update browser test content for Quirks Mode
Bug: chromium:622660
Change-Id: Ib9513332e8724782f28822a6403ff00caba86f91
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2882769
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Changhao Han <changhaohan@chromium.org>
2021-05-10 10:46:42 +00:00
Sigurd Schneider 5cfca2e793 Bump timeout for MSAN browsertest
Bug: chromium:1184201
Change-Id: I0d33822af8f7cad2cea78c64276a244968e2ef42
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2776024
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-03-22 12:54:44 +00:00
Sigurd Schneider bf7f160ae5 Bump timeout on Test
Bug: chromium:1184201
Change-Id: If628d41c0aeeda284d364c076c40063d0630a23a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2772038
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-03-18 08:23:27 +00:00
Sigurd Schneider d8d7e821fb Bump timeout for some browsertest
Bug: chromium:1184201
Change-Id: I602fbef37b8b1bd3b9a52df236a0bbb486d53801
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2763868
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-03-16 11:25:04 +00:00
Sigurd Schneider 376d27121b Bump the timeout for a test some more
A recent failure on the msan bot timed out after 91 seconds, and the
successful run took 51 seconds. My previous CL had increased the timeout
from 20 to 40 seconds, this CL bumps it to 200 seconds to see if the
flake is due to a timeout.

Bug: chromium:1185674
Change-Id: I2833ddba9c806bb3f97ddcb5387ea26561773ec6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2755975
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
2021-03-12 15:35:38 +00:00
Sigurd Schneider 72ac356e18 Add a slowness factor to the devtools_sanity_unittest
Some tests are timing out on bots that are generally slower than
usual, e.g. msan bots. This CL speculatively adds a slowness factor
to these tests to give them more time. The tests are currently dis-
abled from the chromium side, so once this CL is in, they need to
be activated again, and their flake status needs to be monitored.

Bug: chromium:1185674
Change-Id: Icce2b6e212c2e78a9b7d949773f8d8dff5f536f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2751893
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
2021-03-11 10:53:13 +00:00
Paul Lewis e407fce2e0 Update language in comments
Bug: 1177360
Change-Id: Ia19363faddcd7472e6815779e009e8b82ae984f2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2720214
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-02-26 10:39:25 +00:00
Benedikt Meurer 62b49da2c4 [console] Escape double quotes when printing strings.
This aligns the behavior of Chromium DevTools with the existing behavior
found in Firefox DevTools, making it easier for Web Developers to copy
and paste strings from the console (with fewer surprises when the
strings happen to contain double quotes).

This also updates the Scope view to use the same way to handle strings.

Before: https://imgur.com/yoo2UT6.png
After: https://imgur.com/eMnbmPi.png
Bug: chromium:1178530
Also-By: mathias@chromium.org, szuend@chromium.org, alexrudenko@chromium.org
Change-Id: I826c8c69acff7f8b443d29771f4485a69d55c61c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2698830
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2021-02-18 11:50:09 +00:00
Tim van der Lippe d7cfd14814 Fix no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

No-Presubmit: True
Bug: 1082789
Change-Id: Ic77884bf7e9b5dc74053915b3b10699368841b66
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2595268
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 12:40:16 +00:00
Tim van der Lippe f52d4a0d1e Remove remaining unrestricted annotations
These weren't found by the regexes used in the previous cleanups,
as their formatting was off. After this CL, no unrestricted
annotations remain in the codebase.

R=szuend@chromium.org

Bug: 1011811
Change-Id: Ief25abab1f981b2315adf61fc56765f2da69fb81
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2569760
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-12-02 15:41:12 +00:00
Wolfgang Beyer d451ecdd03 Consistently use SI units: 1000-based calculations, kB instead of KB
This CL follows up on https://crrev.com/c/1983391, so that DevTools
consistently uses and displays SI-based units for file/memory sizes.

Design doc: https://goo.gle/devtools-si
Bug: chromium:1035309

Disable test CL: https://crrev.com/c/2487269
Re-enable test CL: https://crrev.com/c/2485068

Change-Id: I14c13619c5734a8dd7c664c527810b1ae42e2276
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2485085
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-10-29 11:13:10 +00:00
Mohamed Amir Yosef cb01380ede [Autofill] Remove unnecessary keypress in a test in Test.js
This CL removes unnecessary keyboard "Down button" press in
testDispatchKeyEventShowsAutoFill test.

- Why it has be working before:
The reason this has been working so far is that the autofill
 menu contains exactly one element.

- Why it cannot stay as is:
However, upcoming features will introduce another entry in the
autofill menu to hide the suggestions. This extra navigation causes
the extra menu entry to be selected instead of the top entry.

- Why it still works now:
Because Chrome select the first item by default when the autofill
menu is shown.

Bug: 1030649
Change-Id: I74eab8c2be4c43b0937d0ee772fedbf2b359fa6f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2249929
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Dominic Battré <battre@chromium.org>
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
2020-06-23 20:07:03 +00:00
Jack Lynch b514f9f930 Rename forwarded shortcut test
This CL removes the term 'whitelist' per https://source.chromium.org/chromium/chromium/src/+/master:styleguide/inclusive_code.md

Bug: 174309
Change-Id: I324430b4d1326b1d73dae357c9ade92141627c3b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2255400
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
2020-06-20 03:18:30 +00:00
Songtao Xia 1e6926836e [DevTools] More info for Service Worker Fetch Responses
This is to re-land PR:

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2233229

The PR is reverted because web_test network/resource-priority.js is
flaky. The test is now disabled.

Add ResponseSource, CacheStorageCacheName, ResponseTime information
for ServiceWorker Fetch responses.

Based on previous work by Anubmat@microsoft.com.

Corresponding Chromium.src
changes: https://chromium-review.googlesource.com/c/chromium/src/+/2145090
Image: https://imgur.com/a/vchMPGZ

Explainer:
https://docs.google.com/document/d/1L-dhKWYoVECdoqVQ0hOKqtyWbk5LtluFWbZE8PJZtnU/edit
Bug: 1066595
Change-Id: Ie34d05d8d3c018b756127385e49d977248f9acc5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2251079
Commit-Queue: Songtao Xia <soxia@microsoft.com>
Reviewed-by: Kalon Hinds <kahinds@microsoft.com>
2020-06-19 15:10:31 +00:00
Kim-Anh Tran c2b2b0b863 Revert "[DevTools] More info for Service Worker Fetch Responses"
This reverts commit ce3397987e.

Reason for revert: Fails webtest in Chromium roll: https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests%20%28dbg%29%281%29/89664

TBR: soxia@microsoft.com,Rob.Paveza@microsoft.com,vidorteg@microsoft.com
Bug: chromium:1095582, chromium:1066595
Change-Id: I7af40a63e65f7f0daedbaeb68de4a779391ca3ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2248193
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2020-06-17 07:22:47 +00:00
Songtao Xia ce3397987e [DevTools] More info for Service Worker Fetch Responses
Add ResponseSource, CacheStorageCacheName, ResponseTime information
for ServiceWorker Fetch responses.

Based on previous work by Anubmat@microsoft.com.

Corresponding Chromium.src
changes: https://chromium-review.googlesource.com/c/chromium/src/+/2145090
Image: https://imgur.com/a/vchMPGZ

Explainer:
https://docs.google.com/document/d/1L-dhKWYoVECdoqVQ0hOKqtyWbk5LtluFWbZE8PJZtnU/edit
Bug: 1066595
Change-Id: I437966c567d3f90aa0b7c11a784de45cd41bfb14
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2233229
Commit-Queue: Songtao Xia <soxia@microsoft.com>
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Vidal Diazleal <vidorteg@microsoft.com>
2020-06-16 05:41:06 +00:00
Jack Lynch 080a0fd258 Add browser test for forwarded key whitelist changes
This CL adds a browser test for the changes in [1], which added logic to
update the whitelist of keys that the browser forwards to the DevTools
whenever the keybind set changes rather than just once at launch.
Forwarded keys don't work in remote debugging/hosted sessions, so they
can't be tested with an e2e test. There's also a small change here to
enable this new test in the backend: https://chromium-review.googlesource.com/c/chromium/src/+/2246552

[1] https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2231908

Bug: 174309
Change-Id: Ib511abe8192fce245e72b371954eb94c2aa3d907
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2244468
Reviewed-by: Robert Paveza <Rob.Paveza@microsoft.com>
Reviewed-by: Brian Cui <brcui@microsoft.com>
Reviewed-by: Jose Leal <joselea@microsoft.com>
Commit-Queue: Jack Lynch <jalyn@microsoft.com>
2020-06-15 21:13:43 +00:00
Peter Marshall d2f58c385c [test] Add a test that creates a new Browser window from a BrowserContext
This tests BrowserContexts in CDP, but requires a Browser to be present
and thus can't be a web test using content_shell.

See https://chromium-review.googlesource.com/c/chromium/src/+/2141097
for more detailed discussion.

This test just adds coverage without assertion.

Chrome CL: https://chromium-review.googlesource.com/c/chromium/src/+/2152793/

Change-Id: I872163371b8d41418d746d3c4199faf231c2b560
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2153440
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-04-21 13:45:07 +00:00
Andrey Kosyakov a08cb9b5eb Disable extensions when inspecting DOM UI
This disables front-end extensions when DevTools are attached to
privileged pages.

Bug: 1059577, 795595
Change-Id: I0971fd993bee63eea347ffa800c3cc72e09ba334
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2128732
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-01 22:27:20 +00:00
Simon Zünd b6414c9da6 Rename legacy global for protocol_client to ProtocolClient
R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Ibe6de479bcc18d28dceb7fa2266388ca0d65eae2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107558
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-03-19 12:48:42 +00:00