about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-04-06 15:52:00 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-04-06 15:52:00 +0200
commit53c5a69dfdd01145fc508053adadbed17d2b315c (patch)
tree65f537f208729de726204276404d8720f5b3b795
parent2b1c799636ca9253280d7082cb6aa770c7571428 (diff)
downloadrust-53c5a69dfdd01145fc508053adadbed17d2b315c.tar.gz
rust-53c5a69dfdd01145fc508053adadbed17d2b315c.zip
Move `check-container-color`'s code into `check-search-color` function
-rw-r--r--tests/rustdoc-gui/search-result-color.goml50
1 files changed, 19 insertions, 31 deletions
diff --git a/tests/rustdoc-gui/search-result-color.goml b/tests/rustdoc-gui/search-result-color.goml
index 5a31afc6e61..fd0b86af3ea 100644
--- a/tests/rustdoc-gui/search-result-color.goml
+++ b/tests/rustdoc-gui/search-result-color.goml
@@ -81,11 +81,25 @@ define-function: (
             "hover_color": |fn_color|,
         })
 
-        call-function: ("check-container-color", {
-            "path_color": |path_color|,
-            "hover_path_color": |hover_path_color|,
-            "hover_background": |hover_background|,
-        })
+        // Checking the `<a>` container.
+        move-cursor-to: ".search-input"
+        focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
+        assert-css: (
+            "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
+            {"color": |path_color|, "background-color": "transparent"},
+            ALL,
+        )
+
+        // Checking color and background on hover.
+        move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
+        assert-css: (
+            "//*[@class='result-name']//*[text()='test_docs::']",
+            {"color": |hover_path_color|},
+        )
+        assert-css: (
+            "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
+            {"color": |hover_path_color|, "background-color": |hover_background|},
+        )
     }
 )
 
@@ -126,32 +140,6 @@ define-function: (
     },
 )
 
-define-function: (
-    "check-container-color",
-    [path_color, hover_path_color, hover_background],
-    block {
-        // Checking the `<a>` container.
-        move-cursor-to: ".search-input"
-        focus: ".search-input" // To ensure the `<a>` container isn't focused or hovered.
-        assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
-            {"color": |path_color|, "background-color": "transparent"},
-            ALL,
-        )
-
-        // Checking color and background on hover.
-        move-cursor-to: "//*[@class='desc'][text()='Just a normal struct.']"
-        assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']",
-            {"color": |hover_path_color|},
-        )
-        assert-css: (
-            "//*[@class='result-name']//*[text()='test_docs::']/ancestor::a",
-            {"color": |hover_path_color|, "background-color": |hover_background|},
-        )
-    }
-)
-
 go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=coo"
 
 // This is needed so that the text color is computed.