about summary refs log tree commit diff
path: root/tests/rustdoc-gui/code-color.goml
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-04-05 21:38:55 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-04-05 21:38:55 +0200
commit7659ef47f03f4e2bbbef65856427add98f898ef5 (patch)
treef2069567de13688a16cd07f8e61a75cf0f0da14f /tests/rustdoc-gui/code-color.goml
parent5958f5e08fa88ee95ede8c00f1b89befe0372d54 (diff)
downloadrust-7659ef47f03f4e2bbbef65856427add98f898ef5.tar.gz
rust-7659ef47f03f4e2bbbef65856427add98f898ef5.zip
Use `include` command to reduce code duplication
Diffstat (limited to 'tests/rustdoc-gui/code-color.goml')
-rw-r--r--tests/rustdoc-gui/code-color.goml6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/rustdoc-gui/code-color.goml b/tests/rustdoc-gui/code-color.goml
index e17af5e7f1f..661709aa1ce 100644
--- a/tests/rustdoc-gui/code-color.goml
+++ b/tests/rustdoc-gui/code-color.goml
@@ -2,6 +2,7 @@
 // check that the rule isn't applied on other "<code>" elements.
 //
 // While we're at it, we also check it for the other themes.
+include: "utils.goml"
 go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
 // If the text isn't displayed, the browser doesn't compute color style correctly...
 show-text: true
@@ -10,10 +11,7 @@ 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:
+        call-function: ("switch-theme", {"theme": |theme|})
         assert-css: (".docblock pre > code", {"color": |doc_code_color|}, ALL)
         assert-css: (".docblock > p > code", {"color": |doc_inline_code_color|}, ALL)
     },