rust/tests/rustdoc-gui/code-color.goml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.2 KiB
Plaintext
Raw Normal View History

2021-08-28 04:43:55 -05:00
// The ayu theme has a different color for the "<code>" tags in the doc blocks. We need to
// check that the rule isn't applied on other "<code>" elements.
//
// While we're at it, we also check it for the other themes.
go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
2021-08-28 04:43:55 -05:00
// If the text isn't displayed, the browser doesn't compute color style correctly...
show-text: true
define-function: (
"check-colors",
(theme, doc_code_color, doc_inline_code_color),
block {
// Set the theme.
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
// We reload the page so the local storage settings are being used.
reload:
assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL)
assert-css: (".docblock > p > code", {"color": |doc_inline_code_color|}, ALL)
},
)
2021-08-28 04:43:55 -05:00
call-function: ("check-colors", {
"theme": "ayu",
"doc_code_color": "#e6e1cf",
"doc_inline_code_color": "#ffb454",
})
call-function: ("check-colors", {
"theme": "dark",
"doc_code_color": "#ddd",
"doc_inline_code_color": "#ddd",
})
call-function: ("check-colors", {
"theme": "light",
"doc_code_color": "black",
"doc_inline_code_color": "black",
})