summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-gui')
-rw-r--r--tests/rustdoc-gui/anchors.goml22
-rw-r--r--tests/rustdoc-gui/basic-code.goml2
-rw-r--r--tests/rustdoc-gui/code-sidebar-toggle.goml4
-rw-r--r--tests/rustdoc-gui/headings.goml20
-rw-r--r--tests/rustdoc-gui/item-decl-colors.goml49
-rw-r--r--tests/rustdoc-gui/jump-to-def-background.goml4
-rw-r--r--tests/rustdoc-gui/label-next-to-symbol.goml4
-rw-r--r--tests/rustdoc-gui/links-color.goml72
-rw-r--r--tests/rustdoc-gui/pocket-menu.goml73
-rw-r--r--tests/rustdoc-gui/run-on-hover.goml12
-rw-r--r--tests/rustdoc-gui/rust-logo.goml16
-rw-r--r--tests/rustdoc-gui/scrape-examples-toggle.goml12
-rw-r--r--tests/rustdoc-gui/search-error.goml6
-rw-r--r--tests/rustdoc-gui/search-form-elements.goml386
-rw-r--r--tests/rustdoc-gui/search-reexport.goml2
-rw-r--r--tests/rustdoc-gui/search-result-color.goml4
-rw-r--r--tests/rustdoc-gui/search-tab.goml52
-rw-r--r--tests/rustdoc-gui/sidebar-links-color.goml126
-rw-r--r--tests/rustdoc-gui/sidebar-source-code-display.goml42
-rw-r--r--tests/rustdoc-gui/sidebar-source-code.goml14
-rw-r--r--tests/rustdoc-gui/source-anchor-scroll.goml6
-rw-r--r--tests/rustdoc-gui/source-code-page.goml36
-rw-r--r--tests/rustdoc-gui/src-font-size.goml6
-rw-r--r--tests/rustdoc-gui/src/staged_api/lib.rs1
-rw-r--r--tests/rustdoc-gui/src/test_docs/lib.rs1
-rw-r--r--tests/rustdoc-gui/unsafe-fn.goml6
26 files changed, 422 insertions, 556 deletions
diff --git a/tests/rustdoc-gui/anchors.goml b/tests/rustdoc-gui/anchors.goml
index e9b772969..30b83f0da 100644
--- a/tests/rustdoc-gui/anchors.goml
+++ b/tests/rustdoc-gui/anchors.goml
@@ -17,34 +17,34 @@ define-function: (
assert-css: (".main-heading h1 a:nth-of-type(1)", {"color": |main_heading_color|})
assert-css: (".main-heading a:nth-of-type(2)", {"color": |main_heading_type_color|})
assert-css: (
- ".rightside .srclink",
+ ".rightside a.src",
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
ALL,
)
compare-elements-css: (
- ".rightside .srclink",
- ".rightside.srclink",
+ ".rightside a.src",
+ "a.rightside.src",
["color", "text-decoration"],
)
compare-elements-css: (
- ".main-heading .srclink",
- ".rightside.srclink",
+ ".main-heading a.src",
+ "a.rightside.src",
["color", "text-decoration"],
)
- move-cursor-to: ".main-heading .srclink"
+ move-cursor-to: ".main-heading a.src"
assert-css: (
- ".main-heading .srclink",
+ ".main-heading a.src",
{"color": |src_link_color|, "text-decoration": "underline solid " + |src_link_color|},
)
- move-cursor-to: ".impl-items .rightside .srclink"
+ move-cursor-to: ".impl-items .rightside a.src"
assert-css: (
- ".impl-items .rightside .srclink",
+ ".impl-items .rightside a.src",
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
)
- move-cursor-to: ".impl-items .rightside.srclink"
+ move-cursor-to: ".impl-items a.rightside.src"
assert-css: (
- ".impl-items .rightside.srclink",
+ ".impl-items a.rightside.src",
{"color": |src_link_color|, "text-decoration": "none solid " + |src_link_color|},
)
diff --git a/tests/rustdoc-gui/basic-code.goml b/tests/rustdoc-gui/basic-code.goml
index e372f7119..22ac53161 100644
--- a/tests/rustdoc-gui/basic-code.goml
+++ b/tests/rustdoc-gui/basic-code.goml
@@ -1,6 +1,6 @@
// Small test to ensure the "src-line-numbers" element is only present once on
// the page.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
-click: ".srclink"
+click: "a.src"
wait-for: ".src-line-numbers"
assert-count: (".src-line-numbers", 1)
diff --git a/tests/rustdoc-gui/code-sidebar-toggle.goml b/tests/rustdoc-gui/code-sidebar-toggle.goml
index 28c3712f3..d1efa45dc 100644
--- a/tests/rustdoc-gui/code-sidebar-toggle.goml
+++ b/tests/rustdoc-gui/code-sidebar-toggle.goml
@@ -1,7 +1,7 @@
// This test checks that the source code pages sidebar toggle is working as expected.
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
-click: ".srclink"
+click: "a.src"
wait-for: "#src-sidebar-toggle"
click: "#src-sidebar-toggle"
expect-failure: true
-assert-css: ("#source-sidebar", { "left": "-300px" })
+assert-css: ("#src-sidebar", { "left": "-300px" })
diff --git a/tests/rustdoc-gui/headings.goml b/tests/rustdoc-gui/headings.goml
index 089e2203a..102b699b1 100644
--- a/tests/rustdoc-gui/headings.goml
+++ b/tests/rustdoc-gui/headings.goml
@@ -194,27 +194,27 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "heading_color": "rgb(255, 255, 255)",
- "small_heading_color": "rgb(197, 197, 197)",
- "heading_border_color": "rgb(92, 103, 115)",
+ "heading_color": "#fff",
+ "small_heading_color": "#c5c5c5",
+ "heading_border_color": "#5c6773",
},
)
call-function: (
"check-colors",
{
"theme": "dark",
- "heading_color": "rgb(221, 221, 221)",
- "small_heading_color": "rgb(221, 221, 221)",
- "heading_border_color": "rgb(210, 210, 210)",
+ "heading_color": "#ddd",
+ "small_heading_color": "#ddd",
+ "heading_border_color": "#d2d2d2",
},
)
call-function: (
"check-colors",
{
"theme": "light",
- "heading_color": "rgb(0, 0, 0)",
- "small_heading_color": "rgb(0, 0, 0)",
- "heading_border_color": "rgb(221, 221, 221)",
+ "heading_color": "black",
+ "small_heading_color": "black",
+ "heading_border_color": "#ddd",
},
)
@@ -224,7 +224,7 @@ define-function: (
block {
set-local-storage: {"rustdoc-theme": |theme|}
reload:
- assert-css: (".since", {"color": "rgb(128, 128, 128)"}, ALL)
+ assert-css: (".since", {"color": "#808080"}, ALL)
},
)
diff --git a/tests/rustdoc-gui/item-decl-colors.goml b/tests/rustdoc-gui/item-decl-colors.goml
index 5732dd8ee..a77784273 100644
--- a/tests/rustdoc-gui/item-decl-colors.goml
+++ b/tests/rustdoc-gui/item-decl-colors.goml
@@ -20,6 +20,7 @@ define-function: (
block {
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.WithGenerics.html"
show-text: true
+
set-local-storage: {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}
reload:
assert-css: (".item-decl .code-attribute", {"color": |attr_color|}, ALL)
@@ -40,41 +41,41 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "attr_color": "rgb(153, 153, 153)",
- "trait_color": "rgb(57, 175, 215)",
- "struct_color": "rgb(255, 160, 165)",
- "enum_color": "rgb(255, 160, 165)",
- "primitive_color": "rgb(255, 160, 165)",
- "constant_color": "rgb(57, 175, 215)",
- "fn_color": "rgb(253, 214, 135)",
- "assoc_type_color": "rgb(57, 175, 215)",
+ "attr_color": "#999",
+ "trait_color": "#39afd7",
+ "struct_color": "#ffa0a5",
+ "enum_color": "#ffa0a5",
+ "primitive_color": "#ffa0a5",
+ "constant_color": "#39afd7",
+ "fn_color": "#fdd687",
+ "assoc_type_color": "#39afd7",
},
)
call-function: (
"check-colors",
{
"theme": "dark",
- "attr_color": "rgb(153, 153, 153)",
- "trait_color": "rgb(183, 140, 242)",
- "struct_color": "rgb(45, 191, 184)",
- "enum_color": "rgb(45, 191, 184)",
- "primitive_color": "rgb(45, 191, 184)",
- "constant_color": "rgb(210, 153, 29)",
- "fn_color": "rgb(43, 171, 99)",
- "assoc_type_color": "rgb(210, 153, 29)",
+ "attr_color": "#999",
+ "trait_color": "#b78cf2",
+ "struct_color": "#2dbfb8",
+ "enum_color": "#2dbfb8",
+ "primitive_color": "#2dbfb8",
+ "constant_color": "#d2991d",
+ "fn_color": "#2bab63",
+ "assoc_type_color": "#d2991d",
},
)
call-function: (
"check-colors",
{
"theme": "light",
- "attr_color": "rgb(153, 153, 153)",
- "trait_color": "rgb(110, 79, 201)",
- "struct_color": "rgb(173, 55, 138)",
- "enum_color": "rgb(173, 55, 138)",
- "primitive_color": "rgb(173, 55, 138)",
- "constant_color": "rgb(56, 115, 173)",
- "fn_color": "rgb(173, 124, 55)",
- "assoc_type_color": "rgb(56, 115, 173)",
+ "attr_color": "#999",
+ "trait_color": "#6e4fc9",
+ "struct_color": "#ad378a",
+ "enum_color": "#ad378a",
+ "primitive_color": "#ad378a",
+ "constant_color": "#3873ad",
+ "fn_color": "#ad7c37",
+ "assoc_type_color": "#3873ad",
},
)
diff --git a/tests/rustdoc-gui/jump-to-def-background.goml b/tests/rustdoc-gui/jump-to-def-background.goml
index 6adc36b0e..fa7ed3586 100644
--- a/tests/rustdoc-gui/jump-to-def-background.goml
+++ b/tests/rustdoc-gui/jump-to-def-background.goml
@@ -1,4 +1,4 @@
-// We check the background color on the jump to definition links in the source code page.
+// We check the background color on the jump to definition links in the src code page.
go-to: "file://" + |DOC_PATH| + "/src/link_to_definition/lib.rs.html"
define-function: (
@@ -10,7 +10,7 @@ define-function: (
// We reload the page so the local storage settings are being used.
reload:
assert-css: (
- "body.source .example-wrap pre.rust a",
+ "body.src .example-wrap pre.rust a",
{"background-color": |background_color|},
ALL,
)
diff --git a/tests/rustdoc-gui/label-next-to-symbol.goml b/tests/rustdoc-gui/label-next-to-symbol.goml
index eb603d6c6..d23f9114d 100644
--- a/tests/rustdoc-gui/label-next-to-symbol.goml
+++ b/tests/rustdoc-gui/label-next-to-symbol.goml
@@ -10,11 +10,11 @@ assert: (".stab.portability")
// make sure that deprecated and portability have the right colors
assert-css: (
".item-table .item-name .stab.deprecated",
- { "background-color": "rgb(255, 245, 214)" },
+ { "background-color": "#fff5d6" },
)
assert-css: (
".item-table .item-name .stab.portability",
- { "background-color": "rgb(255, 245, 214)" },
+ { "background-color": "#fff5d6" },
)
// table like view
diff --git a/tests/rustdoc-gui/links-color.goml b/tests/rustdoc-gui/links-color.goml
index 2ee4bce10..0789d785f 100644
--- a/tests/rustdoc-gui/links-color.goml
+++ b/tests/rustdoc-gui/links-color.goml
@@ -46,53 +46,53 @@ 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)",
+ "mod": "#39afd7",
+ "macro": "#a37acc",
+ "struct": "#ffa0a5",
+ "enum": "#ffa0a5",
+ "trait": "#39afd7",
+ "fn": "#fdd687",
+ "type": "#ffa0a5",
+ "union": "#ffa0a5",
+ "keyword": "#39afd7",
+ "sidebar": "#53b1db",
+ "sidebar_current": "#ffb44c",
+ "sidebar_current_background": "transparent",
},
)
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)",
+ "mod": "#d2991d",
+ "macro": "#09bd00",
+ "struct": "#2dbfb8",
+ "enum": "#2dbfb8",
+ "trait": "#b78cf2",
+ "fn": "#2bab63",
+ "type": "#2dbfb8",
+ "union": "#2dbfb8",
+ "keyword": "#d2991d",
+ "sidebar": "#fdbf35",
+ "sidebar_current": "#fdbf35",
+ "sidebar_current_background": "#444",
},
)
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)",
+ "mod": "#3873ad",
+ "macro": "#068000",
+ "struct": "#ad378a",
+ "enum": "#ad378a",
+ "trait": "#6e4fc9",
+ "fn": "#ad7c37",
+ "type": "#ad378a",
+ "union": "#ad378a",
+ "keyword": "#3873ad",
+ "sidebar": "#356da4",
+ "sidebar_current": "#356da4",
+ "sidebar_current_background": "#fff",
},
)
diff --git a/tests/rustdoc-gui/pocket-menu.goml b/tests/rustdoc-gui/pocket-menu.goml
index 4bdf31ecb..404e57403 100644
--- a/tests/rustdoc-gui/pocket-menu.goml
+++ b/tests/rustdoc-gui/pocket-menu.goml
@@ -29,52 +29,39 @@ click: "#help-button"
assert-css: ("#help-button .popover", {"display": "none"})
assert-css: ("#settings-menu .popover", {"display": "none"})
-// We check the borders color now:
-
-// Ayu theme
-set-local-storage: {
- "rustdoc-theme": "ayu",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-click: "#help-button"
-assert-css: (
- "#help-button .popover",
- {"display": "block", "border-color": "rgb(92, 103, 115)"},
-)
-compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
-compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
-
-// Dark theme
-set-local-storage: {
- "rustdoc-theme": "dark",
- "rustdoc-use-system-theme": "false",
-}
-reload:
+define-function: (
+ "check-popover-colors",
+ (theme, border_color),
+ block {
+ set-local-storage: {
+ "rustdoc-theme": |theme|,
+ "rustdoc-use-system-theme": "false",
+ }
+ reload:
-click: "#help-button"
-assert-css: (
- "#help-button .popover",
- {"display": "block", "border-color": "rgb(224, 224, 224)"},
+ click: "#help-button"
+ assert-css: (
+ "#help-button .popover",
+ {"display": "block", "border-color": |border_color|},
+ )
+ compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
+ compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
+ }
)
-compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
-compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
-
-// Light theme
-set-local-storage: {
- "rustdoc-theme": "light",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-click: "#help-button"
-assert-css: (
- "#help-button .popover",
- {"display": "block", "border-color": "rgb(224, 224, 224)"},
-)
-compare-elements-css: ("#help-button .popover", "#help-button .top", ["border-color"])
-compare-elements-css: ("#help-button .popover", "#help-button .bottom", ["border-color"])
+// We check the borders color now:
+call-function: ("check-popover-colors", {
+ "theme": "ayu",
+ "border_color": "#5c6773",
+})
+call-function: ("check-popover-colors", {
+ "theme": "dark",
+ "border_color": "#e0e0e0",
+})
+call-function: ("check-popover-colors", {
+ "theme": "light",
+ "border_color": "#e0e0e0",
+})
// Opening the mobile sidebar should close the settings popover.
set-window-size: (650, 600)
diff --git a/tests/rustdoc-gui/run-on-hover.goml b/tests/rustdoc-gui/run-on-hover.goml
index b5fc49eac..1f87febce 100644
--- a/tests/rustdoc-gui/run-on-hover.goml
+++ b/tests/rustdoc-gui/run-on-hover.goml
@@ -33,22 +33,22 @@ define-function: (
call-function: ("check-run-button", {
"theme": "ayu",
- "color": "rgb(120, 135, 151)",
+ "color": "#788797",
"background": "rgba(57, 175, 215, 0.09)",
- "hover_color": "rgb(197, 197, 197)",
+ "hover_color": "#c5c5c5",
"hover_background": "rgba(57, 175, 215, 0.37)",
})
call-function: ("check-run-button", {
"theme": "dark",
- "color": "rgb(222, 222, 222)",
+ "color": "#dedede",
"background": "rgba(78, 139, 202, 0.2)",
- "hover_color": "rgb(222, 222, 222)",
+ "hover_color": "#dedede",
"hover_background": "rgb(78, 139, 202)",
})
call-function: ("check-run-button", {
"theme": "light",
- "color": "rgb(245, 245, 245)",
+ "color": "#f5f5f5",
"background": "rgba(78, 139, 202, 0.2)",
- "hover_color": "rgb(245, 245, 245)",
+ "hover_color": "#f5f5f5",
"hover_background": "rgb(78, 139, 202)",
})
diff --git a/tests/rustdoc-gui/rust-logo.goml b/tests/rustdoc-gui/rust-logo.goml
index 640ed152b..cd453aea2 100644
--- a/tests/rustdoc-gui/rust-logo.goml
+++ b/tests/rustdoc-gui/rust-logo.goml
@@ -33,20 +33,20 @@ call-function: (
"check-logo",
{
"theme": "ayu",
- "filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
- "drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
- "drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
- "drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
+ "filter": "drop-shadow(#fff 1px 0px 0px) " +
+ "drop-shadow(#fff 0px 1px 0px) " +
+ "drop-shadow(#fff -1px 0px 0px) " +
+ "drop-shadow(#fff 0px -1px 0px)",
},
)
call-function: (
"check-logo",
{
"theme": "dark",
- "filter": "drop-shadow(rgb(255, 255, 255) 1px 0px 0px) " +
- "drop-shadow(rgb(255, 255, 255) 0px 1px 0px) " +
- "drop-shadow(rgb(255, 255, 255) -1px 0px 0px) " +
- "drop-shadow(rgb(255, 255, 255) 0px -1px 0px)",
+ "filter": "drop-shadow(#fff 1px 0px 0px) " +
+ "drop-shadow(#fff 0px 1px 0px) " +
+ "drop-shadow(#fff -1px 0px 0px) " +
+ "drop-shadow(#fff 0px -1px 0px)",
},
)
call-function: (
diff --git a/tests/rustdoc-gui/scrape-examples-toggle.goml b/tests/rustdoc-gui/scrape-examples-toggle.goml
index 9cec6d2bb..f742b3186 100644
--- a/tests/rustdoc-gui/scrape-examples-toggle.goml
+++ b/tests/rustdoc-gui/scrape-examples-toggle.goml
@@ -28,18 +28,18 @@ define-function: (
call-function: ("check-color", {
"theme": "ayu",
- "toggle_line_color": "rgb(153, 153, 153)",
- "toggle_line_hover_color": "rgb(197, 197, 197)",
+ "toggle_line_color": "#999",
+ "toggle_line_hover_color": "#c5c5c5",
})
call-function: ("check-color", {
"theme": "dark",
- "toggle_line_color": "rgb(153, 153, 153)",
- "toggle_line_hover_color": "rgb(197, 197, 197)",
+ "toggle_line_color": "#999",
+ "toggle_line_hover_color": "#c5c5c5",
})
call-function: ("check-color", {
"theme": "light",
- "toggle_line_color": "rgb(204, 204, 204)",
- "toggle_line_hover_color": "rgb(153, 153, 153)",
+ "toggle_line_color": "#ccc",
+ "toggle_line_hover_color": "#999",
})
// Toggling all docs will close additional examples
diff --git a/tests/rustdoc-gui/search-error.goml b/tests/rustdoc-gui/search-error.goml
index d21905e90..70aeda176 100644
--- a/tests/rustdoc-gui/search-error.goml
+++ b/tests/rustdoc-gui/search-error.goml
@@ -20,20 +20,20 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "error_background": "rgb(79, 76, 76)",
+ "error_background": "#4f4c4c",
},
)
call-function: (
"check-colors",
{
"theme": "dark",
- "error_background": "rgb(72, 72, 72)",
+ "error_background": "#484848",
},
)
call-function: (
"check-colors",
{
"theme": "light",
- "error_background": "rgb(208, 204, 204)",
+ "error_background": "#d0cccc",
},
)
diff --git a/tests/rustdoc-gui/search-form-elements.goml b/tests/rustdoc-gui/search-form-elements.goml
index 83c698090..a4e223648 100644
--- a/tests/rustdoc-gui/search-form-elements.goml
+++ b/tests/rustdoc-gui/search-form-elements.goml
@@ -2,262 +2,138 @@
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
show-text: true
-// Ayu theme
-set-local-storage: {
- "rustdoc-theme": "ayu",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".search-input",
- {
- "border-color": "rgb(92, 103, 115)",
- "background-color": "rgb(20, 25, 32)",
- "color": "rgb(255, 255, 255)",
- },
-)
-focus: ".search-input"
-// Nothing should change.
-assert-css: (
- ".search-input",
- {
- "border-color": "rgb(92, 103, 115)",
- "background-color": "rgb(20, 25, 32)",
- "color": "rgb(255, 255, 255)",
- },
-)
-
-assert-css: (
- "#help-button",
- {"border-color": "rgb(197, 197, 197)"},
-)
-assert-css: (
- "#help-button > a",
- {
- "color": "rgb(255, 255, 255)",
- "border-color": "rgb(92, 103, 115)",
- "background-color": "rgb(20, 25, 32)",
- },
-)
-move-cursor-to: "#help-button"
-assert-css: (
- "#help-button:hover",
- {"border-color": "rgb(197, 197, 197)"},
-)
-// Only "border-color" should change.
-assert-css: (
- "#help-button:hover > a",
- {
- "color": "rgb(255, 255, 255)",
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(20, 25, 32)",
- },
-)
-// Link color inside
-click: "#help-button"
-assert-css: (
- "#help a",
- {
- "color": "rgb(57, 175, 215)",
- },
-)
-
-assert-css: (
- "#settings-menu",
- {"border-color": "rgb(197, 197, 197)"},
-)
-assert-css: (
- "#settings-menu > a",
- {
- "border-color": "rgb(92, 103, 115)",
- "background-color": "rgb(20, 25, 32)",
- },
-)
-move-cursor-to: "#settings-menu"
-assert-css: (
- "#settings-menu:hover",
- {"border-color": "rgb(197, 197, 197)"},
-)
-// Only "border-color" should change.
-assert-css: (
- "#settings-menu:hover > a",
- {
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(20, 25, 32)",
- },
-)
-
-// Dark theme
-set-local-storage: {
- "rustdoc-theme": "dark",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".search-input",
- {
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(240, 240, 240)",
- "color": "rgb(17, 17, 17)",
- },
-)
-focus: ".search-input"
-// Only "border-color" should change.
-assert-css: (
- ".search-input",
- {
- "border-color": "rgb(0, 141, 253)",
- "background-color": "rgb(240, 240, 240)",
- "color": "rgb(17, 17, 17)",
- },
-)
-
-assert-css: (
- "#help-button",
- {"border-color": "rgb(221, 221, 221)"},
-)
-assert-css: (
- "#help-button > a",
- {
- "color": "rgb(0, 0, 0)",
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(240, 240, 240)",
- },
-)
-move-cursor-to: "#help-button"
-assert-css: (
- "#help-button:hover",
- {"border-color": "rgb(221, 221, 221)"},
-)
-// Only "border-color" should change.
-assert-css: (
- "#help-button:hover > a",
- {
- "color": "rgb(0, 0, 0)",
- "border-color": "rgb(255, 185, 0)",
- "background-color": "rgb(240, 240, 240)",
- },
-)
-// Link color inside
-click: "#help-button"
-assert-css: (
- "#help a",
- {
- "color": "rgb(210, 153, 29)",
+define-function: (
+ "check-search-colors",
+ (
+ theme, border, background, search_input_color, search_input_border_focus,
+ menu_button_border, menu_button_a_color, menu_button_a_border_hover, menu_a_color,
+ ),
+ block {
+ set-local-storage: {
+ "rustdoc-theme": |theme|,
+ "rustdoc-use-system-theme": "false",
+ }
+ reload:
+ assert-css: (
+ ".search-input",
+ {
+ "border-color": |border|,
+ "background-color": |background|,
+ "color": |search_input_color|,
+ },
+ )
+ // Focus on search input.
+ focus: ".search-input"
+ assert-css: (
+ ".search-input",
+ {
+ "border-color": |search_input_border_focus|,
+ "background-color": |background|,
+ "color": |search_input_color|,
+ },
+ )
+ assert-css: (
+ "#help-button",
+ {"border-color": |menu_button_border|},
+ )
+ assert-css: (
+ "#help-button > a",
+ {
+ "color": |menu_button_a_color|,
+ "border-color": |border|,
+ "background-color": |background|,
+ },
+ )
+ // Hover help button.
+ move-cursor-to: "#help-button"
+ assert-css: (
+ "#help-button:hover",
+ {"border-color": |menu_button_border|},
+ )
+ assert-css: (
+ "#help-button > a",
+ {
+ "color": |menu_button_a_color|,
+ "border-color": |menu_button_a_border_hover|,
+ "background-color": |background|,
+ },
+ )
+ // Link color inside
+ click: "#help-button"
+ assert-css: (
+ "#help a",
+ {
+ "color": |menu_a_color|,
+ },
+ )
+ assert-css: (
+ "#settings-menu",
+ {"border-color": |menu_button_border|},
+ )
+ assert-css: (
+ "#settings-menu > a",
+ {
+ "color": |menu_button_a_color|,
+ "border-color": |border|,
+ "background-color": |background|,
+ },
+ )
+ // Hover settings menu.
+ move-cursor-to: "#settings-menu"
+ assert-css: (
+ "#settings-menu:hover",
+ {"border-color": |menu_button_border|},
+ )
+ assert-css: (
+ "#settings-menu:hover > a",
+ {
+ "color": |menu_button_a_color|,
+ "border-color": |menu_button_a_border_hover|,
+ "background-color": |background|,
+ },
+ )
},
)
-assert-css: (
- "#settings-menu",
- {"border-color": "rgb(221, 221, 221)"},
-)
-assert-css: (
- "#settings-menu > a",
- {
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(240, 240, 240)",
- },
-)
-move-cursor-to: "#settings-menu"
-assert-css: (
- "#settings-menu:hover",
- {"border-color": "rgb(221, 221, 221)"},
-)
-// Only "border-color" should change.
-assert-css: (
- "#settings-menu:hover > a",
- {
- "color": "rgb(0, 0, 0)",
- "border-color": "rgb(255, 185, 0)",
- "background-color": "rgb(240, 240, 240)",
- },
-)
-
-// Light theme
-set-local-storage: {
- "rustdoc-theme": "light",
- "rustdoc-use-system-theme": "false",
-}
-reload:
-
-assert-css: (
- ".search-input",
- {
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(255, 255, 255)",
- "color": "rgb(0, 0, 0)",
- },
-)
-focus: ".search-input"
-// Nothing should change.
-assert-css: (
- ".search-input",
- {
- "border-color": "rgb(102, 175, 233)",
- "background-color": "rgb(255, 255, 255)",
- "color": "rgb(0, 0, 0)",
- },
-)
-
-assert-css: (
- "#help-button",
- {"border-color": "rgb(0, 0, 0)"},
-)
-assert-css: (
- "#help-button > a",
- {
- "color": "rgb(0, 0, 0)",
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(255, 255, 255)",
- },
-)
-move-cursor-to: "#help-button"
-assert-css: (
- "#help-button:hover",
- {"border-color": "rgb(0, 0, 0)"},
-)
-// Only "border-color" should change.
-assert-css: (
- "#help-button:hover > a",
- {
- "color": "rgb(0, 0, 0)",
- "border-color": "rgb(113, 113, 113)",
- "background-color": "rgb(255, 255, 255)",
- },
-)
-// Link color inside
-click: "#help-button"
-assert-css: (
- "#help a",
- {
- "color": "rgb(56, 115, 173)",
- },
-)
-
-assert-css: (
- "#settings-menu",
- {"border-color": "rgb(0, 0, 0)"},
-)
-assert-css: (
- "#settings-menu > a",
- {
- "border-color": "rgb(224, 224, 224)",
- "background-color": "rgb(255, 255, 255)",
- },
-)
-move-cursor-to: "#settings-menu"
-assert-css: (
- "#settings-menu:hover",
- {"border-color": "rgb(0, 0, 0)"},
-)
-// Only "border-color" should change.
-assert-css: (
- "#settings-menu:hover > a",
- {
- "color": "rgb(0, 0, 0)",
- "border-color": "rgb(113, 113, 113)",
- "background-color": "rgb(255, 255, 255)",
- },
+call-function: (
+ "check-search-colors",
+ {
+ "theme": "ayu",
+ "border": "#5c6773",
+ "background": "#141920",
+ "search_input_color": "#fff",
+ "search_input_border_focus": "#5c6773",
+ "menu_button_border": "#c5c5c5",
+ "menu_button_a_color": "#fff",
+ "menu_button_a_border_hover": "#e0e0e0",
+ "menu_a_color": "#39afd7",
+ }
+)
+call-function: (
+ "check-search-colors",
+ {
+ "theme": "dark",
+ "border": "#e0e0e0",
+ "background": "#f0f0f0",
+ "search_input_color": "#111",
+ "search_input_border_focus": "#008dfd",
+ "menu_button_border": "#ddd",
+ "menu_button_a_color": "#000",
+ "menu_button_a_border_hover": "#ffb900",
+ "menu_a_color": "#d2991d",
+ }
+)
+call-function: (
+ "check-search-colors",
+ {
+ "theme": "light",
+ "border": "#e0e0e0",
+ "background": "#fff",
+ "search_input_color": "#000",
+ "search_input_border_focus": "#66afe9",
+ "menu_button_border": "#000",
+ "menu_button_a_color": "#000",
+ "menu_button_a_border_hover": "#717171",
+ "menu_a_color": "#3873ad",
+ }
)
diff --git a/tests/rustdoc-gui/search-reexport.goml b/tests/rustdoc-gui/search-reexport.goml
index 6ea6d53e2..b9d2c8f15 100644
--- a/tests/rustdoc-gui/search-reexport.goml
+++ b/tests/rustdoc-gui/search-reexport.goml
@@ -26,7 +26,7 @@ write: (".search-input", "AliasForTheStdReexport")
wait-for: "//a[@class='result-import']"
assert-text: (
"a.result-import .result-name",
- "AliasForTheStdReexport - see re-export test_docs::TheStdReexport",
+ "re-export AliasForTheStdReexport - see test_docs::TheStdReexport",
)
// Same thing again, we click on it to ensure the background is once again set as expected.
click: "//a[@class='result-import']"
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index 7a7785fd9..f9f81c5ba 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -368,8 +368,8 @@ define-function: (
// Waiting for the search results to appear...
wait-for: "#search-tabs"
// Checking that the colors for the alias element are the ones expected.
- assert-css: (".result-name > .alias", {"color": |alias|})
- assert-css: (".result-name > .alias > .grey", {"color": |grey|})
+ assert-css: (".result-name .path .alias", {"color": |alias|})
+ assert-css: (".result-name .path .alias > .grey", {"color": |grey|})
// Leave the search results to prevent reloading with an already filled search input.
press-key: "Escape"
},
diff --git a/tests/rustdoc-gui/search-tab.goml b/tests/rustdoc-gui/search-tab.goml
index 2223598f0..7bbde3ec2 100644
--- a/tests/rustdoc-gui/search-tab.goml
+++ b/tests/rustdoc-gui/search-tab.goml
@@ -40,37 +40,37 @@ define-function: (
call-function: ("check-colors", {
"theme": "ayu",
- "background": "rgba(0, 0, 0, 0)",
- "background_selected": "rgb(20, 25, 32)",
- "background_hover": "rgba(0, 0, 0, 0)",
- "border_bottom": "0px none rgb(197, 197, 197)",
- "border_bottom_selected": "1px solid rgb(255, 180, 76)",
+ "background": "transparent",
+ "background_selected": "#141920",
+ "background_hover": "transparent",
+ "border_bottom": "0px none #c5c5c5",
+ "border_bottom_selected": "1px solid #ffb44c",
"border_bottom_hover": "1px solid rgba(242, 151, 24, 0.3)",
- "border_top": "0px none rgb(197, 197, 197)",
- "border_top_selected": "0px none rgb(197, 197, 197)",
- "border_top_hover": "0px none rgb(197, 197, 197)",
+ "border_top": "0px none #c5c5c5",
+ "border_top_selected": "0px none #c5c5c5",
+ "border_top_hover": "0px none #c5c5c5",
})
call-function: ("check-colors", {
"theme": "dark",
- "background": "rgb(37, 37, 37)",
- "background_selected": "rgb(53, 53, 53)",
- "background_hover": "rgb(53, 53, 53)",
- "border_bottom": "0px none rgb(221, 221, 221)",
- "border_bottom_selected": "0px none rgb(221, 221, 221)",
- "border_bottom_hover": "0px none rgb(221, 221, 221)",
- "border_top": "2px solid rgb(37, 37, 37)",
- "border_top_selected": "2px solid rgb(0, 137, 255)",
- "border_top_hover": "2px solid rgb(0, 137, 255)",
+ "background": "#252525",
+ "background_selected": "#353535",
+ "background_hover": "#353535",
+ "border_bottom": "0px none #ddd",
+ "border_bottom_selected": "0px none #ddd",
+ "border_bottom_hover": "0px none #ddd",
+ "border_top": "2px solid #252525",
+ "border_top_selected": "2px solid #0089ff",
+ "border_top_hover": "2px solid #0089ff",
})
call-function: ("check-colors", {
"theme": "light",
- "background": "rgb(230, 230, 230)",
- "background_selected": "rgb(255, 255, 255)",
- "background_hover": "rgb(255, 255, 255)",
- "border_bottom": "0px none rgb(0, 0, 0)",
- "border_bottom_selected": "0px none rgb(0, 0, 0)",
- "border_bottom_hover": "0px none rgb(0, 0, 0)",
- "border_top": "2px solid rgb(230, 230, 230)",
- "border_top_selected": "2px solid rgb(0, 137, 255)",
- "border_top_hover": "2px solid rgb(0, 137, 255)",
+ "background": "#e6e6e6",
+ "background_selected": "#fff",
+ "background_hover": "#fff",
+ "border_bottom": "0px none #000",
+ "border_bottom_selected": "0px none #000",
+ "border_bottom_hover": "0px none #000",
+ "border_top": "2px solid #e6e6e6",
+ "border_top_selected": "2px solid #0089ff",
+ "border_top_hover": "2px solid #0089ff",
})
diff --git a/tests/rustdoc-gui/sidebar-links-color.goml b/tests/rustdoc-gui/sidebar-links-color.goml
index cec1a7999..079d582a5 100644
--- a/tests/rustdoc-gui/sidebar-links-color.goml
+++ b/tests/rustdoc-gui/sidebar-links-color.goml
@@ -92,80 +92,80 @@ call-function: (
"check-colors",
{
"theme": "ayu",
- "struct": "rgb(83, 177, 219)",
- "struct_hover": "rgb(255, 180, 76)",
- "struct_hover_background": "rgba(0, 0, 0, 0)",
- "enum": "rgb(83, 177, 219)",
- "enum_hover": "rgb(255, 180, 76)",
- "enum_hover_background": "rgba(0, 0, 0, 0)",
- "union": "rgb(83, 177, 219)",
- "union_hover": "rgb(255, 180, 76)",
- "union_hover_background": "rgba(0, 0, 0, 0)",
- "trait": "rgb(83, 177, 219)",
- "trait_hover": "rgb(255, 180, 76)",
- "trait_hover_background": "rgba(0, 0, 0, 0)",
- "fn": "rgb(83, 177, 219)",
- "fn_hover": "rgb(255, 180, 76)",
- "fn_hover_background": "rgba(0, 0, 0, 0)",
- "type": "rgb(83, 177, 219)",
- "type_hover": "rgb(255, 180, 76)",
- "type_hover_background": "rgba(0, 0, 0, 0)",
- "keyword": "rgb(83, 177, 219)",
- "keyword_hover": "rgb(255, 180, 76)",
- "keyword_hover_background": "rgba(0, 0, 0, 0)",
+ "struct": "#53b1db",
+ "struct_hover": "#ffb44c",
+ "struct_hover_background": "transparent",
+ "enum": "#53b1db",
+ "enum_hover": "#ffb44c",
+ "enum_hover_background": "transparent",
+ "union": "#53b1db",
+ "union_hover": "#ffb44c",
+ "union_hover_background": "transparent",
+ "trait": "#53b1db",
+ "trait_hover": "#ffb44c",
+ "trait_hover_background": "transparent",
+ "fn": "#53b1db",
+ "fn_hover": "#ffb44c",
+ "fn_hover_background": "transparent",
+ "type": "#53b1db",
+ "type_hover": "#ffb44c",
+ "type_hover_background": "transparent",
+ "keyword": "#53b1db",
+ "keyword_hover": "#ffb44c",
+ "keyword_hover_background": "transparent",
}
)
call-function: (
"check-colors",
{
"theme": "dark",
- "struct": "rgb(253, 191, 53)",
- "struct_hover": "rgb(253, 191, 53)",
- "struct_hover_background": "rgb(68, 68, 68)",
- "enum": "rgb(253, 191, 53)",
- "enum_hover": "rgb(253, 191, 53)",
- "enum_hover_background": "rgb(68, 68, 68)",
- "union": "rgb(253, 191, 53)",
- "union_hover": "rgb(253, 191, 53)",
- "union_hover_background": "rgb(68, 68, 68)",
- "trait": "rgb(253, 191, 53)",
- "trait_hover": "rgb(253, 191, 53)",
- "trait_hover_background": "rgb(68, 68, 68)",
- "fn": "rgb(253, 191, 53)",
- "fn_hover": "rgb(253, 191, 53)",
- "fn_hover_background": "rgb(68, 68, 68)",
- "type": "rgb(253, 191, 53)",
- "type_hover": "rgb(253, 191, 53)",
- "type_hover_background": "rgb(68, 68, 68)",
- "keyword": "rgb(253, 191, 53)",
- "keyword_hover": "rgb(253, 191, 53)",
- "keyword_hover_background": "rgb(68, 68, 68)",
+ "struct": "#fdbf35",
+ "struct_hover": "#fdbf35",
+ "struct_hover_background": "#444",
+ "enum": "#fdbf35",
+ "enum_hover": "#fdbf35",
+ "enum_hover_background": "#444",
+ "union": "#fdbf35",
+ "union_hover": "#fdbf35",
+ "union_hover_background": "#444",
+ "trait": "#fdbf35",
+ "trait_hover": "#fdbf35",
+ "trait_hover_background": "#444",
+ "fn": "#fdbf35",
+ "fn_hover": "#fdbf35",
+ "fn_hover_background": "#444",
+ "type": "#fdbf35",
+ "type_hover": "#fdbf35",
+ "type_hover_background": "#444",
+ "keyword": "#fdbf35",
+ "keyword_hover": "#fdbf35",
+ "keyword_hover_background": "#444",
}
)
call-function: (
"check-colors",
{
"theme": "light",
- "struct": "rgb(53, 109, 164)",
- "struct_hover": "rgb(53, 109, 164)",
- "struct_hover_background": "rgb(255, 255, 255)",
- "enum": "rgb(53, 109, 164)",
- "enum_hover": "rgb(53, 109, 164)",
- "enum_hover_background": "rgb(255, 255, 255)",
- "union": "rgb(53, 109, 164)",
- "union_hover": "rgb(53, 109, 164)",
- "union_hover_background": "rgb(255, 255, 255)",
- "trait": "rgb(53, 109, 164)",
- "trait_hover": "rgb(53, 109, 164)",
- "trait_hover_background": "rgb(255, 255, 255)",
- "fn": "rgb(53, 109, 164)",
- "fn_hover": "rgb(53, 109, 164)",
- "fn_hover_background": "rgb(255, 255, 255)",
- "type": "rgb(53, 109, 164)",
- "type_hover": "rgb(53, 109, 164)",
- "type_hover_background": "rgb(255, 255, 255)",
- "keyword": "rgb(53, 109, 164)",
- "keyword_hover": "rgb(53, 109, 164)",
- "keyword_hover_background": "rgb(255, 255, 255)",
+ "struct": "#356da4",
+ "struct_hover": "#356da4",
+ "struct_hover_background": "#fff",
+ "enum": "#356da4",
+ "enum_hover": "#356da4",
+ "enum_hover_background": "#fff",
+ "union": "#356da4",
+ "union_hover": "#356da4",
+ "union_hover_background": "#fff",
+ "trait": "#356da4",
+ "trait_hover": "#356da4",
+ "trait_hover_background": "#fff",
+ "fn": "#356da4",
+ "fn_hover": "#356da4",
+ "fn_hover_background": "#fff",
+ "type": "#356da4",
+ "type_hover": "#356da4",
+ "type_hover_background": "#fff",
+ "keyword": "#356da4",
+ "keyword_hover": "#356da4",
+ "keyword_hover_background": "#fff",
}
)
diff --git a/tests/rustdoc-gui/sidebar-source-code-display.goml b/tests/rustdoc-gui/sidebar-source-code-display.goml
index 0c680bcc9..88546ed25 100644
--- a/tests/rustdoc-gui/sidebar-source-code-display.goml
+++ b/tests/rustdoc-gui/sidebar-source-code-display.goml
@@ -40,7 +40,7 @@ define-function: (
reload:
wait-for-css: ("#src-sidebar-toggle", {"visibility": "visible"})
assert-css: (
- "#source-sidebar details[open] > .files a.selected",
+ "#src-sidebar details[open] > .files a.selected",
{"color": |color_hover|, "background-color": |background|},
)
@@ -62,58 +62,58 @@ define-function: (
// Without hover or focus.
assert-css: (
- "#source-sidebar details[open] > .files a:not(.selected)",
+ "#src-sidebar details[open] > .files a:not(.selected)",
{"color": |color|, "background-color": |background_toggle|},
)
// With focus.
- focus: "#source-sidebar details[open] > .files a:not(.selected)"
+ focus: "#src-sidebar details[open] > .files a:not(.selected)"
wait-for-css: (
- "#source-sidebar details[open] > .files a:not(.selected):focus",
+ "#src-sidebar details[open] > .files a:not(.selected):focus",
{"color": |color_hover|, "background-color": |background_hover|},
)
focus: ".search-input"
// With hover.
- move-cursor-to: "#source-sidebar details[open] > .files a:not(.selected)"
+ move-cursor-to: "#src-sidebar details[open] > .files a:not(.selected)"
assert-css: (
- "#source-sidebar details[open] > .files a:not(.selected):hover",
+ "#src-sidebar details[open] > .files a:not(.selected):hover",
{"color": |color_hover|, "background-color": |background_hover|},
)
// Without hover or focus.
assert-css: (
- "#source-sidebar .dir-entry summary",
+ "#src-sidebar .dir-entry summary",
{"color": |color|, "background-color": |background_toggle|},
)
// With focus.
- focus: "#source-sidebar .dir-entry summary"
+ focus: "#src-sidebar .dir-entry summary"
wait-for-css: (
- "#source-sidebar .dir-entry summary:focus",
+ "#src-sidebar .dir-entry summary:focus",
{"color": |color_hover|, "background-color": |background_hover|},
)
focus: ".search-input"
// With hover.
- move-cursor-to: "#source-sidebar .dir-entry summary"
+ move-cursor-to: "#src-sidebar .dir-entry summary"
assert-css: (
- "#source-sidebar .dir-entry summary:hover",
+ "#src-sidebar .dir-entry summary:hover",
{"color": |color_hover|, "background-color": |background_hover|},
)
// Without hover or focus.
assert-css: (
- "#source-sidebar details[open] > .folders > details > summary",
+ "#src-sidebar details[open] > .folders > details > summary",
{"color": |color|, "background-color": |background_toggle|},
)
// With focus.
- focus: "#source-sidebar details[open] > .folders > details > summary"
+ focus: "#src-sidebar details[open] > .folders > details > summary"
wait-for-css: (
- "#source-sidebar details[open] > .folders > details > summary:focus",
+ "#src-sidebar details[open] > .folders > details > summary:focus",
{"color": |color_hover|, "background-color": |background_hover|},
)
focus: ".search-input"
// With hover.
- move-cursor-to: "#source-sidebar details[open] > .folders > details > summary"
+ move-cursor-to: "#src-sidebar details[open] > .folders > details > summary"
assert-css: (
- "#source-sidebar details[open] > .folders > details > summary:hover",
+ "#src-sidebar details[open] > .folders > details > summary:hover",
{"color": |color_hover|, "background-color": |background_hover|},
)
},
@@ -141,7 +141,7 @@ call-function: ("check-colors", {
"theme": "ayu",
"color": "#c5c5c5",
"color_hover": "#ffb44c",
- "background": "rgb(20, 25, 31)",
+ "background": "#14191f",
"background_hover": "#14191f",
"background_toggle": "rgba(0, 0, 0, 0)",
"background_toggle_hover": "rgba(70, 70, 70, 0.33)",
@@ -190,16 +190,16 @@ assert-window-property: {"pageYOffset": "2542"}
// make it the current selection.
set-window-size: (500, 700)
click: "#src-sidebar-toggle"
-wait-for-css: ("#source-sidebar", {"visibility": "visible"})
+wait-for-css: ("#src-sidebar", {"visibility": "visible"})
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
click: ".sidebar a.selected"
go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
-wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
+wait-for-css: ("#src-sidebar", {"visibility": "hidden"})
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
// Resize back to desktop size, to check that the sidebar doesn't spontaneously open.
set-window-size: (1000, 1000)
-wait-for-css: ("#source-sidebar", {"visibility": "hidden"})
+wait-for-css: ("#src-sidebar", {"visibility": "hidden"})
assert-local-storage: {"rustdoc-source-sidebar-show": "false"}
click: "#src-sidebar-toggle"
-wait-for-css: ("#source-sidebar", {"visibility": "visible"})
+wait-for-css: ("#src-sidebar", {"visibility": "visible"})
assert-local-storage: {"rustdoc-source-sidebar-show": "true"}
diff --git a/tests/rustdoc-gui/sidebar-source-code.goml b/tests/rustdoc-gui/sidebar-source-code.goml
index 2cb888178..69c589741 100644
--- a/tests/rustdoc-gui/sidebar-source-code.goml
+++ b/tests/rustdoc-gui/sidebar-source-code.goml
@@ -14,7 +14,7 @@ define-function: (
}
reload:
// Checking results colors.
- assert-css: (".source .sidebar", {
+ assert-css: (".src .sidebar", {
"color": |color|,
"background-color": |background_color|
}, ALL)
@@ -53,8 +53,8 @@ assert-css: ("nav.sidebar", {"width": "50px"})
// We now click on the button to expand the sidebar.
click: (10, 10)
// We wait for the sidebar to be expanded.
-wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"})
-assert-css: (".source-sidebar-expanded nav.sidebar a", {"font-size": "14px"})
+wait-for-css: (".src-sidebar-expanded nav.sidebar", {"width": "300px"})
+assert-css: (".src-sidebar-expanded nav.sidebar a", {"font-size": "14px"})
// We collapse the sidebar.
click: (10, 10)
// We ensure that the class has been removed.
@@ -66,24 +66,24 @@ go-to: "file://" + |DOC_PATH| + "/src/lib2/another_folder/sub_mod/mod.rs.html"
// First we expand the sidebar again.
click: (10, 10)
// We wait for the sidebar to be expanded.
-wait-for-css: (".source-sidebar-expanded nav.sidebar", {"width": "300px"})
+wait-for-css: (".src-sidebar-expanded nav.sidebar", {"width": "300px"})
assert: "//*[@class='dir-entry' and @open]/*[text()='lib2']"
assert: "//*[@class='dir-entry' and @open]/*[text()='another_folder']"
assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
// Only "another_folder" should be "open" in "lib2".
assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
// All other trees should be collapsed.
-assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 9)
+assert-count: ("//*[@id='src-sidebar']/details[not(text()='lib2') and not(@open)]", 9)
// We now switch to mobile mode.
set-window-size: (600, 600)
-wait-for-css: (".source-sidebar-expanded nav.sidebar", {"left": "0px"})
+wait-for-css: (".src-sidebar-expanded nav.sidebar", {"left": "0px"})
// We collapse the sidebar.
click: (10, 10)
// We check that the sidebar has been moved off-screen.
assert-css: ("nav.sidebar", {"left": "-1000px"})
// We ensure that the class has been removed.
-assert-false: ".source-sidebar-expanded"
+assert-false: ".src-sidebar-expanded"
assert: "nav.sidebar"
// Check that the topbar is not visible
diff --git a/tests/rustdoc-gui/source-anchor-scroll.goml b/tests/rustdoc-gui/source-anchor-scroll.goml
index 67f1497e7..0e4913caf 100644
--- a/tests/rustdoc-gui/source-anchor-scroll.goml
+++ b/tests/rustdoc-gui/source-anchor-scroll.goml
@@ -7,11 +7,11 @@ set-window-size: (600, 800)
// We check that the scroll is at the top first.
assert-property: ("html", {"scrollTop": "0"})
-click: '//a[text() = "barbar"]'
+click: '//a[text() = "barbar" and @href="#5-7"]'
assert-property: ("html", {"scrollTop": "149"})
-click: '//a[text() = "bar"]'
+click: '//a[text() = "bar" and @href="#28-36"]'
assert-property: ("html", {"scrollTop": "180"})
-click: '//a[text() = "sub_fn"]'
+click: '//a[text() = "sub_fn" and @href="#2-4"]'
assert-property: ("html", {"scrollTop": "77"})
// We now check that clicking on lines doesn't change the scroll
diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml
index f8f73398d..f19e3ce80 100644
--- a/tests/rustdoc-gui/source-code-page.goml
+++ b/tests/rustdoc-gui/source-code-page.goml
@@ -98,26 +98,26 @@ assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH)
// First we "open" it.
click: "#src-sidebar-toggle"
-assert: ".source-sidebar-expanded"
+assert: ".src-sidebar-expanded"
// We check that the first entry of the sidebar is collapsed
-assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
-assert-text: ("#source-sidebar details:first-of-type > summary", "extend_css")
+assert-property: ("#src-sidebar details:first-of-type", {"open": "false"})
+assert-text: ("#src-sidebar details:first-of-type > summary", "extend_css")
// We now click on it.
-click: "#source-sidebar details:first-of-type > summary"
-assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})
+click: "#src-sidebar details:first-of-type > summary"
+assert-property: ("#src-sidebar details:first-of-type", {"open": "true"})
// And now we collapse it again.
-click: "#source-sidebar details:first-of-type > summary"
-assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
+click: "#src-sidebar details:first-of-type > summary"
+assert-property: ("#src-sidebar details:first-of-type", {"open": "false"})
// And open it again, since it'll be the reference we use to check positions.
-click: "#source-sidebar details:first-of-type > summary"
-assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})
+click: "#src-sidebar details:first-of-type > summary"
+assert-property: ("#src-sidebar details:first-of-type", {"open": "true"})
// Check the sidebar directory entries have a marker and spacing (desktop).
store-property: (
- "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a",
+ "#src-sidebar > details:first-of-type.dir-entry[open] > .files > a",
{"offsetHeight": link_height},
)
define-function: (
@@ -125,28 +125,28 @@ define-function: (
(x, y),
block {
assert: "details:first-of-type.dir-entry[open] > summary::marker"
- assert-css: ("#source-sidebar > details:first-of-type.dir-entry", {"padding-left": "4px"})
+ assert-css: ("#src-sidebar > details:first-of-type.dir-entry", {"padding-left": "4px"})
// This check ensures that the summary is only one line.
assert-property: (
- "#source-sidebar > details:first-of-type.dir-entry[open] > summary",
+ "#src-sidebar > details:first-of-type.dir-entry[open] > summary",
{"offsetHeight": |link_height|}
)
assert-position: (
- "#source-sidebar > details:first-of-type.dir-entry[open] > summary",
+ "#src-sidebar > details:first-of-type.dir-entry[open] > summary",
{"x": |x|, "y": |y|}
)
assert-property: (
- "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a",
+ "#src-sidebar > details:first-of-type.dir-entry[open] > .files > a",
{"offsetHeight": |link_height|}
)
assert-position: (
- "#source-sidebar > details:first-of-type.dir-entry[open] > .files > a",
+ "#src-sidebar > details:first-of-type.dir-entry[open] > .files > a",
// left margin
{"x": |x| + 27, "y": |y| + |link_height|}
)
}
)
-store-property: ("#source-sidebar > .title", {
+store-property: ("#src-sidebar > .title", {
"offsetHeight": source_sidebar_title_height,
"offsetTop": source_sidebar_title_y,
})
@@ -175,7 +175,7 @@ assert-property: ("#main-content", {"offsetTop": 76})
// 21 = 76 - 34 - 21
// Check the sidebar directory entries have a marker and spacing (tablet).
-store-property: ("#source-sidebar > .title", {
+store-property: ("#src-sidebar > .title", {
"offsetHeight": source_sidebar_title_height,
"offsetTop": source_sidebar_title_y,
})
@@ -189,7 +189,7 @@ set-window-size: (450, 700)
assert-css: ("nav.sub", {"flex-direction": "column"})
// Check the sidebar directory entries have a marker and spacing (phone).
-store-property: ("#source-sidebar > .title", {
+store-property: ("#src-sidebar > .title", {
"offsetHeight": source_sidebar_title_height,
"offsetTop": source_sidebar_title_y,
})
diff --git a/tests/rustdoc-gui/src-font-size.goml b/tests/rustdoc-gui/src-font-size.goml
index ff30bcdf2..f23387d73 100644
--- a/tests/rustdoc-gui/src-font-size.goml
+++ b/tests/rustdoc-gui/src-font-size.goml
@@ -4,13 +4,13 @@
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.Foo.html"
show-text: true
// Check the impl headers.
-assert-css: (".impl .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
+assert-css: (".impl a.src", {"font-size": "16px", "font-weight": 400}, ALL)
assert-css: (".impl .code-header", {"font-size": "18px", "font-weight": 600}, ALL)
// Check the impl items.
-assert-css: (".impl-items .srclink", {"font-size": "16px", "font-weight": 400}, ALL)
+assert-css: (".impl-items a.src", {"font-size": "16px", "font-weight": 400}, ALL)
assert-css: (".impl-items .code-header", {"font-size": "16px", "font-weight": 600}, ALL)
// Check that we can click on source link
store-document-property: {"URL": url}
-click: ".impl-items .srclink"
+click: ".impl-items a.src"
assert-document-property-false: {"URL": |url|}
diff --git a/tests/rustdoc-gui/src/staged_api/lib.rs b/tests/rustdoc-gui/src/staged_api/lib.rs
index 5934593a8..0c914470e 100644
--- a/tests/rustdoc-gui/src/staged_api/lib.rs
+++ b/tests/rustdoc-gui/src/staged_api/lib.rs
@@ -1,4 +1,5 @@
#![feature(staged_api)]
+#![allow(internal_features)]
#![stable(feature = "some_feature", since = "1.3.5")]
#[stable(feature = "some_feature", since = "1.3.5")]
diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs
index ecf3a7cc1..49484ee08 100644
--- a/tests/rustdoc-gui/src/test_docs/lib.rs
+++ b/tests/rustdoc-gui/src/test_docs/lib.rs
@@ -3,6 +3,7 @@
#![doc(html_playground_url="https://play.rust-lang.org/")]
#![crate_name = "test_docs"]
+#![allow(internal_features)]
#![feature(rustdoc_internals)]
#![feature(doc_cfg)]
#![feature(associated_type_defaults)]
diff --git a/tests/rustdoc-gui/unsafe-fn.goml b/tests/rustdoc-gui/unsafe-fn.goml
index 51007b653..8d26f15f3 100644
--- a/tests/rustdoc-gui/unsafe-fn.goml
+++ b/tests/rustdoc-gui/unsafe-fn.goml
@@ -23,6 +23,6 @@ define-function: (
},
)
-call-function: ("sup-check", ("dark", "rgb(221, 221, 221)"))
-call-function: ("sup-check", ("ayu", "rgb(197, 197, 197)"))
-call-function: ("sup-check", ("light", "rgb(0, 0, 0)"))
+call-function: ("sup-check", ("ayu", "#c5c5c5"))
+call-function: ("sup-check", ("dark", "#ddd"))
+call-function: ("sup-check", ("light", "black"))