diff options
| author | bors <bors@rust-lang.org> | 2021-11-24 23:09:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-24 23:09:42 +0000 |
| commit | d2c24aabcddd1eb11af633ab6b7391ae0cd00ea2 (patch) | |
| tree | d195ee55e89dd213150f665feeb6943ee5397c90 /src/test/rustdoc-gui | |
| parent | b426445c60b4faab6e96d2b866164d478680abf6 (diff) | |
| parent | ae9681ecfad21f218ac3524dc798aafa35088202 (diff) | |
| download | rust-d2c24aabcddd1eb11af633ab6b7391ae0cd00ea2.tar.gz rust-d2c24aabcddd1eb11af633ab6b7391ae0cd00ea2.zip | |
Auto merge of #91203 - GuillaumeGomez:rollup-kwtqvb1, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #89542 (Partially stabilize `duration_consts_2`) - #90044 (Restrict aarch64 outline atomics to glibc for now.) - #90420 (Create rustdoc_internals feature gate) - #91075 (Reduce prominence of item-infos) - #91151 (Fix test in std::process on android) - #91179 (Fix more <a> color) - #91199 (rustdoc: Add test for mixing doc comments and attrs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/rustdoc-gui')
| -rw-r--r-- | src/test/rustdoc-gui/anchors.goml | 28 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/headers-color.goml | 9 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/item-info-width.goml | 2 | ||||
| -rw-r--r-- | src/test/rustdoc-gui/src/test_docs/lib.rs | 2 |
4 files changed, 31 insertions, 10 deletions
diff --git a/src/test/rustdoc-gui/anchors.goml b/src/test/rustdoc-gui/anchors.goml index 6953009604c..4ce0ed1a4b8 100644 --- a/src/test/rustdoc-gui/anchors.goml +++ b/src/test/rustdoc-gui/anchors.goml @@ -1,17 +1,29 @@ +// This test is to ensure that the anchors (`ยง`) have the expected color. goto: file://|DOC_PATH|/test_docs/struct.HeavilyDocumentedStruct.html +// This is needed to ensure that the text color is computed. +show-text: true + // Set the theme to light. local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} // We reload the page so the local storage settings are being used. reload: -assert-css: ("#toggle-all-docs", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".srclink", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".srclink", {"color": "rgba(0, 0, 0, 0)"}) +assert-css: ("#toggle-all-docs", {"color": "rgb(0, 0, 0)"}) +assert-css: (".fqn .in-band a:nth-of-type(1)", {"color": "rgb(0, 0, 0)"}) +assert-css: (".fqn .in-band a:nth-of-type(2)", {"color": "rgb(173, 68, 142)"}) +assert-css: (".srclink", {"color": "rgb(0, 0, 0)"}) +assert-css: (".srclink", {"color": "rgb(0, 0, 0)"}) + +assert-css: ("#top-doc-prose-title", {"color": "rgb(0, 0, 0)"}) + +assert-css: (".sidebar a", {"color": "rgb(0, 0, 0)"}) +assert-css: (".in-band a", {"color": "rgb(0, 0, 0)"}) -assert-css: ("#top-doc-prose-title", {"color": "rgba(0, 0, 0, 0)"}) +// We move the cursor over the "Implementations" title so the anchor is displayed. +move-cursor-to: "h2#implementations" +assert-css: ("h2#implementations a.anchor", {"color": "rgb(0, 0, 0)"}) -assert-css: (".sidebar a", {"color": "rgba(0, 0, 0, 0)"}) -assert-css: (".in-band a", {"color": "rgba(0, 0, 0, 0)"}) +// Same thing with the impl block title. +move-cursor-to: "#impl" +assert-css: ("#impl a.anchor", {"color": "rgb(0, 0, 0)"}) diff --git a/src/test/rustdoc-gui/headers-color.goml b/src/test/rustdoc-gui/headers-color.goml index b5be31bd2cc..7002812bb62 100644 --- a/src/test/rustdoc-gui/headers-color.goml +++ b/src/test/rustdoc-gui/headers-color.goml @@ -17,6 +17,9 @@ assert-css: ("#impl", {"color": "rgb(197, 197, 197)", "background-color": "rgba( goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use assert-css: ("#method\.must_use", {"color": "rgb(197, 197, 197)", "background-color": "rgba(255, 236, 164, 0.06)"}, ALL) +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".section-header a", {"color": "rgb(197, 197, 197)"}, ALL) + // Dark theme local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} goto: file://|DOC_PATH|/test_docs/struct.Foo.html @@ -30,6 +33,9 @@ assert-css: ("#impl", {"color": "rgb(221, 221, 221)", "background-color": "rgb(7 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use assert-css: ("#method\.must_use", {"color": "rgb(221, 221, 221)", "background-color": "rgb(73, 74, 61)"}, ALL) +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".section-header a", {"color": "rgb(221, 221, 221)"}, ALL) + // Light theme local-storage: {"rustdoc-theme": "light", "rustdoc-use-system-theme": "false"} reload: @@ -44,3 +50,6 @@ assert-css: ("#impl", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 25 goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.must_use assert-css: ("#method\.must_use", {"color": "rgb(0, 0, 0)", "background-color": "rgb(253, 255, 211)"}, ALL) + +goto: file://|DOC_PATH|/test_docs/index.html +assert-css: (".section-header a", {"color": "rgb(0, 0, 0)"}, ALL) diff --git a/src/test/rustdoc-gui/item-info-width.goml b/src/test/rustdoc-gui/item-info-width.goml index 44b79e60912..cdc00d34114 100644 --- a/src/test/rustdoc-gui/item-info-width.goml +++ b/src/test/rustdoc-gui/item-info-width.goml @@ -4,4 +4,4 @@ goto: file://|DOC_PATH|/lib2/struct.Foo.html size: (1100, 800) // We check that ".item-info" is bigger than its content. assert-css: (".item-info", {"width": "807px"}) -assert-css: (".item-info .stab", {"width": "343px"}) +assert-css: (".item-info .stab", {"width": "341px"}) diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 14d8b186130..458bcc4780c 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -2,7 +2,7 @@ //! documentation generated so we can test each different features. #![crate_name = "test_docs"] -#![feature(doc_keyword)] +#![feature(rustdoc_internals)] #![feature(doc_cfg)] use std::convert::AsRef; |
