about summary refs log tree commit diff
path: root/tests/rustdoc-gui/docblock-code-block-line-number.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/docblock-code-block-line-number.goml
parent5958f5e08fa88ee95ede8c00f1b89befe0372d54 (diff)
downloadrust-7659ef47f03f4e2bbbef65856427add98f898ef5.tar.gz
rust-7659ef47f03f4e2bbbef65856427add98f898ef5.zip
Use `include` command to reduce code duplication
Diffstat (limited to 'tests/rustdoc-gui/docblock-code-block-line-number.goml')
-rw-r--r--tests/rustdoc-gui/docblock-code-block-line-number.goml13
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/rustdoc-gui/docblock-code-block-line-number.goml b/tests/rustdoc-gui/docblock-code-block-line-number.goml
index cb7bdaab4c8..fc80932caba 100644
--- a/tests/rustdoc-gui/docblock-code-block-line-number.goml
+++ b/tests/rustdoc-gui/docblock-code-block-line-number.goml
@@ -1,4 +1,5 @@
 // Checks that the setting "line numbers" is working as expected.
+include: "utils.goml"
 go-to: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
 
 // Otherwise, we can't check text color
@@ -13,14 +14,10 @@ define-function: (
     [theme, color],
     block {
         // We now set the setting to show the line numbers on code examples.
-        set-local-storage: {
-            "rustdoc-theme": |theme|,
-            "rustdoc-use-system-theme": "false",
-            "rustdoc-line-numbers": "true"
-        }
-        // We reload to make the line numbers appear and change theme.
-        reload:
-        // We wait for them to be added into the DOM by the JS...
+        set-local-storage: {"rustdoc-line-numbers": "true"}
+        // Page will be reloaded in "switch-theme".
+        call-function: ("switch-theme", {"theme": |theme|})
+        // We wait for the line numbers to be added into the DOM by the JS...
         wait-for: "pre.example-line-numbers"
         // If the test didn't fail, it means that it was found!
         assert-css: (