summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/jump-to-def-background.goml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/rustdoc-gui/jump-to-def-background.goml
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-gui/jump-to-def-background.goml')
-rw-r--r--tests/rustdoc-gui/jump-to-def-background.goml22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/jump-to-def-background.goml b/tests/rustdoc-gui/jump-to-def-background.goml
new file mode 100644
index 000000000..8ee3ccf4a
--- /dev/null
+++ b/tests/rustdoc-gui/jump-to-def-background.goml
@@ -0,0 +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"
+
+define-function: (
+ "check-background-color",
+ (theme, background_color),
+ block {
+ // 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,
+ )
+ },
+)
+
+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)"))