2022-01-30 04:39:10 -06:00
|
|
|
// Ensures that the theme is working when going back in history.
|
2022-10-07 13:17:05 -05:00
|
|
|
goto: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-01-30 04:39:10 -06:00
|
|
|
// Set the theme to dark.
|
2022-01-19 16:06:17 -06:00
|
|
|
local-storage: {
|
|
|
|
"rustdoc-theme": "dark",
|
|
|
|
"rustdoc-use-system-theme": "false",
|
|
|
|
}
|
2022-01-30 04:39:10 -06:00
|
|
|
// We reload the page so the local storage settings are being used.
|
|
|
|
reload:
|
|
|
|
assert-css: ("body", { "background-color": "rgb(53, 53, 53)" })
|
|
|
|
assert-local-storage: { "rustdoc-theme": "dark" }
|
|
|
|
|
|
|
|
// Now we go to the settings page.
|
2022-10-07 13:17:05 -05:00
|
|
|
goto: "file://" + |DOC_PATH| + "/settings.html"
|
2022-01-19 16:06:17 -06:00
|
|
|
wait-for: "#settings"
|
2022-01-30 04:39:10 -06:00
|
|
|
// We change the theme to "light".
|
|
|
|
click: "#theme-light"
|
2022-03-21 09:50:05 -05:00
|
|
|
wait-for-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
2022-01-30 04:39:10 -06:00
|
|
|
assert-local-storage: { "rustdoc-theme": "light" }
|
|
|
|
|
|
|
|
// We go back in history.
|
|
|
|
history-go-back:
|
|
|
|
// Confirm that we're not on the settings page.
|
2022-01-19 16:06:17 -06:00
|
|
|
assert-false: "#settings"
|
2022-01-30 04:39:10 -06:00
|
|
|
// Check that the current theme is still "light".
|
|
|
|
assert-css: ("body", { "background-color": "rgb(255, 255, 255)" })
|
|
|
|
assert-local-storage: { "rustdoc-theme": "light" }
|