Commit Graph
90 Commits
Author SHA1 Message Date
Michael Achenbach 1473de827c Whitespace change to test bots
This also makes the whitespace file a data deps to force running
swarming tests on whitespace changes.

Change-Id: Ib71180609efca36ff78bc4339c6cccf1e90c673e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1872589
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
2019-10-22 12:20:54 +00:00
Mathias Bynens 032591d692 Fix formatting
Running `npm run format-py` on a fresh checkout results in some
changes. This patch commits those changes so that they do not
become part of unrelated CLs.

Change-Id: Ie8051c7907ac9624e9fe870e2137b9a9fe2769c3
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1871869
Auto-Submit: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
2019-10-21 13:02:51 +00:00
Michael Achenbach e18baf2ce8 Whitespace change to test bots
Change-Id: I2a7101deed226ab672d582253d19f5715e75e3af
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1871556
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
2019-10-21 11:10:23 +00:00
Yang Guo 015c235224 Add whitespaces.txt
TBR=machenbach@chromium.org

Change-Id: Icc4e94c16f099c2883418c63d46a79497b907fa8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1869655
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
2019-10-21 08:29:11 +00:00
Yang Guo 4fd355cc40 Switch to new repository 2019-10-21 08:08:56 +02:00
Christy Chen d638d21ae7 DevTools: Update localization error message to warn about placeholder <ex>
The presubmit script did not warn about the missing example tag for placeholders.
This Cl added more details to the error message.
https://imgur.com/a/9I7hXfx

Bug: 941561
Change-Id: I2a950e4dd1fecc0a4dfea7467216c71c964c97b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1845580
Commit-Queue: Christy Chen <chrche@microsoft.com>
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#707569}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 21c1a43916ce6b405246e60c5c21613f372fdb68
2019-10-18 22:45:52 +00:00
Yang Guo d584b90e85 Move unit tests to test/unittests
Change-Id: I4dd89cae3441f1da5ae4b2a393a3ff66a67f6451
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859787
Auto-Submit: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#705524}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 94a941ed8494e3751c04db857a8f0513b98258a5
2019-10-14 12:17:30 +00:00
Tim van der Lippe a4d448c312 Migrate console_counters/ to ESM
- Also upgrade the refactor script to automatically add the
extensionpoint to the BUILD.gn to save myself some typing.

Bug: 1006759
Change-Id: I3f789f96122569141194ce26ac288f01af68f6e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1852209
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704600}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e55e98bc0ca76229380e3bca5a78e15d953da0c5
2019-10-10 13:38:29 +00:00
Tim van der Lippe 226fc2224b Migrate extensions/ to ESM
Bug: 1006759
Change-Id: I55ff55840cbf00a108cb0f3630cf5b489bf3aac2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849386
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#704574}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a332bbea8c8a4c485dc20685b810c082c14a7b70
2019-10-10 12:17:12 +00:00
Mandy Chen 218413b440 DevTools: Only log error stack to avoid duplicate error messages
The localization parser currently logs the error stack and error message
when running without the --autofix flag. Since the stack includes the error
message, this CL takes out the call to log the error message to avoid
duplicate error messages.

Bug: 941561
Change-Id: If8c5f05148be6e2eb666eb17cefe649715006209
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1820088
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#703813}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c9ef1c432008114038aade7d70fe815a036e7068
2019-10-08 17:47:21 +00:00
Tim van der Lippe 9b7d21d126 Migrate sdk/ to ESM
Bug: 1006759
Change-Id: I3f5917ab3f5b3fb823ca460c395301ba19eed2df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841792
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703381}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5a7c8d13f806d781e8edb96a9b1f152d4fe1258a
2019-10-07 18:48:07 +00:00
Yang Guo d81769871b DevTools: introduce devtools_paths.py to manage paths
The new devtools_paths.py detects whether the frontend code
is hosted in the Chromium repository, in an external repository during
standalone build, or in an external repository during integrated build.

R=aerotwist@chromium.org

Change-Id: I800ab63f985d203359e387f9c81df9270929b437
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1839791
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703014}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: dd36b0f6b3fdbaa069facb239773596ae816febb
2019-10-04 20:30:35 +00:00
Tim van der Lippe 798ea142bc Migrate protocol/ to ESM
- InspectorBackendCommands is now loaded via ES Modules

Bug: 1006759
Change-Id: I2826518a55e1f4fd7704cfb04120885f9aa9b604
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837772
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702821}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 01369246df2350c6be2b0118d69313a7f56486bb
2019-10-04 12:01:23 +00:00
Tim van der Lippe bc38bd6964 Minify ES Modules files
After converting the `ui/` folder to ESM, there was a significant performance
regression in terms of file size of the `resources.pak`. It turns out that we
were not minifying ESM files, but we did do that before with Closure.

Update the `copy_devtools_modules` to also invoke rjsmin to minify the
JavaScript source code.

Before:
$ du -h -B K out/Default/resources.pak
12096K	out/Default/resources.pak

After:
$ du -h -B K out/Default/resources.pak
11752K	out/Default/resources.pak

Before the original CL transforming `ui/` landed:
$ du -h -B K out/Default/resources.pak
11860K	out/Default/resources.pak

This means that after converting `ui/` to ESM, we saved 90KB. We suspect
this is because we are no longer transpiling to ES5, but instead serve
source ES6.

Bug: 1010910
Change-Id: I7dd07ff788d014e9f9a8e25e168c58c010cd00af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1837814
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#702500}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8d2021d8394b9a248436fb6976070629cdffd961
2019-10-03 18:36:31 +00:00
Tim van der Lippe 50cfa9b19d Migrate host/ to ESM
Bug: 1006759
Change-Id: Ib72e0acbb20c4579e708cd79a67ffd0bc2073b70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829102
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701509}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b2641f7a9893b50ab7f74d8bc5b7ca7743b0a530
2019-10-01 10:40:58 +00:00
Tim van der Lippe 99e59b8c29 Migrate Runtime.js to ESM
Introduce a new namespace "Root" to be able to disambiguate between
Runtime the namespace and Runtime the object.

roll CodeMirror
The above line is necessary to fix the presubmit, which complains
about CodeMirror changes. This is only updating a type reference.

Bug: 1006759
Change-Id: I04941d9f18649701060e3035f7eeb2ef3abb51e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829708
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#701257}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 17cc008cf6ad28c6e8c07c638a1b380ca30e7f79
2019-09-30 20:00:59 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Tim van der Lippe 7b190160cd Move InspectorFrontendHostAPI to externs
This was an interface that was already treated as an extern, but was not
explicitly in the externs.js file.

Bug: 1006759
Change-Id: I95301c059cc1213931498788cff553f955abb646
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829098
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#700724}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c6c1bf57acb1c9ed7304674e7d5df51122cb22b1
2019-09-27 15:10:44 +00:00
Paul Lewis 0cd45e3e49 Reland "[DevTools]: Moves common to ES modules"
This reverts commit 25a9b3bd7404d49e55772ffba046ed8df65ad14e.

Reason for revert: Memory snapshots work again

Original change's description:
> Revert "[DevTools]: Moves common to ES modules"
>
> This reverts commit e064553334d4b0c925f0b1f0e2e0234be66b71be.
>
> Reason for revert: Memory tool fails to take heap snapshots with this
> error: https://imgur.com/hzR9Eqw
>
> Original change's description:
> > [DevTools]: Moves common to ES modules
> >
> > This CL converts the contents of the common/ folder over to ES modules
> > from the current custom module system. It includes statements in each
> > file that will pollute the global namespace, allowing the non-ESM code
> > to continue working as before.
> >
> > Bug: 1006759
> > Change-Id: Ib591e49155000381f85999a5da6c467ad0160996
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816563
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#699728}
>
>
> Change-Id: Ic0d526780451e8bb4de538f11c85859a3badfb0f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1006759
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825463
> Commit-Queue: Yang Guo <yangguo@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#699835}

Bug: 1006759
Change-Id: I48c7e84262bb295e5830cac8a79a274226df046c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825420
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699981}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 75a39ca7ac8dcfc6a830db07a5a389ca9ab27b1d
2019-09-25 22:19:27 +00:00
Brandon Goddard 52dd33a0b0 Revert "[DevTools]: Moves common to ES modules"
This reverts commit e064553334d4b0c925f0b1f0e2e0234be66b71be.

Reason for revert: Memory tool fails to take heap snapshots with this
error: https://imgur.com/hzR9Eqw

Original change's description:
> [DevTools]: Moves common to ES modules
>
> This CL converts the contents of the common/ folder over to ES modules
> from the current custom module system. It includes statements in each
> file that will pollute the global namespace, allowing the non-ESM code
> to continue working as before.
>
> Bug: 1006759
> Change-Id: Ib591e49155000381f85999a5da6c467ad0160996
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816563
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Paul Lewis <aerotwist@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#699728}

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: Ic0d526780451e8bb4de538f11c85859a3badfb0f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1006759
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1825463
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699835}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 25a9b3bd7404d49e55772ffba046ed8df65ad14e
2019-09-25 16:58:21 +00:00
Tim van der Lippe 620071a920 Update the input language level of Closure compiler
This allows us to use more modern features like Object spread.

Change-Id: I3a8a119443cf43b27e3ac9390e188408976d82e2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1823847
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699736}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: f7348e93165873639e57c78bd877e0640a7a6317
2019-09-25 13:33:32 +00:00
Paul Lewis 69d7770a96 [DevTools]: Moves common to ES modules
This CL converts the contents of the common/ folder over to ES modules
from the current custom module system. It includes statements in each
file that will pollute the global namespace, allowing the non-ESM code
to continue working as before.

Bug: 1006759
Change-Id: Ib591e49155000381f85999a5da6c467ad0160996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1816563
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699728}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e064553334d4b0c925f0b1f0e2e0234be66b71be
2019-09-25 13:14:47 +00:00
Paul Irish e7b977eb54 DevTools: In l10n presubmit, apply ignore list to modified files
Change-Id: I31caa742e32727fcdd3c992fca0f815fefbf9740
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1818609
Auto-Submit: Paul Irish <paulirish@chromium.org>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699714}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ea03feb17d2dac76b800aa9dd586a1812527bc2c
2019-09-25 12:23:38 +00:00
Mandy Chen e64996c39e DevTools: Add scripts to generate id mapping for localizable strings
The backend changes[1] for localizing devtools leverage the existing
webui functionalities, which consume a list of id mappings from the id
of a string used in the frontend (i.e. the English string) to the IDS_
key of the string in the corresponding grdp file. Example:

const LocalizedString kLocalizedStrings[] = {
  ...
  {"Editable", IDS_DEVTOOLS_2c09e798bf8c5a82d211331c82893a0f},
  ...
}

This patch adds scripts that generate the structure. The output will be
two files, devtools_ui_strings_map.h and .cc, under
<generated files root directory>/chrome/browser/ui/webui
(e.g. D:/chromium/src/out/Release/gen/chrome/browser/ui/webui).

The design is to create a build step that calls generate_devtools_ui_strings.py,
which then calls generate_devtools_ui_strings.js. Integration into the build
system will come as a another patch, because it depends on the first set of
changes[2].

Example arguments to generate_devtools_ui_strings.js to generate output
files (invoke under '--root_gen_dir', e.g. D:/chromium/src/out/release/gen
in the example below):

['D:/chromium/src/third_party/node/win/node.exe',
'D:/chromium/src/third_party/blink/renderer/devtools/scripts/build/generate_devtools_ui_strings.js',
'--root_gen_dir', 'D:/chromium/src/out/release/gen',
'--output_header', 'chrome/browser/ui/webui/devtools_ui_strings_map.h',
'--output_cc', 'chrome/browser/ui/webui/devtools_ui_strings_map.cc']

[1]: https://crrev.com/c/1672628
[2]: https://crrev.com/c/1628927

Bug: 941561
Change-Id: Ic03dae24cd074219790c6eec5df3183c24bf15a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671848
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#699370}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3927e5494ba1866261dc577d8f93660fd9f04b5d
2019-09-24 16:12:59 +00:00
Tim van der Lippe fe98df5af5 Use the version of esprima in devtools-node-modules
We are going to update the version of Esprima to understand dynamic imports, but it turned out that this script was actually using a completely different version of Esprima. Update this path to resolve to our devtools-node-modules instead.

Bug: 1006759
Change-Id: I1f0b791a5afe86e94258b7b3a044f7e756b923f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821559
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699302}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b596ed2ae4fb36ddb4f9682b8c2b93262bc084e7
2019-09-24 12:11:30 +00:00
Mandy Chen 08fdf04698 DevTools: Clean up localization parsing scripts
This CL:

* updates parseLocalizableResourceMaps to return maps of localizable
resources
* removes localizable resources from exports
* fixes non-async functions
* fixes existing parsing error

This CL is in preparation of https://crrev.com/c/1671848.

Bug: 941561
Change-Id: Id18faf3086fb8d9d3c75b110733784ba95cf56e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1814539
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#699005}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c108074d7327d594c73b0f6dc578da42632ba404
2019-09-23 19:57:20 +00:00
Mandy Chen 5128cc6c7a DevTools: Autofix out-of-date grdp/grd file paths in presubmit
This patch adds the functionality to autofix grdp/grd file paths that are
out of date.

* <part> file entries that reference non-existent grdp files in
devtools_ui_strings.grd are removed.

* Grdp files with the wrong names are renamed (format should be
<folder_name>_strings.grdp) along with the corresponding part file entries
in devtools_ui_strings.grd.

* If more than one grdp files are under a directory, an error is issued to
ask the user to consolidate these grdp files.

This patch will eliminate the need to manually fix grdp/grd inconsistensies
(e.g. https://crrev.com/c/1637591) after unexpected changes (e.g. audits2
renamed to audits: https://crrev.com/c/1614691).

Bug: 941561
Change-Id: Ie413fe070a2f5b4319a12ce07653ec1a79912215
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703044
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#698917}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 3329fdbaecd905bf1a98a5ae24893d700571ba70
2019-09-23 16:46:00 +00:00
Tim van der Lippe 7ca9ec190d Copy individual symbols and comments for Closure
Closure was unhappy with the `Object.assign` solution. Instead, use
individual assignments and add the relevant comments, so that Closure
can understand what is going on.

Sample output:

```
/*Legacy exported object*/
self.UI = self.UI || {};

/*Legacy exported object*/
UI = UI || {};

//TODO(http://crbug.com/1006759): Add type information if necessary
UI.TextEditor = TextEditor;

//TODO(http://crbug.com/1006759): Add type information if necessary
UI.TextEditor.prototype = prototype;

/** @enum {symbol} */
UI.TextEditor.Events = Events;
```

Bug: 1006759
Change-Id: Ib0e571cc027f544b316a3e3ccf8c3d606273d887
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819248
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698878}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c1c9f965bfcf2dbcd8f868414874c085f4ff9515
2019-09-23 13:39:17 +00:00
Christy Chen fc8ed9f851 DevTools: Localize tags for command menu search to work properly
The tags in Module.json are not localized. This change localize them,
so when users type the word in command menu with languages other than
English, the results can show up correctly.

Two scripts edited (check_localized_strings.js, CommandMenu.js).
Grdp changes are generated automatically, with manually added descriptions.

Bug: 941561
Change-Id: I3dc1f8f8b72e21748f5fa84c1c60b9597aa0414a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1809673
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Mandy Chen <mandy.chen@microsoft.com>
Commit-Queue: Christy Chen <chrche@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#698223}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b75a4b07ffd26a61fef0344123701241bb75002c
2019-09-19 22:18:44 +00:00
Tim van der Lippe 64bc95bd4b Automatically generate module file with exports
Since we are reading the file names anyways, we can also generate the
actual module name. Also delete the UI.js, since we will be generating
that now (albeit lowercase).

Change-Id: I16730392aa49927ac32da939a88399cc6ac49340
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810999
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698034}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: e80d12cb681bcd49518ec50763ede737bc86a136
2019-09-19 15:35:50 +00:00
Tim van der Lippe 790b9298b7 Reland "Reland "Convert ui/ARIAUtils.js to an ES module""
This reverts commit 901bcc219d9204748f9c256ceca0f2cd68061006.

Reason for revert: ESLint errors fixed

Original change's description:
> Revert "Reland "Convert ui/ARIAUtils.js to an ES module""
>
> This reverts commit ec810baced8e07ca3e9f2b801703be433807d2a2.
>
> Reason for revert: causing eslint failures on Linux Tests:
> /b/s/w/ir/third_party/blink/renderer/devtools/front_end/dom_extension/DOMExtension.js
>   817:10  error  'onInvokeElement' is defined but never used  no-unused-vars
> https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests/81950
>
> Original change's description:
> > Reland "Convert ui/ARIAUtils.js to an ES module"
> >
> > This is a reland of b3373919f86df10c190a8672ca828c7ea4b920e5
> >
> > Original change's description:
> > > Convert ui/ARIAUtils.js to an ES module
> > >
> > > ES modules allow files to explicitly import and export symbols [1].
> > > This patch migrates ARIAUtils.js to an ES module, while maintaining
> > > backwards compatibility with existing usages of `window.UI.ARIAUtils`.
> > >
> > > The build system is updated to copy these modules verbatim, as it no
> > > longer require pre-processing to be loaded. The `module.json` no longer
> > > includes this file as a script, to make sure it is not double-bundled
> > > into `shell.js`. Instead, it is added to the new field `modules`, which
> > > contains all modules. By doing so, it becomes clear which files are
> > > converted to modules already and which require the legacy references
> > > to the global scope.
> > >
> > > This module and future modules will be imported from `root.js`, which is
> > > added to all existing HTML application files.
> > >
> > > Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
> > >
> > > [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
> > >
> > > TBR=jochen@chromium.org
> > >
> > > Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> > > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> > > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > > Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> > > Cr-Commit-Position: refs/heads/master@{#697238}
> >
> > Change-Id: I7544cbf4364d0b1a3c2f137a4d17a1afdb1d4aed
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810534
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#697626}
>
> TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org
>
> Change-Id: I445fd35f135450cd9e8ed4c69bf913662f461ce6
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811989
> Reviewed-by: Aaron Gable <agable@chromium.org>
> Commit-Queue: Aaron Gable <agable@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#697824}

Bug: 1004860
Change-Id: Idac8108b1b47488faa08473d2450a7ee0bdde96e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1813503
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#698029}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4adc7b63ea9ea093206c62363c8fdf50fc64aed8
2019-09-19 15:14:16 +00:00
Aaron Gable c9d00052df Revert "Reland "Convert ui/ARIAUtils.js to an ES module""
This reverts commit ec810baced8e07ca3e9f2b801703be433807d2a2.

Reason for revert: causing eslint failures on Linux Tests:
/b/s/w/ir/third_party/blink/renderer/devtools/front_end/dom_extension/DOMExtension.js
  817:10  error  'onInvokeElement' is defined but never used  no-unused-vars
https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests/81950

Original change's description:
> Reland "Convert ui/ARIAUtils.js to an ES module"
>
> This is a reland of b3373919f86df10c190a8672ca828c7ea4b920e5
>
> Original change's description:
> > Convert ui/ARIAUtils.js to an ES module
> >
> > ES modules allow files to explicitly import and export symbols [1].
> > This patch migrates ARIAUtils.js to an ES module, while maintaining
> > backwards compatibility with existing usages of `window.UI.ARIAUtils`.
> >
> > The build system is updated to copy these modules verbatim, as it no
> > longer require pre-processing to be loaded. The `module.json` no longer
> > includes this file as a script, to make sure it is not double-bundled
> > into `shell.js`. Instead, it is added to the new field `modules`, which
> > contains all modules. By doing so, it becomes clear which files are
> > converted to modules already and which require the legacy references
> > to the global scope.
> >
> > This module and future modules will be imported from `root.js`, which is
> > added to all existing HTML application files.
> >
> > Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
> >
> > [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
> >
> > TBR=jochen@chromium.org
> >
> > Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> > Reviewed-by: Yang Guo <yangguo@chromium.org>
> > Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> > Cr-Commit-Position: refs/heads/master@{#697238}
>
> Change-Id: I7544cbf4364d0b1a3c2f137a4d17a1afdb1d4aed
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810534
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#697626}

TBR=yangguo@chromium.org,aerotwist@chromium.org,tvanderlippe@chromium.org

Change-Id: I445fd35f135450cd9e8ed4c69bf913662f461ce6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811989
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Aaron Gable <agable@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697824}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 901bcc219d9204748f9c256ceca0f2cd68061006
2019-09-18 23:35:18 +00:00
Mandy Chen 436efc76eb DevTools: Improve localization presubmit file parsing error message
Currently, if an unsupported JS feature is used, localization presubmit
checks will fail with the raw error message from esprima, the JS parsing
library. This CL wraps a try-catch block around the parsing call and outputs
a nice error message that specifies the file location and the reason.

Before:
Error: Line 9: Unexpected token =

After:
Error: DevTools localization parser failed:
third_party\blink\renderer\devtools\front_end\security\SecurityPanel.js: Line 9: Unexpected token =
This error is likely due to unsupported JavaScript features. Such features
are not supported by eslint either and will cause presubmit to fail. Please
update the code and use official JavaScript features.


Bug: 941561
Change-Id: If945563f84224232155a7de7cf597c5395a0cbb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729729
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#697675}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 2b4a1abab0661e491ab275768f8f174cf5686c46
2019-09-18 17:43:40 +00:00
Mandy Chen 1e9d87b8f2 DevTools: Create a grdp file for shared strings to avoid confusion
Since the current localization system uses a unique ID for each string that
is calculated based on the the md5 hash of the string, each string
in the grdp files needs to be unique. However, there are strings in the
frontend that appear multiple times. When such strings are moved across
folders, sometimes a seemingly random grdp file is changed by the autofix
script. (See https://crrev.com/c/1683826 for an example)

This CL introduces shared_strings.grdp, a file dedicated for strings that
are shared across folders/grdp files. Instead of putting these strings in
the grdp files that come first when sorted alphabetically, they live in
shared_strings.grdp and have common descriptions among all instances of
such strings. This way if shared strings need to be moved, it's more clear
what's going on.

Note that this CL contains a lot of changes that are generated automatically
(e.g. shared strings are removed from their current locations), so here's
the list of actual changes that need to be reviewed:

* shared_strings.grdp file is added to front_end/langpacks and front_end/langpacks/
devtools_ui_strings.grd
* path to shared_strings.grdp is added to scripts/localization_utils/localization_utils.js
* in scripts/localization_utils/check_localized_strings.js, the parser marks
strings that appear more than once as shared and set the target grdp file to be
shared_strings.grdp
* shared_strings.grdp file is checked by scripts/check_localizability.js for
localizability violations
* shared_strings.grdp messages have common descriptions added

Bug: 941561
Change-Id: I00db23854656509f2f03988e70adc0109b6e09d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1800918
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#697667}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d10bf7c5a97cf9184866c1117935c199bacf7ff3
2019-09-18 17:18:15 +00:00
Tim van der Lippe 63a4d3dcd6 Reland "Convert ui/ARIAUtils.js to an ES module"
This is a reland of b3373919f86df10c190a8672ca828c7ea4b920e5

Original change's description:
> Convert ui/ARIAUtils.js to an ES module
>
> ES modules allow files to explicitly import and export symbols [1].
> This patch migrates ARIAUtils.js to an ES module, while maintaining
> backwards compatibility with existing usages of `window.UI.ARIAUtils`.
>
> The build system is updated to copy these modules verbatim, as it no
> longer require pre-processing to be loaded. The `module.json` no longer
> includes this file as a script, to make sure it is not double-bundled
> into `shell.js`. Instead, it is added to the new field `modules`, which
> contains all modules. By doing so, it becomes clear which files are
> converted to modules already and which require the legacy references
> to the global scope.
>
> This module and future modules will be imported from `root.js`, which is
> added to all existing HTML application files.
>
> Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
>
> [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
>
> TBR=jochen@chromium.org
>
> Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> Cr-Commit-Position: refs/heads/master@{#697238}

Change-Id: I7544cbf4364d0b1a3c2f137a4d17a1afdb1d4aed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810534
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697626}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ec810baced8e07ca3e9f2b801703be433807d2a2
2019-09-18 15:31:38 +00:00
Tim van der Lippe 29011f8a88 Introduce migration script for JavaScript modules
Example invocation of the script:

./refactor-folder-to-es-modules.sh ui

It will consequently refactor all files in the ui folder to JavaScript
modules. It will also update the BUILD.gn variables to remove the
references from the old all_devtools_files into the new modules
variables.

Change-Id: I35ad6360b15d1aff250afffc8a28774c4e8cc1ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808867
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#697602}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6d48f36bc75c558ac1ee899ccb20877b800e9410
2019-09-18 14:33:56 +00:00
Takuto Ikuta 4cabd3c98e Revert "Convert ui/ARIAUtils.js to an ES module"
This reverts commit b3373919f86df10c190a8672ca828c7ea4b920e5.

Reason for revert: https://ci.chromium.org/p/chromium/builders/ci/Linux%20Tests/81914

Original change's description:
> Convert ui/ARIAUtils.js to an ES module
> 
> ES modules allow files to explicitly import and export symbols [1].
> This patch migrates ARIAUtils.js to an ES module, while maintaining
> backwards compatibility with existing usages of `window.UI.ARIAUtils`.
> 
> The build system is updated to copy these modules verbatim, as it no
> longer require pre-processing to be loaded. The `module.json` no longer
> includes this file as a script, to make sure it is not double-bundled
> into `shell.js`. Instead, it is added to the new field `modules`, which
> contains all modules. By doing so, it becomes clear which files are
> converted to modules already and which require the legacy references
> to the global scope.
> 
> This module and future modules will be imported from `root.js`, which is
> added to all existing HTML application files.
> 
> Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing
> 
> [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
> 
> TBR=jochen@chromium.org
> 
> Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
> Reviewed-by: Jochen Eisinger <jochen@chromium.org>
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> Cr-Commit-Position: refs/heads/master@{#697238}

TBR=yangguo@chromium.org,jochen@chromium.org,aerotwist@chromium.org,mathias@chromium.org,tvanderlippe@google.com

Change-Id: I550f1082755ef4b9e7bc778e3afdaef324dae03a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1808954
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#697355}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 53558661a67dcdf9d11bb2571d43ebca6f504670
2019-09-17 20:55:22 +00:00
Tim van der Lippe 321ff26d6d Convert ui/ARIAUtils.js to an ES module
ES modules allow files to explicitly import and export symbols [1].
This patch migrates ARIAUtils.js to an ES module, while maintaining
backwards compatibility with existing usages of `window.UI.ARIAUtils`.

The build system is updated to copy these modules verbatim, as it no
longer require pre-processing to be loaded. The `module.json` no longer
includes this file as a script, to make sure it is not double-bundled
into `shell.js`. Instead, it is added to the new field `modules`, which
contains all modules. By doing so, it becomes clear which files are
converted to modules already and which require the legacy references
to the global scope.

This module and future modules will be imported from `root.js`, which is
added to all existing HTML application files.

Design Doc: https://docs.google.com/document/d/1h9dOy3nNPNfZ2AtZXzB-DwJqG4Oo37WWvKLCuzCcPzo/edit?usp=sharing

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

TBR=jochen@chromium.org

Change-Id: Ie79c8f2fce3aff96fa28af0b575eae39bfe8e1a5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1748949
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#697238}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b3373919f86df10c190a8672ca828c7ea4b920e5
2019-09-17 15:56:41 +00:00
Paul Lewis e441d1d360 [DevTools] Adds support for Karma tests
Change-Id: I1ea19eee040360d3a73ffaa72ccf15bceff80317
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1806858
Auto-Submit: Paul Lewis <aerotwist@google.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696789}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a163f8024d6cdf3c5ddb0ca5ac0468ec73d9a576
2019-09-16 14:40:20 +00:00
Tim van der Lippe ffa7862d4e Update Closure compiler to v20190729
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.

Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.

Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
2019-09-16 12:07:12 +00:00
Mandy Chen 609679bdac DevTools: Localize geolocations
The city names in settings are not localized because the localization
parser doesn't know about them. Modify the parser to recognize these
strings.

Bug: 941561
Change-Id: If1974dd471b3d646c900dea6932f427a273c19f6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769300
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#695189}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 6c93ef31f05965de3b56da700067b57890cfd1ef
2019-09-10 16:04:08 +00:00
Jacques Chen 4f6a876498 Make use of grit's brotli support for brotli-compressed protocol.json
-Change protocol.json to be Brotli compressed by grit
-Have protocol.json be decompressed by GetDataResourceBytes
-Remove brotli.gni that is no longer used

Bug: 826858
Change-Id: I2c49715f85508f494a57d65b09ada446c2efefec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1728183
Commit-Queue: Sam Maier <smaier@chromium.org>
Reviewed-by: Sam Maier <smaier@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#690865}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 277f819d03cf4d45aa8d44661333122ed08ac6c8
2019-08-27 20:23:21 +00:00
Mandy Chen d97200bd72 DevTools: Report missing description and placeholder example as localizability violation in presubmit
This patch adds a localizability check to the presubmit script that reports
errors for empty descriptions, after https://crrev.com/c/1688716 adds auto-
generated descriptions.

Example error messages:

third_party/blink/renderer/devtools/front_end/accessibility/accessibility_strings.grdp
Line 36: missing description for message with the name "IDS_DEVTOOLS_185551542d4a950d6ed4a90e0875dfde"
third_party/blink/renderer/devtools/front_end/animation/animation_strings.grdp Line 10:
missing <ex> in <ph> tag with the name "BUTTON_TEXTCONTENT"

This patch also improves error reporting by changing full file path to partial
path from src/ so that it's more consistent with the presubmit error style.

Note: there may be new strings added without a description and/or placeholder
example while this patch is on review. In that case I will fix them so the
check can be enabled without any problem.

Bug: 941561
Change-Id: If609d234b67acb76dfd9c66e2f8880d9875034cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1693028
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#681975}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 1404bfcfd225f2963874e37299d890b1f3119e72
2019-07-29 21:13:39 +00:00
Tim van der Lippe 118843d343 Reland "Symlink debug folder instead of symlinking individual files"
This reverts commit 9a2b5dd02a4ef572145214f4808df3dc2e93b1e6.

The assignment on line 45 was overwriting the parameter `src`, which
then would result in the for-loop on line 44 to traverse into the wrong
directory. Renaming the assignment to variable `new_src` resolves that
issue.

Confirmed working locally by commenting out the `if symlink exists`
branch and ran it on my Linux machine. (I could reproduce the error by
simply commenting and can confirm that it is now working with the fix)

TBR=luoe@chromium.org

Change-Id: Idc3dbddd9db620169f7e9fbd60e306755eb1b4c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1715303
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#681390}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 01ff6dc78f8b331b7e76d026b553c0eb4b9a7322
2019-07-26 18:38:51 +00:00
Yang Guo a999fec951 DevTools: roll CodeMirror to 5.48.3
Also add script for rolling CodeMirror, and extended test
for syntax highlighting

R=luoe@chromium.org

Bug: chromium:985594
Change-Id: I54c92a257926671a9ec87a3c7ecd8e657acc685c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1709571
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#680772}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9f569d9266405b104365e05734e13848c6655c01
2019-07-25 07:54:38 +00:00
Jeff Fisher c287307616 Revert "Symlink debug folder instead of symlinking individual files"
This reverts commit a66c49ab42280aaaa4cf2b293b8e0c42c545b154.

Reason for revert: This breaks building chromium on Windows:

Traceback (most recent call last):
  File "../../third_party/blink/renderer/devtools/scripts/build/build_debug_applications.py", line 72, in <module>
    sys.exit(main(sys.argv))
  File "../../third_party/blink/renderer/devtools/scripts/build/build_debug_applications.py", line 32, in main
    symlink_dir_or_copy(input_path, output_path)
  File "../../third_party/blink/renderer/devtools/scripts/build/build_debug_applications.py", line 49, in symlink_dir_or_copy
    copy_file(src, join(dest, filename), safe=True)
  File "../../third_party/blink/renderer/devtools/scripts/build/build_debug_applications.py", line 54, in copy_file
    os.remove(dest)
WindowsError: [Error 5] Access is denied: 'resources/inspector/debug\\accessibility'


Original change's description:
> Symlink debug folder instead of symlinking individual files
>
> The original behavior of build_debug_applications.py was to traverse all
> files recursively in the front_end folder and symlink each individual
> file to the version in third_party/blink/renderer/devtools/front_end.
>
> However, this requires rebuilding of Chrome when new files are added to
> the application. After this CL, the developer experience is more
> What-You-See-Is-What-You-Get.
>
> This CL is also in preparation to remove the logic in C++-land to remove
> the need for a separate debug folder. A follow-up CL will change the
> behavior of `debug_devtools` to symlink directly into
> out/[NAME]/resources/inspector, rather than an explicit sub-directory.
>
> As a nice side-effect of this change, we are no longer symlinking the
> debug folder for every version of the application. Previously, it would
> iterate through all `application_names` and symlink the full debug
> folder. This is time-consuming and did not provide any actual benefit.
> Since we now symlink directly to the local version, we no longer need to
> build the HTML files directly.
>
> Bug: 986365
> Change-Id: I7e54ac3af57e0a3941b88a46b71b3ddacd5664f2
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713344
> Reviewed-by: Erik Luo <luoe@chromium.org>
> Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
> Cr-Commit-Position: refs/heads/master@{#680518}

Change-Id: I8511095bb6f3dc8e4e7871afd3ef8c91fa63a069
Bug: 986365
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717594
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#680679}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 9a2b5dd02a4ef572145214f4808df3dc2e93b1e6
2019-07-25 00:38:44 +00:00
Tim van der Lippe 62d5232756 Symlink debug folder instead of symlinking individual files
The original behavior of build_debug_applications.py was to traverse all
files recursively in the front_end folder and symlink each individual
file to the version in third_party/blink/renderer/devtools/front_end.

However, this requires rebuilding of Chrome when new files are added to
the application. After this CL, the developer experience is more
What-You-See-Is-What-You-Get.

This CL is also in preparation to remove the logic in C++-land to remove
the need for a separate debug folder. A follow-up CL will change the
behavior of `debug_devtools` to symlink directly into
out/[NAME]/resources/inspector, rather than an explicit sub-directory.

As a nice side-effect of this change, we are no longer symlinking the
debug folder for every version of the application. Previously, it would
iterate through all `application_names` and symlink the full debug
folder. This is time-consuming and did not provide any actual benefit.
Since we now symlink directly to the local version, we no longer need to
build the HTML files directly.

Bug: 986365
Change-Id: I7e54ac3af57e0a3941b88a46b71b3ddacd5664f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713344
Reviewed-by: Erik Luo <luoe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#680518}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a66c49ab42280aaaa4cf2b293b8e0c42c545b154
2019-07-24 18:12:19 +00:00
Mandy Chen 4a7ad057a2 DevTools: Update presubmit script to remove duplicate grdp messages
Due to the merge timing of patches, sometimes duplicate grdp messages
can be added and co-exist*. This patch updates the presubmit script to
automatically delete duplicate grdp messages.

- Keep the winning grdp message (i.e. the one that corresponds to the
  frontend message that comes first based on its file name when sorted).

- If none of these duplicate messages should be kept, delete them all.

- If none of these duplicate messages should be kept AND the same message
  needs to be created in a different grdp file, preserve the longer
  description.

In addition, this patch removes unnecessary arguments such as isDebug and
file-level dictionary structures.


*: https://crrev.com/c/1580199 and https://crrev.com/c/1633989 both added
a grdp message for "Image from %s".


Bug: 941561
Change-Id: Ic37f1fc410361eabd0ba710ece73a76d78eb8d34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1656070
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#677799}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a0dbe54c77da415cfc79ee99bc0cd9e590ffb6ff
2019-07-16 16:09:29 +00:00
Mandy Chen 81d4fc4e26 DevTools: Autofix grdp messages with the wrong IDS key in presubmit
The ids key (i.e. name value of a <message> tag) of a grdp message is
IDS_DEVTOOLS_<md5 hash of the string>. Currently if you manually modify
the content of a message and modify the corresponding frontend string,
the ids key can be outdated.*

This patch improves the presubmit script to autofix such issues. Actual
fix of the current problem is in another patch:
https://crrev.com/c/1670315.

*: example: https://crrev.com/c/1637046

Bug: 941561
Change-Id: I2f2b044955aa1033f07a054ac2926392d6ff1687
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1661120
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
Reviewed-by: Erik Luo <luoe@chromium.org>
Reviewed-by: Alexei Filippov <alph@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#676641}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 36f218b51c5cbc5e1c43e7c42dcf4bd83b50bfdc
2019-07-11 23:12:02 +00:00
Yang Guo 5ebd8a7f08 Update references to DevTools protocol definition in V8
Bug: v8:9247
Change-Id: I0659eafb062be24777c5fd507c9749c5cfdc79a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1665929
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#672427}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 022ef24f1d055234c33bdcede7c3eef79bbd631e
2019-06-26 08:04:01 +00:00