Commit Graph
12 Commits
Author SHA1 Message Date
Johan Bay 8443d2894b Make auto dark setting enable prefers-color-scheme: dark
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>
2021-12-28 07:52:19 +00:00
Johan Bay 0d7e03ffa6 Add auto dark mode emulation in Renderer tab
This change adds a drop down select box for toggling auto dark mode.
Screenshot: https://imgur.com/a/tnpZFpO
Backend cl: https://crrev.com/c/3137939

Doc: https://goo.gle/devtools-forced-dark-mode
Bug: 1243309
Change-Id: Ie11b539d3ef0238fb62ea39ab1be53d8a31ba681
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3138077
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
2021-09-09 15:22:27 +00:00
Sara Tang 22cec8dbfa Enable emulating prefers-contrast media feature.
Bug: 1139777
Change-Id: Ic4639c9215e2182963e49549dab7e9e4c23d30a7
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3086588
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Sara Tang <sartang@microsoft.com>
2021-08-24 17:27:24 +00:00
Alex Rudenko 9c423651c0 UI to emulate the color-gamut media feature
Screenshot: https://i.imgur.com/vnnqOHa.png

Doc: https://goo.gle/devtools-css-color
Backend CL: crrev.com/c/2632609
Fixed: chromium:1073887
Change-Id: I7c1c90ac94d394dc62938f301decb9a4589cdd39
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2635664
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2021-01-18 16:05:46 +00:00
Peter Marshall 467b0b1632 tests: Use mocha-extensions in e2e tests
The extensions have helpers like it.repeat() and async tracing which
make development and debugging easier. All the tests will import from
the extensions file now rather than mocha directly.

A follow-up CL will add lint checks for this.

Bug: 1101782
Change-Id: I7b1a540be1685375b06f1db5d0fda2f2879446c2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2354104
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-08-17 07:37:56 +00:00
Johan Bay 504a6f1944 Let $ return null when no element is found
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>
2020-08-04 14:43:13 +00:00
Johan Bay e8245718be Use custom query handlers to implement $ and $$ in test/shared/helper.ts
Change-Id: I7c2ea2e6250bea1d15caaf1d341c56b7b2448e9b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2317870
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-08-04 14:05:13 +00:00
Tim van der Lippe d76dbd1fe3 Add node_ts_library for Node scripts
ts_library by default uses ES modules. However, Node doesn't fully
support ES modules yet, nor do our dependencies for our e2e-tests
support them fully. Therefore, transpile to commonjs for now, if
running in Node.

DISABLE_THIRD_PARTY_CHECK=Fixes to ts_library
R=aerotwist@chromium.org,jacktfranklin@chromium.org

Bug: 1088463
Change-Id: Ie6acf886417b80eb38365f9c2377799e370634fe
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2224805
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-06-02 10:24:00 +00:00
Tim van der Lippe 869374bcab Port shared test runner logic into separate package
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>
2020-04-20 10:32:58 +00:00
Tim van der Lippe 77750704ab Rename e2e test files
This allows us to efficiently glob the files based on the
`*_test.js` pattern.

Bug: 1071369

R=aerotwist@chromium.org

Change-Id: I0ba1af79d66cc146deb2301c6d398da7cf0bcd02
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2151453
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-16 15:47:19 +00:00
Tim van der Lippe 18ab47bc33 Typecheck all e2e tests with TypeScript
R=aerotwist@chromium.org

Bug: 1011811
Change-Id: I2045f0980a522a3fb63e1881c2b968a2170ec57f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2112557
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-03-23 13:02:11 +00:00
Mathias Bynens 7472956749 Add e2e test for vision deficiency simulation
For now we only assert that the UI is present in the Rendering
panel, and that the <select> contains the expected options.

Bug: chromium:1003700
Change-Id: I57a9dd283850b1970a6e498eae60047efccd8733
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2108149
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-03-19 15:48:42 +00:00