diff --git a/src/test/rustdoc-gui/default-settings.goml b/src/test/rustdoc-gui/default-settings.goml new file mode 100644 index 00000000000..68b674a11f2 --- /dev/null +++ b/src/test/rustdoc-gui/default-settings.goml @@ -0,0 +1,8 @@ +// This test ensures that the default settings are correctly applied. +// +// The "settings" crate uses "ayu" as default setting, which is what we will +// check. +goto: file://|DOC_PATH|/settings/index.html +// Wait a bit to be sure the default theme is applied. +wait-for: 1000 +assert-css: ("body", {"background-color": "rgb(15, 20, 25)"}) diff --git a/src/test/rustdoc-gui/src/implementors/Cargo.lock b/src/test/rustdoc-gui/src/implementors/Cargo.lock new file mode 100644 index 00000000000..cad99a991a2 --- /dev/null +++ b/src/test/rustdoc-gui/src/implementors/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "implementors" +version = "0.1.0" diff --git a/src/test/rustdoc-gui/src/lib2/Cargo.lock b/src/test/rustdoc-gui/src/lib2/Cargo.lock new file mode 100644 index 00000000000..a5873ceb325 --- /dev/null +++ b/src/test/rustdoc-gui/src/lib2/Cargo.lock @@ -0,0 +1,14 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "implementors" +version = "0.1.0" + +[[package]] +name = "lib2" +version = "0.1.0" +dependencies = [ + "implementors", +] diff --git a/src/test/rustdoc-gui/src/settings/.cargo/config.toml b/src/test/rustdoc-gui/src/settings/.cargo/config.toml new file mode 100644 index 00000000000..bbb8d11a2ed --- /dev/null +++ b/src/test/rustdoc-gui/src/settings/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +rustdocflags = ["--default-theme", "ayu"] diff --git a/src/test/rustdoc-gui/src/settings/Cargo.lock b/src/test/rustdoc-gui/src/settings/Cargo.lock new file mode 100644 index 00000000000..6f0de1ac1e8 --- /dev/null +++ b/src/test/rustdoc-gui/src/settings/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "settings" +version = "0.1.0" diff --git a/src/test/rustdoc-gui/src/settings/Cargo.toml b/src/test/rustdoc-gui/src/settings/Cargo.toml new file mode 100644 index 00000000000..c8a211a47ca --- /dev/null +++ b/src/test/rustdoc-gui/src/settings/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "settings" +version = "0.1.0" +edition = "2018" + +[lib] +path = "lib.rs" diff --git a/src/test/rustdoc-gui/src/settings/lib.rs b/src/test/rustdoc-gui/src/settings/lib.rs new file mode 100644 index 00000000000..b76b4321d62 --- /dev/null +++ b/src/test/rustdoc-gui/src/settings/lib.rs @@ -0,0 +1 @@ +pub fn foo() {} diff --git a/src/test/rustdoc-gui/src/test_docs/Cargo.lock b/src/test/rustdoc-gui/src/test_docs/Cargo.lock new file mode 100644 index 00000000000..6b80f6e88ef --- /dev/null +++ b/src/test/rustdoc-gui/src/test_docs/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "test_docs" +version = "0.1.0" diff --git a/src/test/rustdoc/default-theme.rs b/src/test/rustdoc/default-theme.rs new file mode 100644 index 00000000000..ecb8f0b3b48 --- /dev/null +++ b/src/test/rustdoc/default-theme.rs @@ -0,0 +1,7 @@ +// compile-flags: --default-theme ayu + +// @has default_theme/index.html +// @has - '//script[@id="default-settings"]/@data-theme' 'ayu' +// @has - '//script[@id="default-settings"]/@data-use_system_theme' 'false' + +pub fn whatever() {}