Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions tests/functional/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,18 @@ export const webExt = process.env.TEST_WEB_EXT_BIN
export const fixturesDir = path.join(functionalTestsDir, '..', 'fixtures');
export const minimalAddonPath = path.join(fixturesDir, 'minimal-web-ext');
export const fixturesUseAsLibrary = path.join(fixturesDir, 'webext-as-library');
// NOTE: Depends on preload_on_windows.cjs to load this on Windows!
export const fakeFirefoxPath = path.join(
functionalTestsDir,
process.platform === 'win32'
? 'fake-firefox-binary.bat'
: 'fake-firefox-binary.js',
'fake-firefox-binary.js',
);
export const fakeServerPath = path.join(
functionalTestsDir,
'fake-amo-server.js',
);

export const chromeExtPath = path.join(fixturesDir, 'chrome-extension-mv3');
// NOTE: Depends on preload_on_windows.cjs to load this!
// NOTE: Depends on preload_on_windows.cjs to load this on Windows!
export const fakeChromePath = path.join(
functionalTestsDir,
'fake-chrome-binary.js',
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/fake-firefox-binary.bat

This file was deleted.

5 changes: 4 additions & 1 deletion tests/functional/preload_on_windows.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ const child_process = require('node:child_process');
const orig_spawn = child_process.spawn;
child_process.spawn = function(command, args, options, ...remainingArgs) {
if (typeof command === 'string') {
if (command.endsWith('fake-chrome-binary.js')) {
if (
command.endsWith('fake-chrome-binary.js') ||
command.endsWith('fake-firefox-binary.js')
) {
args = args ? [command, ...args] : [command];
command = process.execPath;
}
Expand Down