about summary refs log tree commit diff
path: root/src/test/rustdoc-gui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-12-29 16:46:08 +0000
committerbors <bors@rust-lang.org>2022-12-29 16:46:08 +0000
commite37ff7e71a087fcd799d3e59bcd63e3732d351d3 (patch)
tree07ea573e09bd231f4de878cfbf137f7164b31bc7 /src/test/rustdoc-gui
parent29d76cc6f5064e393440019198328b4424302633 (diff)
parent031a2143f0ef78e9b080b20481507ec0268e7bab (diff)
downloadrust-e37ff7e71a087fcd799d3e59bcd63e3732d351d3.tar.gz
rust-e37ff7e71a087fcd799d3e59bcd63e3732d351d3.zip
Auto merge of #106256 - matthiaskrgr:rollup-g1ovcqq, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #106208 (Make trait/impl `where` clause mismatch on region error a bit more actionable)
 - #106216 (Powershell: Use `WaitForExit` instead of `-Wait`)
 - #106217 (rustdoc: remove unnecessary `.tooltip::after { text-align: center }`)
 - #106218 (Migrate css var scraped examples)
 - #106221 (Rename `Rptr` to `Ref` in AST and HIR)
 - #106223 (On unsized locals with explicit types suggest `&`)
 - #106225 (Remove CraftSpider from review rotation)
 - #106229 (update Miri)
 - #106242 (Detect diff markers in the parser)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-gui')
-rw-r--r--src/test/rustdoc-gui/codeblock-tooltip.goml3
-rw-r--r--src/test/rustdoc-gui/scrape-examples-color.goml34
2 files changed, 34 insertions, 3 deletions
diff --git a/src/test/rustdoc-gui/codeblock-tooltip.goml b/src/test/rustdoc-gui/codeblock-tooltip.goml
index aab27394eb1..d4443f821d2 100644
--- a/src/test/rustdoc-gui/codeblock-tooltip.goml
+++ b/src/test/rustdoc-gui/codeblock-tooltip.goml
@@ -34,7 +34,6 @@ define-function: (
             ".docblock .example-wrap.compile_fail .tooltip::after",
             {
                 "content": '"This example deliberately fails to compile"',
-                "text-align": "center",
                 "padding": "5px 3px 3px",
                 "background-color": |background|,
                 "color": |color|,
@@ -74,7 +73,6 @@ define-function: (
             ".docblock .example-wrap.should_panic .tooltip::after",
             {
                 "content": '"This example panics"',
-                "text-align": "center",
                 "padding": "5px 3px 3px",
                 "background-color": |background|,
                 "color": |color|,
@@ -114,7 +112,6 @@ define-function: (
             ".docblock .example-wrap.ignore .tooltip::after",
             {
                 "content": '"This example is not tested"',
-                "text-align": "center",
                 "padding": "5px 3px 3px",
                 "background-color": |background|,
                 "color": |color|,
diff --git a/src/test/rustdoc-gui/scrape-examples-color.goml b/src/test/rustdoc-gui/scrape-examples-color.goml
new file mode 100644
index 00000000000..5175891e7ba
--- /dev/null
+++ b/src/test/rustdoc-gui/scrape-examples-color.goml
@@ -0,0 +1,34 @@
+// Check that scrape example code blocks have the expected colors.
+goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"
+
+define-function: (
+    "check-colors",
+    (theme, highlight, highlight_focus),
+    [
+        ("local-storage", { "rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false", }),
+        ("reload"),
+        ("wait-for", ".more-examples-toggle"),
+        ("assert-css", (".scraped-example .example-wrap .rust span.highlight:not(.focus)", {
+            "background-color": |highlight|,
+        }, ALL)),
+        ("assert-css", (".scraped-example .example-wrap .rust span.highlight.focus", {
+            "background-color": |highlight_focus|,
+        }, ALL)),
+    ]
+)
+
+call-function: ("check-colors", {
+    "theme": "ayu",
+    "highlight": "rgb(91, 59, 1)",
+    "highlight_focus": "rgb(124, 75, 15)",
+})
+call-function: ("check-colors", {
+    "theme": "dark",
+    "highlight": "rgb(91, 59, 1)",
+    "highlight_focus": "rgb(124, 75, 15)",
+})
+call-function: ("check-colors", {
+    "theme": "light",
+    "highlight": "rgb(252, 255, 214)",
+    "highlight_focus": "rgb(246, 253, 176)",
+})