Skip to content

Commit db220d5

Browse files
authored
chore: Avoid EINVAL in fake-firefox-binary (mozilla#3451)
1 parent f138687 commit db220d5

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

tests/functional/common.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ export const webExt = process.env.TEST_WEB_EXT_BIN
2121
export const fixturesDir = path.join(functionalTestsDir, '..', 'fixtures');
2222
export const minimalAddonPath = path.join(fixturesDir, 'minimal-web-ext');
2323
export const fixturesUseAsLibrary = path.join(fixturesDir, 'webext-as-library');
24+
// NOTE: Depends on preload_on_windows.cjs to load this on Windows!
2425
export const fakeFirefoxPath = path.join(
2526
functionalTestsDir,
26-
process.platform === 'win32'
27-
? 'fake-firefox-binary.bat'
28-
: 'fake-firefox-binary.js',
27+
'fake-firefox-binary.js',
2928
);
3029
export const fakeServerPath = path.join(
3130
functionalTestsDir,
3231
'fake-amo-server.js',
3332
);
3433

3534
export const chromeExtPath = path.join(fixturesDir, 'chrome-extension-mv3');
36-
// NOTE: Depends on preload_on_windows.cjs to load this!
35+
// NOTE: Depends on preload_on_windows.cjs to load this on Windows!
3736
export const fakeChromePath = path.join(
3837
functionalTestsDir,
3938
'fake-chrome-binary.js',

tests/functional/fake-firefox-binary.bat

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/functional/preload_on_windows.cjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const child_process = require('node:child_process');
2020
const orig_spawn = child_process.spawn;
2121
child_process.spawn = function(command, args, options, ...remainingArgs) {
2222
if (typeof command === 'string') {
23-
if (command.endsWith('fake-chrome-binary.js')) {
23+
if (
24+
command.endsWith('fake-chrome-binary.js') ||
25+
command.endsWith('fake-firefox-binary.js')
26+
) {
2427
args = args ? [command, ...args] : [command];
2528
command = process.execPath;
2629
}

0 commit comments

Comments
 (0)