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) {
|
if (options.pathsToOpen) {
|
||||||
options.pathsToOpen = this.convertPaths(options.pathsToOpen)
|
options.pathsToOpen = this.convertPaths(options.pathsToOpen)
|
||||||
}
|
}
|
||||||
|
options.preserveFocus = true
|
||||||
|
|
||||||
const window = await app.openWithOptions(options)
|
const window = await app.openWithOptions(options)
|
||||||
this.windows.add(window)
|
this.windows.add(window)
|
||||||
@ -719,6 +720,7 @@ class LaunchScenario {
|
|||||||
const app = new AtomApplication({
|
const app = new AtomApplication({
|
||||||
resourcePath: path.resolve(__dirname, '../..'),
|
resourcePath: path.resolve(__dirname, '../..'),
|
||||||
atomHomeDirPath: this.atomHome,
|
atomHomeDirPath: this.atomHome,
|
||||||
|
preserveFocus: true,
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
this.sinon.stub(app, 'createWindow', loadSettings => new StubWindow(this.sinon, loadSettings, options))
|
this.sinon.stub(app, 'createWindow', loadSettings => new StubWindow(this.sinon, loadSettings, options))
|
||||||
|
@ -292,10 +292,13 @@ class AtomApplication extends EventEmitter {
|
|||||||
timeout,
|
timeout,
|
||||||
clearWindowState,
|
clearWindowState,
|
||||||
addToLastWindow,
|
addToLastWindow,
|
||||||
|
preserveFocus,
|
||||||
env
|
env
|
||||||
} = options
|
} = options
|
||||||
|
|
||||||
app.focus()
|
if (!preserveFocus) {
|
||||||
|
app.focus()
|
||||||
|
}
|
||||||
|
|
||||||
if (test) {
|
if (test) {
|
||||||
return this.runTests({
|
return this.runTests({
|
||||||
|
Loading…
Reference in New Issue
Block a user