-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use functions for jump-to-def-background rustodoc GUI test
- Loading branch information
1 parent
e64f111
commit f112c3a
Showing
1 changed file
with
17 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,22 @@ | ||
// We check the background color on the jump to definition links in the source code page. | ||
goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html" | ||
|
||
// Set the theme to dark. | ||
local-storage: { | ||
"rustdoc-theme": "dark", | ||
"rustdoc-preferred-dark-theme": "dark", | ||
"rustdoc-use-system-theme": "false", | ||
} | ||
// We reload the page so the local storage settings are being used. | ||
reload: | ||
|
||
assert-css: ( | ||
"body.source .example-wrap pre.rust a", | ||
{"background-color": "rgb(51, 51, 51)"}, | ||
ALL, | ||
) | ||
|
||
// Set the theme to ayu. | ||
local-storage: { | ||
"rustdoc-theme": "ayu", | ||
"rustdoc-preferred-dark-theme": "ayu", | ||
"rustdoc-use-system-theme": "false", | ||
} | ||
// We reload the page so the local storage settings are being used. | ||
reload: | ||
|
||
assert-css: ( | ||
"body.source .example-wrap pre.rust a", | ||
{"background-color": "rgb(51, 51, 51)"}, | ||
ALL, | ||
define-function: ( | ||
"check-background-color", | ||
(theme, background_color), | ||
[ | ||
// Set the theme. | ||
("local-storage", { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }), | ||
// We reload the page so the local storage settings are being used. | ||
("reload"), | ||
("assert-css", ( | ||
"body.source .example-wrap pre.rust a", | ||
{"background-color": |background_color|}, | ||
ALL, | ||
)), | ||
], | ||
) | ||
|
||
// Set the theme to light. | ||
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} | ||
// We reload the page so the local storage settings are being used. | ||
reload: | ||
|
||
assert-css: ( | ||
"body.source .example-wrap pre.rust a", | ||
{"background-color": "rgb(238, 238, 238)"}, | ||
ALL, | ||
) | ||
call-function: ("check-background-color", ("ayu", "rgb(51, 51, 51)")) | ||
call-function: ("check-background-color", ("dark", "rgb(51, 51, 51)")) | ||
call-function: ("check-background-color", ("light", "rgb(238, 238, 238)")) |