Skip to content

Commit 2189480

Browse files
committed
rustdoc: add test case for huge logo
1 parent cb184bb commit 2189480

File tree

7 files changed

+57
-2
lines changed

7 files changed

+57
-2
lines changed

src/test/rustdoc-gui/huge-logo.goml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// huge_logo crate has a custom 712x860 logo
2+
// test to ensure the maximum size in the layout works correctly
3+
goto: "file://" + |DOC_PATH| + "/huge_logo/index.html"
4+
5+
size: (1280, 1024)
6+
// offsetWidth = width of sidebar
7+
assert-property: (".sidebar .logo-container", {"offsetWidth": "200", "offsetHeight": 100})
8+
assert-property: (".sidebar .logo-container img", {"offsetWidth": "100", "offsetHeight": 100})
9+
10+
size: (400, 600)
11+
// offset = size + margin
12+
assert-property: (".mobile-topbar .logo-container", {"offsetWidth": "55", "offsetHeight": 45})
13+
assert-property: (".mobile-topbar .logo-container img", {"offsetWidth": "35", "offsetHeight": 35})
14+
15+
goto: "file://" + |DOC_PATH| + "/src/huge_logo/lib.rs.html"
16+
17+
size: (1280, 1024)
18+
assert-property: (".sub-logo-container", {"offsetWidth": "60", "offsetHeight": 60})
19+
20+
size: (400, 600)
21+
assert-property: (".sub-logo-container", {"offsetWidth": "35", "offsetHeight": 35})

src/test/rustdoc-gui/search-filter.goml

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ click: "#crate-search"
1414
// We select "lib2" option then press enter to change the filter.
1515
press-key: "ArrowDown"
1616
press-key: "ArrowDown"
17+
press-key: "ArrowDown"
1718
press-key: "Enter"
1819
// Waiting for the search results to appear...
1920
wait-for: "#titles"
@@ -37,6 +38,7 @@ assert-property: ("#crate-search", {"value": "lib2"})
3738
click: "#crate-search"
3839
press-key: "ArrowUp"
3940
press-key: "ArrowUp"
41+
press-key: "ArrowUp"
4042
press-key: "Enter"
4143
// Waiting for the search results to appear...
4244
wait-for: "#titles"

src/test/rustdoc-gui/sidebar-source-code.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ assert: "//*[@class='dir-entry' and @open]/*[text()='sub_mod']"
2828
// Only "another_folder" should be "open" in "lib2".
2929
assert: "//*[@class='dir-entry' and not(@open)]/*[text()='another_mod']"
3030
// All other trees should be collapsed.
31-
assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 5)
31+
assert-count: ("//*[@id='source-sidebar']/details[not(text()='lib2') and not(@open)]", 6)
3232

3333
// We now switch to mobile mode.
3434
size: (600, 600)

src/test/rustdoc-gui/source-code-page.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ assert: ".source-sidebar-expanded"
7878

7979
// We check that the first entry of the sidebar is collapsed
8080
assert-property: ("#source-sidebar details:first-of-type", {"open": "false"})
81-
assert-text: ("#source-sidebar details:first-of-type > summary", "implementors")
81+
assert-text: ("#source-sidebar details:first-of-type > summary", "huge_logo")
8282
// We now click on it.
8383
click: "#source-sidebar details:first-of-type > summary"
8484
assert-property: ("#source-sidebar details:first-of-type", {"open": "true"})
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is automatically @generated by Cargo.
2+
# It is not intended for manual editing.
3+
version = 3
4+
5+
[[package]]
6+
name = "huge_logo"
7+
version = "0.1.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[package]
2+
name = "huge_logo"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]

src/test/rustdoc-gui/src/huge_logo/src/lib.rs

+17
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)