Pass explicit window global into AtomEnvironment on construction

This commit is contained in:
Nathan Sobo
2015-10-13 19:35:51 -06:00
parent c8407167ee
commit 65ae175e72
6 changed files with 17 additions and 17 deletions

View File

@@ -213,7 +213,7 @@ describe "AtomEnvironment", ->
describe "::unloadEditorWindow()", ->
it "saves the serialized state of the window so it can be deserialized after reload", ->
atomEnvironment = new AtomEnvironment(applicationDelegate: atom.applicationDelegate)
atomEnvironment = new AtomEnvironment({applicationDelegate: atom.applicationDelegate, window})
spyOn(atomEnvironment, 'saveStateSync')
workspaceState = atomEnvironment.workspace.serialize()
@@ -231,7 +231,7 @@ describe "AtomEnvironment", ->
describe "::destroy()", ->
it "unsubscribes from all buffers", ->
atomEnvironment = new AtomEnvironment(applicationDelegate: atom.applicationDelegate)
atomEnvironment = new AtomEnvironment({applicationDelegate: atom.applicationDelegate, window})
waitsForPromise ->
atomEnvironment.workspace.open("sample.js")

View File

@@ -18,7 +18,7 @@ module.exports = ({logFile, headless, testPaths, buildAtomEnvironment}) ->
applicationDelegate = new ApplicationDelegate()
applicationDelegate.setRepresentedFilename = ->
applicationDelegate.setWindowDocumentEdited = ->
window.atom = buildAtomEnvironment({applicationDelegate})
window.atom = buildAtomEnvironment({applicationDelegate, window})
require './spec-helper'
disableFocusMethods() if process.env.JANKY_SHA1 or process.env.CI

View File

@@ -18,7 +18,7 @@ describe "WindowEventHandler", ->
loadSettings.initialPath = initialPath
loadSettings
atom.project.destroy()
windowEventHandler = new WindowEventHandler({atomEnvironment: atom, applicationDelegate: atom.applicationDelegate})
windowEventHandler = new WindowEventHandler({atomEnvironment: atom, applicationDelegate: atom.applicationDelegate, window})
projectPath = atom.project.getPaths()[0]
afterEach ->