Commit Graph
178 Commits
Author SHA1 Message Date
Alex Rudenko 1356402107 Add click element retries
Fixed: 1411644
Change-Id: Id7152f406e5086a70c59f7c24e4c7e099578da5a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4207835
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
2023-01-31 13:09:41 +00:00
Alex Rudenko afbc6c6e3a Fix flaky hover tests
Adds a hover and hoverElement helpers similar to click
and clickElement.

Fixed: 1411185
Change-Id: I14498d7ac7252eaa5e9cc5e3ece60a08ae46c942
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4207832
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2023-01-31 11:30:40 +00:00
Andrés Olivares 30f4469ea7 Add screenshot tests helpers
The helpers allow the implementation of screenshot tests in DevTools.

A screenshot test that makes use of the helpers is added for the
performance panel. The test is disabled because no screenshot test
infrastructure is available in our bots. Once this isn't the case the
test can be enabled and other screenshot tests added.

Screenshot tests are not added as a dedicated new suite but as
complementary to the interaction tests already in place. For this
purpose, the existing artifacts under test/screenshots/ are removed or
moved to be under test/interactions. The image_diff executables are
moved under third_party

Follow-up: Include dedicated lint rules files.

Bug: 1407638
Change-Id: I7106769b085b6aaa32ea4a089a840418c83536bb
DISABLE_THIRD_PARTY_CHECK=Including new library to third_party/
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4190012
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Andres Olivares <andoli@chromium.org>
2023-01-31 10:21:47 +00:00
Alex Rudenko e92fe9d745 Refactor the click helper to use Puppeteer's methods
The click helper now only accepts selectors so that it is
able to recover from unstable DOM situations. A new deprecated
helper clickElement is introduced for tests that cannot use a
selector currently. This should serve as a red flag that the
test might suffer from flakiness.

Bounding box and offset computation is removed for now. New
Puppeteer version allows providing relative click coordinates
so we need to use that.

Bug: 1411188, 1409768, 1411196, 1410437
Change-Id: I94a272184530842476bb2a879d862c4bd0930dba
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4194329
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2023-01-30 14:27:54 +00:00
Randolf 18fb49bad8 Separate modifier key press from click helper
This CL separates the modifier key press from the click helper to lower the complexity of the click API and improve overall API safety of using modifier clicks.

Bug: 1411188
Change-Id: Ide04871c14589d7b60dd361d9a607ea3d8f75b28
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4201723
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2023-01-30 09:27:31 +00:00
Randolf cc8925401c Update puppeteer to 19.6.2
DISABLE_THIRD_PARTY_CHECK=Files need updating

Bug: 1410437
Change-Id: I510c33a2435e03a6d0bcc389b062741490161083
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4196856
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2023-01-28 00:27:27 +00:00
Kim-Anh Tran 10af966d43 [e2e] Adapt e2e tests that rely on the breakpoint sidebar pane
This adapts e2e tests that make use of the breakpoint sidebar to be compatible with both the old and the new one. This is a
preparatory step to enable the new sidebar per default.

Bug: 1407586, 1408030
Change-Id: I4dfa6de6367cebda6d5ce94f5ed1986cd9d84272
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4171281
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
2023-01-17 12:16:55 +00:00
Simon Zünd 9e2c759bea Revert "Update puppeteer to v19.5.0"
This reverts commit 7f8017513a.

Reason for revert: Suspected to increase overall flakiness of our e2e suite. As a precaution we'll roll back and get the tree into a green state first.

Original change's description:
> Update `puppeteer` to v19.5.0
>
> DISABLE_THIRD_PARTY_CHECK=Need to patch files for update
>
> Bug: none
> Change-Id: I6bbde8b41ba99bfb797a03595a709d56d95cb04d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4146170
> Reviewed-by: Yang Guo <yangguo@chromium.org>
> Commit-Queue: Randolf Jung <jrandolf@chromium.org>

Bug: none
Change-Id: Ic1fb9df3a160f553e62f1df2ade6e0ba523663c5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4172908
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2023-01-17 08:05:38 +00:00
Randolf 7f8017513a Update puppeteer to v19.5.0
DISABLE_THIRD_PARTY_CHECK=Need to patch files for update

Bug: none
Change-Id: I6bbde8b41ba99bfb797a03595a709d56d95cb04d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4146170
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Randolf Jung <jrandolf@chromium.org>
2023-01-16 21:08:51 +00:00
Jack Franklin 2f512f8cc5 Add screenshot failure logs back
Disabled when doing some debugging by mistake, adding them back.

Bug: none
Change-Id: Iee7f55b06c84446409c4b380726e6704f010cea4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4147178
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2023-01-09 10:48:57 +00:00
Jack Franklin 7fc544b246 Cache expensive renderValue() calls in ComputedStyleProperty
The attached bug highlights a case where navigating through a list of
computed styles is incredibly slow - on my machine, a single ArrowDown
keypress took >500ms.

We tracked the cause down to the `createPropertyElement` call, which is
called once per CSS property on each render. When a user clicks the
"Show all" button, this causes over 3,000 nodes to be rendered (one per
each style rule that could ever exist on a given element).

This means that this function needs to be performant and avoid doing any
expensive work. Inspecting the function revealed three things:

1. It was creating `ComputedStyleProperty` component instances via `new
   ComputedStyleProperty()` calls. This means that a new instance will
   be created on each render, even if all the data is identical.
   Swapping to use lit-html template syntax (`<foo-bar ...>`) means that
   Lit can manage the instance and not re-create it on each render call.
2. We were passing functions in as properties to the Lit component.
   Because this function is created on each render, it ensures that Lit
   will re-render every time as it considers the function to be
   different.
3. Finally, the call to `renderValue()` in
   `StylesSidebarPropertyRenderer` is expensive. Depending on the CSS
   rule in question, it will create various DOM nodes and widgets (for
   example, to render a colour picker). We were calling this on every
   render, so all this HTML was being entirely recreated. This caused
   heavy DOM thrashing.

To fix the above issues this CL makes a few changes:

1. We render `ComputedStyleProperty` via lit-html syntax. Additionally,
   each property is passed in as its own setter, rather than a big `set
   data`. Finally, rather than pass a function into the component, the
   component dispatches an event which we can bind a listener too. This
   is much more efficient as we don't have to re-bind the listener on
   each render and do not have to re-render child elements because there
   is now no function parameter that changes on each render.
2. We cache `renderValue()` and `renderName()` results based on the
   property name and value. This ensures that A) we do the expensive
   HTML generation only once, and B) that we don't change the HTML once
   we've built it (unless the data changes, in which case we have no
   choice).

With these changes the lag on navigation with the arrow keys is
completely gone, and a performance trace confirms we've drastically
reduced the amount of work being done and how long it takes.

There is still more that we could do here:

1. The `createTraceElement` function call has the same issues as
   `createPropertyElement`. I've left this alone to keep the size of CL
   down, and because I wanted to keep the scope small and focused on the
   bug in question.
2. The `StylesSidebarPropertyRenderer#renderValue()` code could be
   migrated to be a component, to avoid the issue of re-creating HTML.
   Or, if that change is too large, we could introduce caching to it. As
   far as I can tell the `propertyName` and `propertyValue` properties
   of the class are never mutated, so once we create an instance of this
   renderer and call `renderValue()`, the resulting output will never
   change. As I'm not familiar with the code, I'd like to chat to people
   who are (changhaohan@) after the New Year :)
3. The render-node callback that we invoke `createPropertyElement` from
   seems to be doing a lot of work still. Ideally we would do most of
   this work upfront and not on every render, but if we have to do the
   work per-render we should explore what we can cache. Given the
   slowness is when we render a list of 3000+ items, most of which do
   not change between renders, I think there is likely wins to be had
   with some clever caching or moving of code out of the re-render path.

Bug: 1403165
Change-Id: Ie6fb47b9f2e81e8f2a87c940370019f545fa50c8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4110811
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
2023-01-03 12:33:57 +00:00
Jack Franklin 2204d75049 Upgrade TS to 4.9
DISABLE_THIRD_PARTY_CHECK=TS upgrade.

Bug: 1392092
Change-Id: I3a5f352b12914ea6f908118fe6fda8ca3286cae5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4041404
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-11-21 15:14:06 +00:00
Philip Pfaffe 7fb6a83807 Scroll palette switcher panel into view
In the color picker if there are sufficiently many colors in the
palettes, opening the palette switcher causes the switcher panel to be
rendered off screen because the color picker becomes scrollable. This
change scrolls the picker to the bottom to display the switcher panel
properly.

Fixed: 1365326
Change-Id: I4c61c92c5257284d5233b1fa2ef16ee090f2e255
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4020561
Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-11-14 14:52:13 +00:00
Philip Pfaffe 20d9166196 [e2e] On timeouts, report pending async stacks to resultdb/milo
When tests time out we currently report the timeout error to resultdb/milo. This tells us nothing about where the test fails and authors/sheriffs need to scour the full text log for the error. Instead of the meaningless timeout error, this change reports the pending async stacks.

Bug: v8:13316
Change-Id: I0e1f1227aaaeb662b017a71ca082bf8311cab05d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3990724
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-10-28 10:56:31 +00:00
Benedikt Meurer 8a7915aedc [e2e] Explicit tests for formatting vs. pretty-printing.
This is in preparation of enabling the "Automatically pretty print
files" experiment.

Bug: chromium:1164184
Change-Id: I0927ea5929a823093a1ced321f6e3efdc879bf10
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3964115
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2022-10-20 06:25:08 +00:00
Philip Pfaffe e77792ecc5 [e2e] Reland and fix taking screenshots on non-timeout errors
Bug: 1181777
Change-Id: I7664f0b2e06979f1ca8efcd4d51713301a833997
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3930123
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-10-04 09:52:16 +00:00
Philip Pfaffe 078cec90a8 Revert "[e2e] always take screenshots on test failures"
This reverts commit 4e5a647462.

Reason for revert: Change accidentally eats errors.

Original change's description:
> [e2e] always take screenshots on test failures
>
> Bug: 1181777
> Change-Id: I5801831e1679fd2c2c3f93c7fbaf737ace9b9f57
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3921597
> Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
> Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>
> Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>

Bug: 1181777
Change-Id: I80917f270d0d366f6de6083ce994827f8e3835d4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3930125
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-09-30 11:54:11 +00:00
Philip Pfaffe 4e5a647462 [e2e] always take screenshots on test failures
Bug: 1181777
Change-Id: I5801831e1679fd2c2c3f93c7fbaf737ace9b9f57
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3921597
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Kateryna Prokopenko <kprokopenko@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2022-09-29 16:09:40 +00:00
Eric Leese 10f0a340eb Always generate clean html output file
When HTML_OUTPUT_FILE env var is specified, tests will always
generate a fresh (possibly empty) html file, and will not append
to the results of a previous test run.

Bug: 1081217
Change-Id: I6134c3f51a8462d0cf8f89eb97c22b63e592e7e4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3923822
Reviewed-by: Liviu Rau <liviurau@chromium.org>
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>
2022-09-29 16:05:00 +00:00
PhistucK 257ad69b8a Reland "Add a global setting for search as you type"
Change to the original CL:
* Updated `helper.ts` to use `pressKey` utility for summoning the search box. It wasn't been summoned before because `summon` function was using `Control` + `f` instead of `Meta` + `f` in MacOS.

This is a reland of commit b4643a4703

Original change's description:
> Add a global setting for search as you type
>
> Added a global setting to the settings screen and to the command menu
> for enabling search-as-you-type, or requiring Enter for searching,
> in search boxes that support it.
>
> - Added strings, a setting and commands for the new setting.
> - Bailed early on input when the setting is disabled.
> - Tests -
>  - Added general helpers for getting text contents and summoning the
>    search box.
>  - Added elements-panel-specific helpers for the tests.
>  - Made the setting toggle helper accept an optional expected state.
>
> Bug: 1344526
> Change-Id: I75612a54c10d5f40b208084fdbd0ffd7614f7f7c
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3859617
> Auto-Submit: PhistucK Productions <phistuck@gmail.com>
> Commit-Queue: PhistucK Productions <phistuck@gmail.com>
> Reviewed-by: Victor Porof <victorporof@chromium.org>
> Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>

Bug: 1344526
Change-Id: If92d692307a0ac298657ff9ace7df0c887fde1cf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3865397
Auto-Submit: Ergün Erdoğmuş <ergunsh@chromium.org>
Reviewed-by: Victor Porof <victorporof@chromium.org>
Commit-Queue: Victor Porof <victorporof@chromium.org>
2022-09-01 10:38:51 +00:00
Ergün Erdoğmuş ad07a27dbd Revert "Add a global setting for search as you type"
This reverts commit b4643a4703.

Reason for revert: Newly introduced tests are flaky in mac builder[1]

[1]: https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/8140/overview

Original change's description:
> Add a global setting for search as you type
>
> Added a global setting to the settings screen and to the command menu
> for enabling search-as-you-type, or requiring Enter for searching,
> in search boxes that support it.
>
> - Added strings, a setting and commands for the new setting.
> - Bailed early on input when the setting is disabled.
> - Tests -
>  - Added general helpers for getting text contents and summoning the
>    search box.
>  - Added elements-panel-specific helpers for the tests.
>  - Made the setting toggle helper accept an optional expected state.
>
> Bug: 1344526
> Change-Id: I75612a54c10d5f40b208084fdbd0ffd7614f7f7c
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3859617
> Auto-Submit: PhistucK Productions <phistuck@gmail.com>
> Commit-Queue: PhistucK Productions <phistuck@gmail.com>
> Reviewed-by: Victor Porof <victorporof@chromium.org>
> Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>

Bug: 1344526
Change-Id: I8f9adda6dbca6b4f553cbe6cdd3bffea9088efc2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3865263
Reviewed-by: Victor Porof <victorporof@chromium.org>
Commit-Queue: Victor Porof <victorporof@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Ergün Erdoğmuş <ergunsh@chromium.org>
2022-08-30 08:34:07 +00:00
PhistucK b4643a4703 Add a global setting for search as you type
Added a global setting to the settings screen and to the command menu
for enabling search-as-you-type, or requiring Enter for searching,
in search boxes that support it.

- Added strings, a setting and commands for the new setting.
- Bailed early on input when the setting is disabled.
- Tests -
 - Added general helpers for getting text contents and summoning the
   search box.
 - Added elements-panel-specific helpers for the tests.
 - Made the setting toggle helper accept an optional expected state.

Bug: 1344526
Change-Id: I75612a54c10d5f40b208084fdbd0ffd7614f7f7c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3859617
Auto-Submit: PhistucK Productions <phistuck@gmail.com>
Commit-Queue: PhistucK Productions <phistuck@gmail.com>
Reviewed-by: Victor Porof <victorporof@chromium.org>
Reviewed-by: Ergün Erdoğmuş <ergunsh@chromium.org>
2022-08-29 15:20:00 +00:00
Philip Pfaffe 7b67f32b65 [e2e] Wait properly for the element to be DOM-connected when clicking
When clicking on elements, e2e tests compute the bounding box of
elements to click into. Some UI components update its contents by
removing and reinserting elements. The CL prevents the race that occurs
between elements being removed, and the e2e helper selecting an element
and running evaluate on it by looping until the selected element is
connected.

Fixed: 1349290
Change-Id: Ic9a0cc59a3c74ddbb2262ee20ba0360a3a2f643e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3834665
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2022-08-17 13:37:25 +00:00
Philip Pfaffe 9401ae1a25 Deflake click-handler by waiting for a DOM-connected element
Fixed: 1349290
Change-Id: Ic06b75ff60da984a86f8459581ab975a3e73d1ef
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3833735
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-08-16 12:42:57 +00:00
Philip Pfaffe c6b141f3d7 [e2e] Fix beforeX/afterX hook
It's not enough to modify the mocha hook's callback when it's created,
since that will be overriden when the hook is actually executed. Instead
we need to inject this when hook is actually run.

Bug: none
Change-Id: I67720e5a57b433c2b50e410c32e030f01eacb1f4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3823003
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-08-10 16:01:33 +00:00
Eric Leese cbb0a8bfe0 Add option to save screenshots to an html file
If the HTML_OUTPUT_FILE environment variable is set, screenshots
from timed out tests will be appended to an html file rather than
the log. Remember to delete this file between runs.

Bug: 1081217
Change-Id: I064ca303061b49042366d35933f0f8d3f3a01158
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3810236
Commit-Queue: Eric Leese <leese@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
2022-08-09 14:28:20 +00:00
Philip Pfaffe 82d6d5debc [e2e] Apply error reporting hooks also in beforeX and afterX cases
When our mocha tests time out, hooks around it() make sure that we
print pending promises and log a screenshot. This CL makes the same work
for beforeX and afterX mocha hooks.

Bug: none
Change-Id: Ibb0a6c1ddb3dae6690bdee45374bc70bf67c5688
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3819722
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
2022-08-09 13:34:02 +00:00
Eric Leese a6533f0ac1 Toggle show ignore-listed call frames
This changes the way ignore-listing is disabled in the call stack.
In place of the link that previously allowed ignore-listing to be
turned off (but not back on), we now have a checkbox allowing the
ignored frames to be unhidden and then hidden again.

Bug: 1336604
Change-Id: Ie42dbe4884c571bf0a696c83c2695610f0ff53e8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3769849
Reviewed-by: Victor Porof <victorporof@chromium.org>
Commit-Queue: Victor Porof <victorporof@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
2022-07-19 17:12:04 +00:00
Jack Franklin 3a80260722 Inline type imports in front_end
This CL enables the `inline_type_imports` rule for devtools-frontend,
and is the result of running the auto-fixer to update all imports
accordingly.

Bug: 1319340
Change-Id: I303256476fd4e94f4505bbf4355c0070ac101aa9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3752799
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2022-07-13 09:26:00 +00:00
Kim-Anh Tran 159f3def48 [e2e] Change pending events to return undefined and remove no-op calls
This changes pending events to return undefined if no event has been
logged to cause the `waitForFunction` to time out as expected.

This also removes the no-op calls to `getPendingEvents` which
didn't install the listener before.

Bug: none
Change-Id: Icccd144bfb9c7c708f95c180bc412ce68f560e6f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3653555
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
2022-05-18 12:18:26 +00:00
Danil Somsikov f294de1de2 Fix TEST_PATTERNS format description
Bug: none
Change-Id: I314035b082d7037a2be5755b634c0c8b37876614
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3607836
Commit-Queue: Danil Somsikov <dsv@chromium.org>
Auto-Submit: Danil Somsikov <dsv@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2022-04-26 15:22:07 +00:00
Simon Zünd e3cdd37fb8 [e2e] Load extensions from the same origin as the DevTools frontend
This CL is a preparatory refactoring. In the future, we want to load
DevTools from a different origin than `localhost` to increase
isolation between test runs (e.g. no shared window.localStorage).

To get there, we have to change how the extension tests load the
actual extension code. The extension must be served from the same
origin as the DevTools frontend. Currently this CL is a no-op, as
both resources and the DevTools frontend are served from 'localhost'.

R=pfaffe@chromium.org

Bug: 1297458
Change-Id: Iedee09d8cdd992f64132add78537428e9e4ab7ae
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3466036
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-16 10:12:32 +00:00
Simon Zünd 0b5820576e [l10n] Fix e2e test that switches locales
This CL fixes a long-standing disabled l10n test. Initially we didn't
have a 'language' setting so we had to use the emulation feature
to simulate setting `navigator.language`. Finally, this is not how
we solved l10n for DevTools.

This CL adds a new helper that allows setting settings via the
Host API and uses it to make sure that the pseudo local is loaded
and applied correctly.

R=alexrudenko@chromium.org

Bug: 1163928
Change-Id: I1873ed38c9c6ef95ae87b281292e210363764211
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3466035
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2022-02-16 08:53:32 +00:00
Takuto Ikuta a36c4e87eb extract AsyncScope to separate file
This is extracted from https://crrev.com/c/3330076/36

This is to fix interactions test failure like
```
    1) shows cookies even when navigating to an unreachable page (crbug.com/1047348)
(node:3756728) Warning: Accessing non-existent property 'AsyncScope' of module exports inside circular dependency
    at emitCircularRequireWarning (node:internal/modules/cjs/loader:707:11)
    at Object.get (node:internal/modules/cjs/loader:721:5)
    at waitFor (/usr/local/google/home/tikuta/devtools/devtools-frontend/test/shared/helper.ts:228:67)
    at getElementPosition (/usr/local/google/home/tikuta/devtools/devtools-frontend/test/shared/helper.ts:57:21)
    at click (/usr/local/google/home/tikuta/devtools/devtools-frontend/test/shared/helper.ts:104:13)
    at navigateToApplicationTab (/usr/local/google/home/tikuta/devtools/devtools-frontend/test/e2e/helpers/application-helpers.ts:11:9)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Context.<anonymous> (/usr/local/google/home/tikuta/devtools/devtools-frontend/test/e2e/application/cookies_test.ts:29:5)
```
when we use esbuild.

Bug: 1278663
Change-Id: I9e3ab2d19c4daa56c87e3f77ac917a13d32a7c24
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3394445
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: Tim Van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
2022-01-17 12:40:45 +00:00
Jesper van den Ende 0113884bf6 Use mousedown event for activating network requests.
The click event only fires for elements that receive both a mousedown
and a mouseup event. Since DataGrid elements in the Network panel get
replaced every time a message is received on WebSockets, the click
event doesn't get fired if you click before a message and release after
the message. To fix this we'll listen for the mousedown event instead.
This has the added benefit that the request panel becomes visible
sooner, making it feel more responsive.

Fixed: 1222382
Change-Id: Ia44c47a90b4822530081caf63aec682e9f32186c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3293092
Reviewed-by: Simon Zünd <szuend@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2021-11-23 06:57:58 +00:00
Tim van der Lippe 59cd4d1065 Remove trailing comma in tsconfig.json
R=yangguo@chromium.org

Bug: 1268746
Change-Id: If259ec5deef83183439a3c528b430847f8236436
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3275334
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>
2021-11-11 09:49:04 +00:00
Andres Olivares c860fe1985 Introduce describe.skipOnPlatforms mocha extension
NOPRESUBMIT=true
Bug: none
Change-Id: If0e96e43aa13a2fa557a075975c2e7f365db930a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3258130
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
2021-11-03 20:44:06 +00:00
Kateryna Prokopenko 227106dbf3 Allow Network request blocking panel scrolling in blocking disabled state
Bug: 1251542
Change-Id: I4cddc3d939cc1238ea931452762ed69c54871779
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3211977
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Kateryna Prokopenko <kprokopenko@chromium.org>
2021-10-11 16:14:52 +00:00
Jack Franklin a3f2d16091 Expose RenderCoordinator pending frames count
This change is required to prevent a test timing out when we await the
coordinator being done when actually that work is already done.

Previously the helper would add a listener for the `rendererqueueempty`
event but if the work had been completed by then, the event would never
fire and the test would time out.

Now we expose globally a function to return the count of pending events
and the interaction/e2e test helper will check if that returns `0`, and
if so, resolve, before then adding the event listener.

This means a test that waits for work where that work has actually
already happened will now correctly resolve and continue, whereas before
it would time out indefinitely.

Bug: none
Change-Id: I43243bcc9002c9e97f476a66ed3f42c7313f7fcd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3198872
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-10-01 11:59:40 +00:00
Jack Franklin 03f5467123 Make makeCustomWrappedIt wrapper for mocha extensions.
This CL provides a foundation for enabling custom test `it` functions in
a way that will ensure they can still be used with `.only`, `.skip` and
so on.

Bug: chromium:1186163
Change-Id: I31544ad5dd0cf86132a2b59c910da0a27acfca17
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3162063
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-09-15 16:23:52 +00:00
Sigurd Schneider 20e1748d7d Add e2e test for issue caching
Bug: chromium:1240622
Change-Id: I0dcb417a32859b15351a7c5510766a3e6309c900
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3138092
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-09-03 10:54:27 +00:00
Tim van der Lippe d79e3c545b Strongly type key in pressKey
R=jacktfranklin@chromium.org

Bug: none
Change-Id: Ib9eb75bdb76124e1d4f6d54e5b5edcfdea6a4504
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3135426
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-09-01 14:10:32 +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
Wolfgang Beyer be0727c813 Turn assertNotNull() into assertNotNullOrUndefined() for e2e tests
`assertNotNull()` of `undefined` does not cause the test to fail,
whereas `assertNotNullOrUndefined()` does.

Because of import restrictions, platform.js's
`assertNotNullOrUndefined()` is copied to helper.ts.

Bug: 1072335
Change-Id: Iaa56492c2f58f735cb93b434f6a73c65cdb740c5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3057046
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2021-07-30 08:50:56 +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
Tim van der Lippe 72f2d4bcc8 Add e2e-tests for focus interactions of console messages
This replaces http/tests/devtools/console/viewport-testing/console-key-navigation.js
as an e2e-test.

R=aerotwist@chromium.org

Bug: 1203169
Change-Id: I461f742e84f13e44eecc74553ced77b5041d3340
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3010115
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2021-07-07 10:23:47 +00:00
Paul Lewis 2906222f2a Update Chromium source references
Some comments in the code refer to the master branch. This CL updates
those comments to refer to the main branch instead.

Bug: 1226943
Change-Id: Ib01747a447f7fc462ed92ba2fbb961cd12c3e490
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3009819
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-07-07 10:11:57 +00:00
Sigurd Schneider 76cb0e9d20 Refactor matching helpers to support tables
Bug: chromium:1223300
Change-Id: Ifb464b5c7bc3c068e71ccc0f71cf995b3103bfb2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2983019
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2021-06-24 08:07:48 +00:00
Tim van der Lippe 46244285d4 Cleanup TypeScript configuration files and root OWNERS
This moves the required TypeScript configuration files into
/config/typescript/, which allows us to cleanup the root OWNERS.
Doing so will make it easier to make infrastructure refactorings
in our TypeScript configuration (if we for example need to add
a new file), while not requiring ENG_REVIEW_OWNERS.

DISABLE_THIRD_PARTY_CHECK=Configuration changes
R=yangguo@chromium.org,szuend@chromium.org

Bug: none
Change-Id: Icffd52d37c37b52651dc8125948dc90b2b79cdf5
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2975287
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2021-06-22 10:45:59 +00:00
Philip Pfaffe d097e515dc Mark asyncScopes as canceled on timeout
When an e2e test times out, running promises aren't aborted. Instead,
any errors that are thrown are silently swallowed. When not being
careful, in-flight promises can still mess up state, or even never
detect timeouts. waitForFunction is especially vulnerable to this,
because it's running an infinite loop inside the test process. This CL
extends AsyncScopes to carry a flag when a timeout was triggered, which
allows waitForFunction to bail.

Bug: none
Change-Id: I30ebcc45419c4000a1b2a25096ca1211bf2400a0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978374
Auto-Submit: Philip Pfaffe <pfaffe@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Philip Pfaffe <pfaffe@chromium.org>
2021-06-22 10:40:48 +00:00