Rollup merge of #104201 - GuillaumeGomez:gui-test-check-file-errors, r=notriddle

Add check in GUI test for file loading failure

Since https://github.com/rust-lang/rust/pull/101702, some resources location need to be updated in case their content changed because then their hash will change too. This will prevent errors like https://github.com/rust-lang/rust/pull/104114 to happen again.

The second commit is to prevent CORS errors: when a file is linked from a file itself imported, the web browser considers they come from a different domain and therefore triggers the error. The option tells the web browser to ignore this case.

cc ```@jsha```
r? ```@notriddle```
This commit is contained in:
Michael Goulet 2022-11-09 21:53:37 -08:00 committed by GitHub
commit 985fa02783
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 27 additions and 1 deletions

View File

@ -1,4 +1,8 @@
// This test ensures that items and documentation code blocks are wrapped in <pre><code> // This test ensures that items and documentation code blocks are wrapped in <pre><code>
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
// doesn't exist.
fail-on-request-error: false
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html" goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
size: (1080, 600) size: (1080, 600)
// There should be four doc codeblocks. // There should be four doc codeblocks.

View File

@ -1,4 +1,9 @@
// This test ensures that the color of the items in the type decl are working as expected. // This test ensures that the color of the items in the type decl are working as expected.
// We need to disable this check because `implementors/test_docs/trait.TraitWithoutGenerics.js`
// doesn't exist.
fail-on-request-error: false
define-function: ( define-function: (
"check-colors", "check-colors",
( (

View File

@ -1,4 +1,9 @@
// This test checks that there are margins applied to methods with no docblocks. // This test checks that there are margins applied to methods with no docblocks.
// We need to disable this check because `implementors/test_docs/trait.TraitWithNoDocblock.js`
// doesn't exist.
fail-on-request-error: false
goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html" goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html"
// Check that the two methods are more than 24px apart. // Check that the two methods are more than 24px apart.
compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24}) compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24})

View File

@ -1,4 +1,9 @@
// Checks that the elements in the sidebar are alphabetically sorted. // Checks that the elements in the sidebar are alphabetically sorted.
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
// doesn't exist.
fail-on-request-error: false
goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html" goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
assert-text: (".sidebar-elems section .block li:nth-of-type(1) > a", "another") assert-text: (".sidebar-elems section .block li:nth-of-type(1) > a", "another")
assert-text: (".sidebar-elems section .block li:nth-of-type(2) > a", "func1") assert-text: (".sidebar-elems section .block li:nth-of-type(2) > a", "func1")

View File

@ -1,4 +1,10 @@
// This test ensures that the items declaration content overflow is handled inside the <pre> directly. // This test ensures that the items declaration content overflow is handled inside the <pre> directly.
// We need to disable this check because
// `implementors/test_docs/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.js`
// doesn't exist.
fail-on-request-error: false
goto: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html" goto: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
// We set a fixed size so there is no chance of "random" resize. // We set a fixed size so there is no chance of "random" resize.
size: (1100, 800) size: (1100, 800)

View File

@ -149,6 +149,7 @@ async function main(argv) {
// This is more convenient that setting fields one by one. // This is more convenient that setting fields one by one.
let args = [ let args = [
"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error", "--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error",
"--allow-file-access-from-files",
]; ];
if (opts["debug"]) { if (opts["debug"]) {
debug = true; debug = true;