diff --git a/spec/main-process/atom-application.test.js b/spec/main-process/atom-application.test.js index e445676c4..fb1d1ca19 100644 --- a/spec/main-process/atom-application.test.js +++ b/spec/main-process/atom-application.test.js @@ -310,16 +310,18 @@ describe('AtomApplication', function () { fs.symlinkSync(packagePath, path.join(packagesDirPath, 'package-with-directory-provider')) const atomApplication = buildAtomApplication() - const newRemoteFilePath = 'remote://server:3437/some/directory/path' - const window = atomApplication.launch(parseCommandLine([newRemoteFilePath])) + const remoteDirectoryPath = 'remote://server:3437/some/directory/path' + const window = atomApplication.launch(parseCommandLine([remoteDirectoryPath])) + await window.loadedPromise await focusWindow(window) let projectPaths = await evalInWebContents(window.browserWindow.webContents, function (sendBackToMainProcess) { sendBackToMainProcess(atom.project.getPaths()) }) - assert.deepEqual(projectPaths, [newRemoteFilePath]) + assert.deepEqual(projectPaths, [remoteDirectoryPath]) await window.saveState() + await new Promise((resolve) => { window.browserWindow.once('window:loaded', resolve) window.reload() @@ -328,7 +330,7 @@ describe('AtomApplication', function () { projectPaths = await evalInWebContents(window.browserWindow.webContents, function (sendBackToMainProcess) { sendBackToMainProcess(atom.project.getPaths()) }) - assert.deepEqual(projectPaths, [newRemoteFilePath]) + assert.deepEqual(projectPaths, [remoteDirectoryPath]) }) it('reopens any previously opened windows when launched with no path', async function () { diff --git a/static/index.js b/static/index.js index b76477e03..d749e3303 100644 --- a/static/index.js +++ b/static/index.js @@ -77,8 +77,11 @@ setupVmCompatibility() setupCsonCache(CompileCache.getCacheDirectory()) + console.log("INITIALIZING") var initialize = require(loadSettings.windowInitializationScript) + console.log("INITIALIZED") return initialize({blobStore: blobStore}).then(function () { + console.log("EMITTING WINDOW LOADED EVENT") require('electron').ipcRenderer.send('window-command', 'window:loaded') }) }