summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-gui/globals.goml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /tests/rustdoc-gui/globals.goml
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz
rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/rustdoc-gui/globals.goml')
-rw-r--r--tests/rustdoc-gui/globals.goml24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/rustdoc-gui/globals.goml b/tests/rustdoc-gui/globals.goml
new file mode 100644
index 000000000..53f96ff08
--- /dev/null
+++ b/tests/rustdoc-gui/globals.goml
@@ -0,0 +1,24 @@
+// Make sure search stores its data in `window`
+// It needs to use a global to avoid racing on search-index.js and search.js
+// https://github.com/rust-lang/rust/pull/118961
+
+// URL query
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=sa'%3Bda'%3Bds"
+wait-for: "#search-tabs"
+assert-window-property-false: {"searchIndex": null}
+assert-window-property: {"srcIndex": null}
+
+// Form input
+go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
+write: (".search-input", "Foo")
+press-key: 'Enter'
+wait-for: "#search-tabs"
+assert-window-property-false: {"searchIndex": null}
+assert-window-property: {"srcIndex": null}
+
+// source sidebar
+go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html"
+click: "#src-sidebar-toggle"
+wait-for: "#src-sidebar details"
+assert-window-property-false: {"srcIndex": null}
+assert-window-property: {"searchIndex": null}