Skip to content

Commit 5f156cc

Browse files
authored
Rollup merge of #103011 - GuillaumeGomez:improve-unsafe-fn-gui-test, r=notriddle
Improve rustdoc `unsafe-fn` GUI test r? ``@notriddle``
2 parents 059bbf7 + 16cfd6c commit 5f156cc

File tree

2 files changed

+23
-32
lines changed

2 files changed

+23
-32
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.2
1+
0.12.3

Diff for: src/test/rustdoc-gui/unsafe-fn.goml

+22-31
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,28 @@
1+
// Check position and color of the `<sup>` for unsafe elements.
12
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
2-
3-
compare-elements-property: (
4-
"//a[@title='test_docs::safe_fn fn']/..",
5-
"//a[@title='test_docs::unsafe_fn fn']/..",
6-
["clientHeight"]
7-
)
8-
93
// If the text isn't displayed, the browser doesn't compute color style correctly...
104
show-text: true
115

12-
// Set the theme to dark.
13-
local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
14-
// We reload the page so the local storage settings are being used.
15-
reload:
16-
17-
assert-css: (".item-left sup", {
18-
"color": "rgb(221, 221, 221)"
19-
})
20-
21-
// Set the theme to ayu.
22-
local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"}
23-
// We reload the page so the local storage settings are being used.
24-
reload:
25-
26-
assert-css: (".item-left sup", {
27-
"color": "rgb(197, 197, 197)"
28-
})
6+
compare-elements-property: (
7+
"//a[@title='test_docs::safe_fn fn']/..",
8+
"//a[@title='test_docs::unsafe_fn fn']/..",
9+
["clientHeight"]
10+
)
2911

30-
// Set the theme to light.
31-
local-storage: {"rustdoc-theme": "light", "rustdoc-preferred-dark-theme": "light", "rustdoc-use-system-theme": "false"}
32-
// We reload the page so the local storage settings are being used.
33-
reload:
12+
define-function: (
13+
"sup-check",
14+
// `theme` is the theme being tested.
15+
// `color` is the expected color of the `<sup>` element.
16+
(theme, color),
17+
[
18+
// Set the theme.
19+
("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}),
20+
// We reload the page so the local storage settings are being used.
21+
("reload"),
22+
("assert-css", (".item-left sup", {"color": |color|})),
23+
],
24+
)
3425

35-
assert-css: (".item-left sup", {
36-
"color": "rgb(0, 0, 0)"
37-
})
26+
call-function: ("sup-check", ("dark", "rgb(221, 221, 221)"))
27+
call-function: ("sup-check", ("ayu", "rgb(197, 197, 197)"))
28+
call-function: ("sup-check", ("light", "rgb(0, 0, 0)"))

0 commit comments

Comments
 (0)