From c47337e1150d1a214c04f9e5b532c80e8d7a89d0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 13 Oct 2022 16:50:11 +0200 Subject: [PATCH 1/2] Update browser-ui-test version to 0.12.3 --- .../docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version index e96a87111cb..d61567cd134 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version @@ -1 +1 @@ -0.12.2 \ No newline at end of file +0.12.3 \ No newline at end of file From 16cfd6cc8446215ec31dfd2e79a61e68fc8f276c Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 13 Oct 2022 16:51:04 +0200 Subject: [PATCH 2/2] Improve code for unsafe-fn rustdoc GUI test --- src/test/rustdoc-gui/unsafe-fn.goml | 53 ++++++++++++----------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/src/test/rustdoc-gui/unsafe-fn.goml b/src/test/rustdoc-gui/unsafe-fn.goml index 94f128db72e..5e43b85fce0 100644 --- a/src/test/rustdoc-gui/unsafe-fn.goml +++ b/src/test/rustdoc-gui/unsafe-fn.goml @@ -1,37 +1,28 @@ +// Check position and color of the `` for unsafe elements. goto: "file://" + |DOC_PATH| + "/test_docs/index.html" - -compare-elements-property: ( - "//a[@title='test_docs::safe_fn fn']/..", - "//a[@title='test_docs::unsafe_fn fn']/..", - ["clientHeight"] -) - // If the text isn't displayed, the browser doesn't compute color style correctly... show-text: true -// Set the theme to dark. -local-storage: {"rustdoc-theme": "dark", "rustdoc-preferred-dark-theme": "dark", "rustdoc-use-system-theme": "false"} -// We reload the page so the local storage settings are being used. -reload: +compare-elements-property: ( + "//a[@title='test_docs::safe_fn fn']/..", + "//a[@title='test_docs::unsafe_fn fn']/..", + ["clientHeight"] +) -assert-css: (".item-left sup", { - "color": "rgb(221, 221, 221)" -}) +define-function: ( + "sup-check", + // `theme` is the theme being tested. + // `color` is the expected color of the `` element. + (theme, color), + [ + // Set the theme. + ("local-storage", {"rustdoc-theme": |theme|, "rustdoc-use-system-theme": "false"}), + // We reload the page so the local storage settings are being used. + ("reload"), + ("assert-css", (".item-left sup", {"color": |color|})), + ], +) -// Set the theme to ayu. -local-storage: {"rustdoc-theme": "ayu", "rustdoc-preferred-dark-theme": "ayu", "rustdoc-use-system-theme": "false"} -// We reload the page so the local storage settings are being used. -reload: - -assert-css: (".item-left sup", { - "color": "rgb(197, 197, 197)" -}) - -// Set the theme to light. -local-storage: {"rustdoc-theme": "light", "rustdoc-preferred-dark-theme": "light", "rustdoc-use-system-theme": "false"} -// We reload the page so the local storage settings are being used. -reload: - -assert-css: (".item-left sup", { - "color": "rgb(0, 0, 0)" -}) +call-function: ("sup-check", ("dark", "rgb(221, 221, 221)")) +call-function: ("sup-check", ("ayu", "rgb(197, 197, 197)")) +call-function: ("sup-check", ("light", "rgb(0, 0, 0)"))