Commit Graph
19 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
Jack Franklin cbe8a7dd97 [DataGrid] rewrite tests to click and drag columns like a user would
This changes makes the data grid resizing tests click and drag on the X,
Y of each column to resize, rather than querying for it in the DOM. This
also found a bug where if we have a hidden column the resizers aren't in
the right position!

Fixed: 1182676
Change-Id: I5d122aacef389303948e73ff7adc077fa612f5e5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3301396
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-11-26 12:00:33 +00:00
Christy Chen 65ab8e0c03 Fixing format in data_grid_test.ts
Fixing format in this test file

Bug: none
Change-Id: I67bed035f96323a90030fe0f136d37eb801c0779
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3161605
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Christy Chen <chrche@microsoft.com>
2021-09-15 06:02:12 +00:00
Jack Franklin fda44a1eb5 Add generic types to $, $$ and waitFor helpers
Puppeteer supports generics on these methods, but we didn't support them
in our helpers. This CL adds support for them, meaning we can avoid `as
HTMLElement` in some of our tests.

Bug: none
Change-Id: I2b229b81522d85e6cd9662fd867932d7e24ab7c2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3110204
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-08-23 11:45:28 +00:00
Nancy Li b3530a2181 [DevTools Protocol Monitor] UX updates
- Make table header same height as tabs on the right side.
- Hide the scrollbar in the table.

Before: https://imgur.com/a/2nYavwK
After: https://imgur.com/a/xWfBgXg

Bug: 1226764
Change-Id: Ia2a71b174a28855a4cc4b717d8517af440cc6d13
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3097669
Commit-Queue: Nancy Li <nancyly@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-08-18 15:05:51 +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
Jack Franklin 947b4d23d6 [DataGrid] fix extra padding on filler row
The data-grid has a filler row that it renders to fill any additional
height of the container, but when the data-grid was filling the height
anyway this row would be 2px high (see screenshot in bug).

This CL changes the row to be 0px high, but I then found an oddness
with the rendering engine (not clear to me if it's desired behaviour
or a bug) where if the table had no rows (so we want the padding row
to be 100% high to fill the space) but then the padding row was given
`padding: 0`, it would not take up any height. Therefore we
conditionally apply an extra CSS class to give the row some padding
such that it takes up extra height in the event of the table being
empty.

Fixed: 1226745
Change-Id: I9030832320eb2554adbac1dc92dfbd8ec4cf9c2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3034608
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-07-19 09:09:20 +00:00
Jack Franklin 9ce08209bf [DataGrid] auto scroll improvements
This CL contains improvements to the auto scroll logic which means we
can correctly resume scrolling when the user has prevented it (e.g. by
selecting a cell) but then scrolled down to the end of the table.

It also includes a suite of interaction tests to verify the behaviour
and edge cases.

Bug: 1211346
Change-Id: Ic0905aaf2bc35dcf20d1c74dab19fb7e9eacedd5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2914884
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-05-25 10:32:33 +00:00
Tim van der Lippe 23283e110a Instrument code with Istanbul for interactions tests
All interaction tests are now lazily instrumented with Istanbul
to obtain code coverage. The interactions tests can be started
with `COVERAGE=1` to obtain coverage. For that, the Mocha hooks
perform the eventual reporting and gathering of data. The instrumentation
is performed in the components server itself.

To make sure that we perform the minimal amount of work required
(since code coverage instrumentation is computationally expensive),
we preload pages to populate the instrumentation cache. Every
interactions tests should preload an example (most likely basic.html)
to populate the cache. Every subsequent test will then use the
already-instrumented code, rather than computing the code over
and over again.

The eventual code coverage is written to /interactions-coverage.
The results will eventually be merged with /karma-coverage
to obtain the union of both unit and interaction tests coverage.

R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1206705
Change-Id: I5e19b1ecef23d21107210699cb29800556e0415e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2879986
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-05-10 14:44:42 +00:00
Jack Franklin 343c141919 merge inspectorStyle.css and inspectorCommon.css
It seems there is no requirement for these files to be split; they don't
seem to have a logical split and they are both injected into the `body`
element when DevTools runs. If we kept both of these files around, we'd
have to inject them both into the component docs helpers, and deal with
both of them when it comes to figuring out where legacy CSS variables
are defined.

To make it a bit simpler I've merged `inspectorStyle` into
`inspectorCommon`. I went this way because:

* `inspectorCommon.css` is (I think!) a better name than `inspectorStyle.css`
* `inspectorCommon.css` was bigger.

I also drive-by disabled the stylelint `comment-empty-line-before`,
which was forbidding empty lines before any CSS comments; which made the
entire file feel very squashed!

Bug: none
Change-Id: Ifaa834c7bf56291561e2e5cc124c4efd85c3cc56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2716285
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-02-26 15:50:55 +00:00
Jack Franklin 8bab3cc794 [DataGrid] Fix resizer handler positioning.
getBoundingClientRect() is incorrect to use here as it's viewport
relative; instead we want to position them based off the width of the
column.

Fixed: chromium:1182227
Change-Id: I39eeb686a5e2006f77e05558b7b73bfff430e080
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2720366
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-26 12:51:44 +00:00
Jack Franklin 9247e2d2b8 Fix DataGrid interaction test with bad assertions
The CL that enabled this change landed just after another which updated
the resizing logic for the data-grid. That meant that once they both
landed, this test's assertions became out of date and it started
failing.

Bug: none
Change-Id: I6b77df3f0b2e14b2b2645a0ba2ec30d3a340b37e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2667196
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
2021-02-02 11:14:18 +00:00
Jack Franklin 3e9f040e75 Allow decimal places when resizing data grid columns
Bug: none
Change-Id: I1521945756c111b61810a291c007e274c95ebcbf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2662825
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-02-02 09:31:48 +00:00
Jack Franklin e38eae5801 Re-enable data-grid resizing test
This was flaking on the waterfall; locally I have struggled to reproduce
but have added an extra check to the test which seems to help make it
more stable.

I tested it by running `it.repeat(50, ...)` in STRESS=1 and it didn't
fail once, so hopefully it will behave itself on the bots...

Bug: chromium:1172902
Change-Id: I25ad1572d63ff3e438df41bad1b0c62f38578d16
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2667189
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-02-02 09:09:28 +00:00
Kim-Anh Tran 786d84f106 [interaction-test] Disable flaky data grid test
Bug: chromium:1172902
Change-Id: I71c30c69f7b997a66972ecd36fa637e8466ebd84
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2662816
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
2021-02-01 09:00:34 +00:00
Jack Franklin e6dcd249e6 Inject inspectorStyle.css into the component docs
The interaction tests that have new values needed the change as the
inspectorStyle CSS changed the margins on the `body` element so some of the
tests had slightly different pixel values required when testing resizing.

Bug: chromium:1167724
Change-Id: I6569210264471f96040512e7f55158dec5c28bfd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2635666
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-18 16:48:16 +00:00
Jack Franklin 15ab1a3fc7 [DataGrid]: test to ensure resize persists as data is added
I was wondering if this would work or not. Turns out it does (yay!) but
feels like the sort of thing that would be easy to break, so adding a
test for resizing, and then adding data, to ensure that adding data
doesn't reset the user's resize.

Change-Id: I0efb7def31119148e12e2c3decc726aaa8923425
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593140
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-16 13:21:44 +00:00
Jack Franklin c08ee98db5 Tests and fix for data grid resizing with hidden column
Whilst integrating the data-grid I found some bugs with resizing when there are
hidden columns. Some parts of the resize logic didn't take into account hidden
columns and as such indexes were off. This fixes it and adds more interaction
tests to cover the resizing functionality more thoroughly.

Fixed: 1158788
Change-Id: I302bd060bdc30e6739547b99b088541b5f36563e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593134
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-12-15 17:00:48 +00:00
Jack Franklin 4747e2779d [DataGrid] allow columns to be resized by the mouse
Bug: 1153066
Change-Id: Ica1b2f23479b091182507a8629e8f2ccb6eea901
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560753
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-14 16:25:11 +00:00