]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc-gui/theme-in-history.goml
Rollup merge of #103408 - compiler-errors:rpitit-rustdoc, r=GuillaumeGomez
[rust.git] / src / test / rustdoc-gui / theme-in-history.goml
1 // Ensures that the theme is working when going back in history.
2 goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
3 // Set the theme to dark.
4 local-storage: {
5     "rustdoc-theme": "dark",
6     "rustdoc-preferred-dark-theme": "dark",
7     "rustdoc-use-system-theme": "false",
8 }
9 // We reload the page so the local storage settings are being used.
10 reload:
11 assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
12 assert-local-storage: { "rustdoc-theme": "dark" }
13
14 // Now we go to the settings page.
15 goto: "file://" + |DOC_PATH| + "/settings.html"
16 wait-for: "#settings"
17 // We change the theme to "light".
18 click: "#theme-light"
19 wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
20 assert-local-storage: { "rustdoc-theme": "light" }
21
22 // We go back in history.
23 history-go-back:
24 // Confirm that we're not on the settings page.
25 assert-false: "#settings"
26 // Check that the current theme is still "light".
27 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
28 assert-local-storage: { "rustdoc-theme": "light" }