]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc-gui/rust-logo.goml
Rollup merge of #107773 - Mark-Simulacrum:rename-auto-template, r=estebank
[rust.git] / tests / rustdoc-gui / rust-logo.goml
1 // This test ensures that the correct style is applied to the rust logo in the sidebar.
2 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
3
4 define-function: (
5     "check-logo",
6     (theme, filter),
7     block {
8         // Going to the doc page.
9         goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
10         // Changing theme.
11         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         goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
16         // Changing theme (since it's local files, the local storage works by folder).
17         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         goto: "file://" + |DOC_PATH| + "/huge_logo/index.html"
22         // Changing theme on the new page (again...).
23         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
32 call-function: (
33     "check-logo",
34     {
35         "theme": "ayu",
36         "filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
37             "drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
38             "drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
39             "drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
40     },
41 )
42 call-function: (
43     "check-logo",
44     {
45         "theme": "dark",
46         "filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
47             "drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
48             "drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
49             "drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
50     },
51 )
52 call-function: (
53     "check-logo",
54     {
55         "theme": "light",
56         "filter": "none",
57     },
58 )