summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/jump-to-def-background.goml
blob: 3a7d48284d7c84327fcc8cbe0496a0d214e358ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// We check the background color on the jump to definition links in the source code page.
go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"

define-function: (
    "check-background-color",
    (theme, background_color),
    block {
        // Set the theme.
        set-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)"))