Skip to content

wpt: Turn on selectFiles and handle asynchronicity in FileAPI test#40349

Merged
mrobinson merged 1 commit intoservo:mainfrom
mrobinson:fix-the-file-api-tests
Nov 2, 2025
Merged

wpt: Turn on selectFiles and handle asynchronicity in FileAPI test#40349
mrobinson merged 1 commit intoservo:mainfrom
mrobinson:fix-the-file-api-tests

Conversation

@mrobinson
Copy link
Copy Markdown
Member

@mrobinson mrobinson commented Nov 2, 2025

This change fixes the Servo-specific FileAPI tests which need the
special SelectFiles API. In addition, file selection is now totally
asynchronous, so update the tests to handle this.

Testing: This change fixes some tests.
Fixes: #40348.

@mrobinson mrobinson requested a review from gterzian as a code owner November 2, 2025 10:15
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 2, 2025
Comment on lines +20 to +23
reader.onloadend = this.step_func(function(evt) {
assert_equals(evt.target.result, "hello, servo\n");
this.done();
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can be a single invocation as well:

Suggested change
reader.onloadend = this.step_func(function(evt) {
assert_equals(evt.target.result, "hello, servo\n");
this.done();
});
reader.onloadend = this.step_func_done(function(evt) {
assert_equals(evt.target.result, "hello, servo\n");
});

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. I've done this.

takeScreenshot();
});
image.src = URL.createObjectURL(inputElement.files[0]);
console.log(url);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this left-over or required for the test?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, this is left over from my work on the tests. Thanks for pointing it out.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 2, 2025
@mrobinson mrobinson force-pushed the fix-the-file-api-tests branch from c66d43c to 7e104b4 Compare November 2, 2025 10:50
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 2, 2025
@mrobinson mrobinson enabled auto-merge November 2, 2025 10:51
This change fixes the Servo-specific FileAPI tests which need the
special `SelectFiles` API. In addition, file selection is now totally
asynchronous, so update the tests to handle this.

Once we switch to WebDriver to run tests, these tests can use test
driver APIs and we can remove `selectFiles` entirely.

Signed-off-by: Martin Robinson <[email protected]>
@mrobinson mrobinson force-pushed the fix-the-file-api-tests branch from 7e104b4 to 1b1249c Compare November 2, 2025 11:02
@mrobinson mrobinson added this pull request to the merge queue Nov 2, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 2, 2025
Merged via the queue into servo:main with commit f5865c7 Nov 2, 2025
32 checks passed
@mrobinson mrobinson deleted the fix-the-file-api-tests branch November 2, 2025 11:44
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent OK [expected FAIL] in /_mozilla/mozilla/FileAPI/file-upload.html (WebDriver)

3 participants