From 8511e40e7294e1efcc64b81d43969b6bf0f14c2d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 22 Nov 2024 12:58:20 -0700 Subject: rustdoc-search: search backend with partitioned suffix tree --- tests/rustdoc-gui/source-code-page.goml | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'tests/rustdoc-gui/source-code-page.goml') diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml index aa5a16aac70..5e3470dca20 100644 --- a/tests/rustdoc-gui/source-code-page.goml +++ b/tests/rustdoc-gui/source-code-page.goml @@ -89,9 +89,9 @@ assert-css: ("a[data-nosnippet]", {"text-align": "right"}, ALL) // do anything (and certainly not add a `#NaN` to the URL!). go-to: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" // We use this assert-position to know where we will click. -assert-position: ("//*[@id='1']", {"x": 81, "y": 169}) -// We click on the left of the "1" anchor but still in the `a[data-nosnippet]`. -click: (77, 163) +assert-position: ("//*[@id='1']", {"x": 81, "y": 141}) +// We click on the left of the "1" anchor but still in the "src-line-number" `
`.
+click: (135, 77)
 assert-document-property: ({"URL": "/lib.rs.html"}, ENDS_WITH)
 
 // Checking the source code sidebar.
@@ -156,27 +156,8 @@ call-function: ("check-sidebar-dir-entry", {
     "y": |source_sidebar_title_y| + |source_sidebar_title_height| + 7,
 })
 
-// Check the search form
-assert-css: ("nav.sub", {"flex-direction": "row"})
-// The goal of this test is to ensure the search input is perfectly centered
-// between the top of the page and the header.
-// To check this, we maintain the invariant:
-//
-// offsetTop[nav.sub form] = offsetTop[#main-content] - offsetHeight[nav.sub form] - offsetTop[nav.sub form]
-assert-position: ("nav.sub form", {"y": 15})
-assert-property: ("nav.sub form", {"offsetHeight": 34})
-assert-position: ("h1", {"y": 68})
-// 15 = 64 - 34 - 15
-
-// Now do the same check on moderately-sized, tablet mobile.
-set-window-size: (700, 700)
-assert-css: ("nav.sub", {"flex-direction": "row"})
-assert-position: ("nav.sub form", {"y": 8})
-assert-property: ("nav.sub form", {"offsetHeight": 34})
-assert-position: ("h1", {"y": 54})
-// 8 = 50 - 34 - 8
-
 // Check the sidebar directory entries have a marker and spacing (tablet).
+set-window-size: (700, 700)
 store-property: (".src-sidebar-title", {
     "offsetHeight": source_sidebar_title_height,
     "offsetTop": source_sidebar_title_y,
@@ -187,11 +168,8 @@ call-function: ("check-sidebar-dir-entry", {
     "y": |source_sidebar_title_y| + |source_sidebar_title_height| + 7,
 })
 
-// Tiny, phone mobile gets a different display where the logo is stacked on top.
-set-window-size: (450, 700)
-assert-css: ("nav.sub", {"flex-direction": "column"})
-
 // Check the sidebar directory entries have a marker and spacing (phone).
+set-window-size: (450, 700)
 store-property: (".src-sidebar-title", {
     "offsetHeight": source_sidebar_title_height,
     "offsetTop": source_sidebar_title_y,
-- 
cgit 1.4.1-3-g733a5