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: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"}
5 // We reload the page so the local storage settings are being used.
7 assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
8 assert-local-storage: { "rustdoc-theme": "dark" }
10 // Now we go to the settings page.
11 click: "#settings-menu"
13 // We change the theme to "light".
16 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
17 assert-local-storage: { "rustdoc-theme": "light" }
19 // We go back in history.
21 // Confirm that we're not on the settings page.
22 assert-false: ".settings"
23 // Check that the current theme is still "light".
24 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
25 assert-local-storage: { "rustdoc-theme": "light" }