#54951: test: serve a checked-in file in the no-cors registerFileProtocol spec
Description of Change
The spec returns an opaque response for a registerFileProtocol scheme fetched cross-origin with mode: no-cors wrote a temporary file for its handler to serve. Right after the fetch, it removed the directory with fs.rmSync.
On Windows CI that removal failed with ENOTEMPTY on both tries that reached it:
- Another handle still had the file open with
FILE_SHARE_DELETE. - Electron builds Node's
fs.rmSyncagainst libc++, whose Windowsstd::filesystemdeletes without POSIX semantics. - So the file stayed in the directory, pending deletion, and the directory could not be removed.
The test only needs a file whose body the opaque response must hide. It now serves the existing spec/fixtures/hello.txt, so there is nothing to delete. The assertions are unchanged: type opaque, status 0, and an empty body.
On 42-x-y and 43-x-y this test is the only user of os in the file, so those backports also need the now-unused import * as os from 'node:os'; removed.
🤖 Generated with Claude Code
Checklist
- I have built and tested this change
- I have filled out the PR description
- I have reviewed and verified the changes
- tests are changed or added
Release Notes
Notes: none
Backports
Semver Impact
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron