2022-09-16 16:22:23 +00:00
|
|
|
// This test checks links colors.
|
2023-04-11 17:11:34 +00:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
|
2022-09-16 16:22:23 +00:00
|
|
|
|
|
|
|
// This is needed so that the text color is computed.
|
|
|
|
show-text: true
|
|
|
|
|
2022-12-25 19:14:40 +00:00
|
|
|
define-function: (
|
|
|
|
"check-colors",
|
|
|
|
(theme, mod, macro, struct, enum, trait, fn, type, union, keyword,
|
|
|
|
sidebar, sidebar_current, sidebar_current_background),
|
2023-01-06 14:18:51 +00:00
|
|
|
block {
|
2023-04-11 17:11:34 +00:00
|
|
|
set-local-storage: {
|
2022-12-25 19:14:40 +00:00
|
|
|
"rustdoc-theme": |theme|,
|
|
|
|
"rustdoc-use-system-theme": "false",
|
2023-01-06 14:18:51 +00:00
|
|
|
}
|
|
|
|
reload:
|
2022-12-25 19:14:40 +00:00
|
|
|
// Checking results colors.
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (".item-table .mod", {"color": |mod|}, ALL)
|
|
|
|
assert-css: (".item-table .macro", {"color": |macro|}, ALL)
|
|
|
|
assert-css: (".item-table .struct", {"color": |struct|}, ALL)
|
|
|
|
assert-css: (".item-table .enum", {"color": |enum|}, ALL)
|
|
|
|
assert-css: (".item-table .trait", {"color": |trait|}, ALL)
|
|
|
|
assert-css: (".item-table .fn", {"color": |fn|}, ALL)
|
|
|
|
assert-css: (".item-table .type", {"color": |type|}, ALL)
|
|
|
|
assert-css: (".item-table .union", {"color": |union|}, ALL)
|
|
|
|
assert-css: (".item-table .keyword", {"color": |keyword|}, ALL)
|
2022-12-25 19:14:40 +00:00
|
|
|
// Checking sidebar elements.
|
2023-01-06 14:18:51 +00:00
|
|
|
assert-css: (
|
2022-12-25 19:14:40 +00:00
|
|
|
".sidebar-elems a:not(.current)",
|
|
|
|
{"color": |sidebar|, "background-color": "rgba(0, 0, 0, 0)", "font-weight": "400"},
|
|
|
|
ALL,
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
assert-css: (
|
2022-12-25 19:14:40 +00:00
|
|
|
".sidebar-elems a.current",
|
|
|
|
{
|
|
|
|
"color": |sidebar_current|,
|
|
|
|
"background-color": |sidebar_current_background|,
|
|
|
|
"font-weight": "500",
|
|
|
|
},
|
|
|
|
ALL,
|
2023-01-06 14:18:51 +00:00
|
|
|
)
|
|
|
|
},
|
2022-09-16 16:22:23 +00:00
|
|
|
)
|
|
|
|
|
2022-12-25 19:14:40 +00:00
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "ayu",
|
|
|
|
"mod": "rgb(57, 175, 215)",
|
|
|
|
"macro": "rgb(163, 122, 204)",
|
|
|
|
"struct": "rgb(255, 160, 165)",
|
|
|
|
"enum": "rgb(255, 160, 165)",
|
|
|
|
"trait": "rgb(57, 175, 215)",
|
|
|
|
"fn": "rgb(253, 214, 135)",
|
|
|
|
"type": "rgb(255, 160, 165)",
|
|
|
|
"union": "rgb(255, 160, 165)",
|
|
|
|
"keyword": "rgb(57, 175, 215)",
|
|
|
|
"sidebar": "rgb(83, 177, 219)",
|
|
|
|
"sidebar_current": "rgb(255, 180, 76)",
|
|
|
|
"sidebar_current_background": "rgba(0, 0, 0, 0)",
|
|
|
|
},
|
2022-09-16 16:22:23 +00:00
|
|
|
)
|
2022-12-25 19:14:40 +00:00
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "dark",
|
|
|
|
"mod": "rgb(210, 153, 29)",
|
|
|
|
"macro": "rgb(9, 189, 0)",
|
|
|
|
"struct": "rgb(45, 191, 184)",
|
|
|
|
"enum": "rgb(45, 191, 184)",
|
|
|
|
"trait": "rgb(183, 140, 242)",
|
|
|
|
"fn": "rgb(43, 171, 99)",
|
|
|
|
"type": "rgb(45, 191, 184)",
|
|
|
|
"union": "rgb(45, 191, 184)",
|
|
|
|
"keyword": "rgb(210, 153, 29)",
|
|
|
|
"sidebar": "rgb(253, 191, 53)",
|
|
|
|
"sidebar_current": "rgb(253, 191, 53)",
|
|
|
|
"sidebar_current_background": "rgb(68, 68, 68)",
|
|
|
|
},
|
2022-09-16 16:22:23 +00:00
|
|
|
)
|
2022-12-25 19:14:40 +00:00
|
|
|
call-function: (
|
|
|
|
"check-colors",
|
|
|
|
{
|
|
|
|
"theme": "light",
|
|
|
|
"mod": "rgb(56, 115, 173)",
|
|
|
|
"macro": "rgb(6, 128, 0)",
|
|
|
|
"struct": "rgb(173, 55, 138)",
|
|
|
|
"enum": "rgb(173, 55, 138)",
|
|
|
|
"trait": "rgb(110, 79, 201)",
|
|
|
|
"fn": "rgb(173, 124, 55)",
|
|
|
|
"type": "rgb(173, 55, 138)",
|
|
|
|
"union": "rgb(173, 55, 138)",
|
|
|
|
"keyword": "rgb(56, 115, 173)",
|
|
|
|
"sidebar": "rgb(53, 109, 164)",
|
|
|
|
"sidebar_current": "rgb(53, 109, 164)",
|
|
|
|
"sidebar_current_background": "rgb(255, 255, 255)",
|
|
|
|
},
|
2022-09-16 16:22:23 +00:00
|
|
|
)
|