Skip to content

Commit 296700e

Browse files
authored
Rollup merge of #103434 - GuillaumeGomez:gui-test-jump-to-def-background-cleanup, r=notriddle
Use functions for jump-to-def-background rustdoc GUI test r? `@notriddle`
2 parents 88e0546 + f112c3a commit 296700e

File tree

1 file changed

+17
-38
lines changed

1 file changed

+17
-38
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,22 @@
11
// We check the background color on the jump to definition links in the source code page.
22
goto: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
33

4-
// Set the theme to dark.
5-
local-storage: {
6-
"rustdoc-theme": "dark",
7-
"rustdoc-preferred-dark-theme": "dark",
8-
"rustdoc-use-system-theme": "false",
9-
}
10-
// We reload the page so the local storage settings are being used.
11-
reload:
12-
13-
assert-css: (
14-
"body.source .example-wrap pre.rust a",
15-
{"background-color": "rgb(51, 51, 51)"},
16-
ALL,
17-
)
18-
19-
// Set the theme to ayu.
20-
local-storage: {
21-
"rustdoc-theme": "ayu",
22-
"rustdoc-preferred-dark-theme": "ayu",
23-
"rustdoc-use-system-theme": "false",
24-
}
25-
// We reload the page so the local storage settings are being used.
26-
reload:
27-
28-
assert-css: (
29-
"body.source .example-wrap pre.rust a",
30-
{"background-color": "rgb(51, 51, 51)"},
31-
ALL,
4+
define-function: (
5+
"check-background-color",
6+
(theme, background_color),
7+
[
8+
// Set the theme.
9+
("local-storage", { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false" }),
10+
// We reload the page so the local storage settings are being used.
11+
("reload"),
12+
("assert-css", (
13+
"body.source .example-wrap pre.rust a",
14+
{"background-color": |background_color|},
15+
ALL,
16+
)),
17+
],
3218
)
3319

34-
// Set the theme to light.
35-
local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"}
36-
// We reload the page so the local storage settings are being used.
37-
reload:
38-
39-
assert-css: (
40-
"body.source .example-wrap pre.rust a",
41-
{"background-color": "rgb(238, 238, 238)"},
42-
ALL,
43-
)
20+
call-function: ("check-background-color", ("ayu", "rgb(51, 51, 51)"))
21+
call-function: ("check-background-color", ("dark", "rgb(51, 51, 51)"))
22+
call-function: ("check-background-color", ("light", "rgb(238, 238, 238)"))

0 commit comments

Comments
 (0)