-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #110037 - notriddle:notriddle/theme-default, r=Guilla…
…umeGomez rustdoc: add test and bug fix for theme defaults Part of #66181
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Ensure that the theme picker always starts with the actual defaults. | ||
goto: "file://" + |DOC_PATH| + "/test_docs/index.html" | ||
click: "#settings-menu" | ||
wait-for: "#theme-system-preference" | ||
assert: "#theme-system-preference:checked" | ||
assert: "#preferred-light-theme-light:checked" | ||
assert: "#preferred-dark-theme-dark:checked" | ||
assert-false: "#preferred-dark-theme-ayu:checked" | ||
|
||
// Test legacy migration from old theme setup without system-preference matching. | ||
// See https://github.com/rust-lang/rust/pull/77809#issuecomment-707875732 | ||
local-storage: { | ||
"rustdoc-preferred-light-theme": null, | ||
"rustdoc-preferred-dark-theme": null, | ||
"rustdoc-use-system-theme": null, | ||
"rustdoc-theme": "ayu" | ||
} | ||
goto: "file://" + |DOC_PATH| + "/test_docs/index.html" | ||
click: "#settings-menu" | ||
wait-for: "#theme-system-preference" | ||
assert: "#theme-system-preference:checked" | ||
assert: "#preferred-light-theme-light:checked" | ||
assert-false: "#preferred-dark-theme-dark:checked" | ||
assert: "#preferred-dark-theme-ayu:checked" |