|
1 | 1 | // This test ensures that the correct style is applied to the rust logo in the sidebar.
|
2 | 2 | goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
3 | 3 |
|
4 |
| -// First we start with the dark theme. |
5 |
| -local-storage: { |
6 |
| - "rustdoc-theme": "dark", |
7 |
| - "rustdoc-preferred-dark-theme": "dark", |
8 |
| - "rustdoc-use-system-theme": "false", |
9 |
| -} |
10 |
| -reload: |
11 |
| - |
12 |
| -assert-css: ( |
13 |
| - ".rust-logo", |
14 |
| - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, |
| 4 | +define-function: ( |
| 5 | + "check-logo", |
| 6 | + (theme, filter), |
| 7 | + [ |
| 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 | + ], |
15 | 21 | )
|
16 | 22 |
|
17 |
| -// In the source view page now. |
18 |
| -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" |
19 |
| - |
20 |
| -local-storage: { |
21 |
| - "rustdoc-theme": "dark", |
22 |
| - "rustdoc-preferred-dark-theme": "dark", |
23 |
| - "rustdoc-use-system-theme": "false", |
24 |
| -} |
25 |
| -reload: |
26 |
| - |
27 |
| -assert-css: ( |
28 |
| - ".rust-logo", |
29 |
| - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, |
| 23 | +call-function: ( |
| 24 | + "check-logo", |
| 25 | + ("ayu", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"), |
30 | 26 | )
|
31 |
| - |
32 |
| -// Then with the ayu theme. |
33 |
| -local-storage: { |
34 |
| - "rustdoc-theme": "ayu", |
35 |
| - "rustdoc-preferred-dark-theme": "ayu", |
36 |
| - "rustdoc-use-system-theme": "false", |
37 |
| -} |
38 |
| -reload: |
39 |
| - |
40 |
| -assert-css: ( |
41 |
| - ".rust-logo", |
42 |
| - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, |
| 27 | +call-function: ( |
| 28 | + "check-logo", |
| 29 | + ("dark", "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"), |
43 | 30 | )
|
44 |
| - |
45 |
| -// In the source view page now. |
46 |
| -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" |
47 |
| - |
48 |
| -local-storage: { |
49 |
| - "rustdoc-theme": "ayu", |
50 |
| - "rustdoc-preferred-dark-theme": "ayu", |
51 |
| - "rustdoc-use-system-theme": "false", |
52 |
| -} |
53 |
| -reload: |
54 |
| - |
55 |
| -assert-css: ( |
56 |
| - ".rust-logo", |
57 |
| - {"filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px 1px 0px) drop-shadow(rgb(255, 255, 255) -1px 0px 0px) drop-shadow(rgb(255, 255, 255) 0px -1px 0px)"}, |
58 |
| -) |
59 |
| - |
60 |
| -// And finally with the light theme. |
61 |
| -local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} |
62 |
| -reload: |
63 |
| - |
64 |
| -assert-css: ( |
65 |
| - ".rust-logo", |
66 |
| - {"filter": "none"}, |
67 |
| -) |
68 |
| - |
69 |
| -// In the source view page now. |
70 |
| -goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" |
71 |
| - |
72 |
| -local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} |
73 |
| -reload: |
74 |
| - |
75 |
| -assert-css: ( |
76 |
| - ".rust-logo", |
77 |
| - {"filter": "none"}, |
| 31 | +call-function: ( |
| 32 | + "check-logo", |
| 33 | + ("light", "none"), |
78 | 34 | )
|
0 commit comments