The auto dark mode is intended to always be used together with
`prefers-color-scheme: dark`. This change makes the setting in the
Renderer tab both enable auto dark and sets the prefered color scheme to
dark. To make it clear that these two settings are intertwined, we
disable the select box for prefers-color-scheme when auto dark mode is
enabled.
This change also makes the auto dark setting to a checkbox to
simplify the UX.
https: //imgur.com/a/79wNwc0
Change-Id: I3917356865203b89196402a8a7d4dbfa6cbeab18
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3358535
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
This CL also changes tests to favor `waitFor` over `$` per default:
In all tests where an element is expected `$` is changed to `waitFor`.
This should be uproblematic in all the cases where an element is
expected to exist immediately, but gives a bit of leeway in case the
element is slow to emerge. Typing wise, `waitFor` never returns null
since it throws if no element is found before it times out.
Change-Id: I00b722eff34df44402d9f3bf6786432c9faf1505
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2327710
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
The shared test runner logic was reimplementing parts of Mocha,
in particular the test logging and filtering. Moreover, it was
booting the hosted mode server and puppeteer outside of Mocha.
Mocha supports root level hooks [1]. These hooks allow us to
perform work before a test starts. Moreover, by using the
before and after hook, we can run logic before and after
all tests.
By using these hooks, we can extract the "boot the hosted mode
server and hookup puppeteer" part to these root hooks.
Additionally, we can reset the pages in the `beforeEach`, which
means that tests themselves don't have to reset the pages.
We also put the implementation code into third_party/conductor,
as we would like to reuse this logic for the Puppeteer tests.
The Puppeteer test suite now also uses Mocha and has very
similar requirements as to our DevTools tests. By extracting
from DevTools, we can look into expanding the test runner to
other usecases, but that is out of scope for now.
[1]: https://mochajs.org/#root-level-hooks
Bug: 1071369
Change-Id: Ie9f954359d9de84da564b74b6f5517dd535db008
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2150458
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>