From 2f9fac024c3cb019227780e74c86008e5960d77f Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 14 Jun 2023 10:24:37 +0200 Subject: [PATCH 1/4] Update browser-ui-test version to 0.16.7 --- .../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 413b31282f7c9..75aa0c2b2a275 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.16.6 \ No newline at end of file +0.16.7 \ No newline at end of file From fd4320ca07092fe1adc0e763ce00d99ba0856611 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 14 Jun 2023 10:28:50 +0200 Subject: [PATCH 2/4] Transform backslash into slashes in DOC_FOLDER variable for browser-ui-test --- src/tools/rustdoc-gui/tester.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/rustdoc-gui/tester.js b/src/tools/rustdoc-gui/tester.js index b26480f668b37..af1bc05ddb248 100644 --- a/src/tools/rustdoc-gui/tester.js +++ b/src/tools/rustdoc-gui/tester.js @@ -201,8 +201,8 @@ async function main(argv) { try { // This is more convenient that setting fields one by one. const args = [ - "--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error", - "--allow-file-access-from-files", + "--variable", "DOC_PATH", opts["doc_folder"].split("\\").join("/"), + "--enable-fail-on-js-error", "--allow-file-access-from-files", ]; if (opts["debug"]) { debug = true; From df9a46f60ff1fa803378dce41e6dd96ca2349024 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 14 Jun 2023 10:37:19 +0200 Subject: [PATCH 3/4] Replace unicode value with character in shortcuts.goml test --- tests/rustdoc-gui/shortcuts.goml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/rustdoc-gui/shortcuts.goml b/tests/rustdoc-gui/shortcuts.goml index 667df89ec9b00..2c61ee5428b86 100644 --- a/tests/rustdoc-gui/shortcuts.goml +++ b/tests/rustdoc-gui/shortcuts.goml @@ -13,7 +13,7 @@ press-key: "Escape" assert-css: ("#help-button .popover", {"display": "none"}) // Checking doc collapse and expand. // It should be displaying a "-": -assert-text: ("#toggle-all-docs", "[\u2212]") +assert-text: ("#toggle-all-docs", "[−]") press-key: "-" wait-for-text: ("#toggle-all-docs", "[+]") assert-attribute: ("#toggle-all-docs", {"class": "will-expand"}) @@ -23,9 +23,9 @@ assert-text: ("#toggle-all-docs", "[+]") assert-attribute: ("#toggle-all-docs", {"class": "will-expand"}) // Expanding now. press-key: "+" -wait-for-text: ("#toggle-all-docs", "[\u2212]") +wait-for-text: ("#toggle-all-docs", "[−]") assert-attribute: ("#toggle-all-docs", {"class": ""}) // Pressing it again shouldn't do anything. press-key: "+" -assert-text: ("#toggle-all-docs", "[\u2212]") +assert-text: ("#toggle-all-docs", "[−]") assert-attribute: ("#toggle-all-docs", {"class": ""}) From fced6383c2ff25be0d0c5eaa82aea8980cb540ca Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Wed, 14 Jun 2023 16:23:00 +0200 Subject: [PATCH 4/4] Fix `href` attribute value check on Windows (`DOC_PATH` lacks an extra `/`) --- tests/rustdoc-gui/source-code-page.goml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/rustdoc-gui/source-code-page.goml b/tests/rustdoc-gui/source-code-page.goml index d5dd511b1d31f..f8f73398d9b99 100644 --- a/tests/rustdoc-gui/source-code-page.goml +++ b/tests/rustdoc-gui/source-code-page.goml @@ -64,23 +64,23 @@ call-function: ("check-colors", { compare-elements-position: ("//*[@id='1']", ".rust > code > span", ("y")) // Check the `href` property so that users can treat anchors as links. assert-property: (".src-line-numbers > a:nth-child(1)", { - "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#1" -}) + "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#1" +}, ENDS_WITH) assert-property: (".src-line-numbers > a:nth-child(2)", { - "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#2" -}) + "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#2" +}, ENDS_WITH) assert-property: (".src-line-numbers > a:nth-child(3)", { - "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#3" -}) + "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#3" +}, ENDS_WITH) assert-property: (".src-line-numbers > a:nth-child(4)", { - "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#4" -}) + "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#4" +}, ENDS_WITH) assert-property: (".src-line-numbers > a:nth-child(5)", { - "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#5" -}) + "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#5" +}, ENDS_WITH) assert-property: (".src-line-numbers > a:nth-child(6)", { - "href": "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html#6" -}) + "href": |DOC_PATH| + "/src/test_docs/lib.rs.html#6" +}, ENDS_WITH) // Assert that the line numbers text is aligned to the right. assert-css: (".src-line-numbers", {"text-align": "right"})