Revert "Revert "Integration test for new window offset.""

This reverts commit c8c8bc941e.
This commit is contained in:
joshaber 2016-01-05 12:48:34 -05:00
parent b6c3b39dfe
commit 2a29e7d1f4
2 changed files with 22 additions and 0 deletions

View File

@ -127,6 +127,9 @@ buildAtomClient = (args, env) ->
.execute -> require("remote").require("app").emit("before-quit")
.call(done)
.addCommand "getWindowPosition", (cb) ->
@execute((-> atom.getPosition()), cb)
module.exports = (args, env, fn) ->
[chromedriver, chromedriverLogs, chromedriverExit] = []

View File

@ -181,6 +181,25 @@ describe "Starting Atom", ->
, 5000)
.waitForPaneItemCount(1, 5000)
it "opens a new window offset from the other window", ->
runAtom [path.join(tempDirPath, "new-file")], {ATOM_HOME: atomHome}, (client) ->
win0Position = null
win1Position = null
client
.waitForWindowCount(1, 10000)
.getWindowPosition()
.then ({value}) -> win0Position = value
.waitForNewWindow(->
@startAnotherAtom([path.join(temp.mkdirSync("a-third-dir"), "a-file")], ATOM_HOME: atomHome)
, 5000)
.waitForWindowCount(2, 10000)
.getWindowPosition()
.then ({value}) -> win1Position = value
.then ->
offset = atom.getWindowOffsetForCurrentPlatform()
expect(win0Position.x).toEqual(win1Position.x + offset)
expect(win0Position.y).toEqual(win1Position.y + offset)
it "doesn't open a new window if openEmptyEditorOnStart is disabled", ->
configPath = path.join(atomHome, 'config.cson')
config = CSON.readFileSync(configPath)