No side-effects for --benchmark, --benchmark-test

These options were still causing minor tweaks to startup behavior.
Eliminate the behavior differences for these flags during startup.
This commit is contained in:
DeeDeeG 2022-10-31 22:21:28 -04:00 committed by confused-Techie
parent 7b317b2728
commit de351f1a94
3 changed files with 5 additions and 7 deletions

View File

@ -167,8 +167,6 @@ module.exports = class AtomApplication extends EventEmitter {
if (
!socketPath ||
options.test ||
options.benchmark ||
options.benchmarkTest ||
(process.platform !== 'win32' && !fs.existsSync(socketPath))
) {
return createApplication(options);
@ -237,7 +235,7 @@ module.exports = class AtomApplication extends EventEmitter {
this.storageFolder = new StorageFolder(process.env.ATOM_HOME);
this.autoUpdateManager = new AutoUpdateManager(
this.version,
options.test || options.benchmark || options.benchmarkTest,
options.test,
this.config
);
@ -266,7 +264,7 @@ module.exports = class AtomApplication extends EventEmitter {
);
let socketServerPromise;
if (options.test || options.benchmark || options.benchmarkTest) {
if (options.test) {
socketServerPromise = Promise.resolve();
} else {
socketServerPromise = this.listenForArgumentsFromNewProcess();
@ -307,7 +305,7 @@ module.exports = class AtomApplication extends EventEmitter {
let optionsForWindowsToOpen = [];
let shouldReopenPreviousWindows = false;
if (options.test || options.benchmark || options.benchmarkTest) {
if (options.test) {
optionsForWindowsToOpen.push(options);
} else if (options.newWindow) {
shouldReopenPreviousWindows = false;

View File

@ -58,7 +58,7 @@ if (args.resourcePath) {
devResourcePath = stableResourcePath;
}
if (args.dev || args.test || args.benchmark || args.benchmarkTest) {
if (args.dev || args.test) {
resourcePath = devResourcePath;
} else {
resourcePath = stableResourcePath;

View File

@ -105,7 +105,7 @@ module.exports = function start(resourcePath, devResourcePath, startTime) {
if (args.userDataDir != null) {
app.setPath('userData', args.userDataDir);
} else if (args.test || args.benchmark || args.benchmarkTest) {
} else if (args.test) {
app.setPath('userData', temp.mkdirSync('atom-test-data'));
}