mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-19 23:17:16 +03:00
Add preserveFocus flag to keep main process tests from stealing focus
This commit is contained in:
parent
e782cea2bf
commit
b1d6e42aa9
@ -597,6 +597,7 @@ class LaunchScenario {
|
||||
if (options.pathsToOpen) {
|
||||
options.pathsToOpen = this.convertPaths(options.pathsToOpen)
|
||||
}
|
||||
options.preserveFocus = true
|
||||
|
||||
const window = await app.openWithOptions(options)
|
||||
this.windows.add(window)
|
||||
@ -719,6 +720,7 @@ class LaunchScenario {
|
||||
const app = new AtomApplication({
|
||||
resourcePath: path.resolve(__dirname, '../..'),
|
||||
atomHomeDirPath: this.atomHome,
|
||||
preserveFocus: true,
|
||||
...options
|
||||
})
|
||||
this.sinon.stub(app, 'createWindow', loadSettings => new StubWindow(this.sinon, loadSettings, options))
|
||||
|
@ -292,10 +292,13 @@ class AtomApplication extends EventEmitter {
|
||||
timeout,
|
||||
clearWindowState,
|
||||
addToLastWindow,
|
||||
preserveFocus,
|
||||
env
|
||||
} = options
|
||||
|
||||
if (!preserveFocus) {
|
||||
app.focus()
|
||||
}
|
||||
|
||||
if (test) {
|
||||
return this.runTests({
|
||||
|
Loading…
Reference in New Issue
Block a user