fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.0 KiB58 linesraw
1// This test ensures that the correct style is applied to the rust logo in the sidebar.
2go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
3
4define-function: (
5    "check-logo",
6    (theme, filter),
7    block {
8        // Going to the doc page.
9        go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
10        // Changing theme.
11        set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
12        reload:
13        assert-css: (".rust-logo", {"filter": |filter|})
14        // Going to the source code page.
15        go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
16        // Changing theme (since it's local files, the local storage works by folder).
17        set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
18        reload:
19        assert-css: (".rust-logo", {"filter": |filter|})
20        // Now we check that the non-rust logos don't have a CSS filter set.
21        go-to: "file://" + |DOC_PATH| + "/huge_logo/index.html"
22        // Changing theme on the new page (again...).
23        set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
24        reload:
25        // Check there is no rust logo
26        assert-false: ".rust-logo"
27        // Check there is no filter.
28        assert-css: (".sidebar .logo-container img", {"filter": "none"})
29    },
30)
31
32call-function: (
33    "check-logo",
34    {
35        "theme": "ayu",
36        "filter": "drop-shadow(#fff 1px 0px 0px) " +
37            "drop-shadow(#fff 0px 1px 0px) " +
38            "drop-shadow(#fff -1px 0px 0px) " +
39            "drop-shadow(#fff 0px -1px 0px)",
40    },
41)
42call-function: (
43    "check-logo",
44    {
45        "theme": "dark",
46        "filter": "drop-shadow(#fff 1px 0px 0px) " +
47            "drop-shadow(#fff 0px 1px 0px) " +
48            "drop-shadow(#fff -1px 0px 0px) " +
49            "drop-shadow(#fff 0px -1px 0px)",
50    },
51)
52call-function: (
53    "check-logo",
54    {
55        "theme": "light",
56        "filter": "none",
57    },
58)