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".
15 wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
16 assert-local-storage: { "rustdoc-theme": "light" }
18 // We go back in history.
20 // Confirm that we're not on the settings page.
21 assert-false: ".settings"
22 // Check that the current theme is still "light".
23 assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
24 assert-local-storage: { "rustdoc-theme": "light" }