about summary refs log tree commit diff
path: root/tests/rustdoc-gui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-15 19:32:17 +0000
committerbors <bors@rust-lang.org>2023-12-15 19:32:17 +0000
commita96d57bdb6d2bb6d233d7d5aaefc2995ab99be01 (patch)
treef04bb808893aafc5db3c72834fc747c791aebfdb /tests/rustdoc-gui
parent3f39cae1199a2a0217c3646a16d1ae7fa599130b (diff)
parent5fc9ff5619f83689a27126efc0d7f51b9f5d7b2b (diff)
downloadrust-a96d57bdb6d2bb6d233d7d5aaefc2995ab99be01.tar.gz
rust-a96d57bdb6d2bb6d233d7d5aaefc2995ab99be01.zip
Auto merge of #118996 - matthiaskrgr:rollup-n6x2lc7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #117824 (Stabilize `ptr::{from_ref, from_mut}`)
 - #118234 (Stabilize `type_name_of_val`)
 - #118944 (Move type relations into submodule `relate` in rustc_infer, and notify when it has changed)
 - #118977 (Simplify `src-script.js` code)
 - #118985 (Remove `@JohnTitor` from diagnostics pings)
 - #118986 (Simplify JS code a little bit)
 - #118988 (rustdoc: add regression test for JS data file loading)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests/rustdoc-gui')
-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 00000000000..53f96ff086e
--- /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}