Commit Graph

84 Commits

Author SHA1 Message Date
Max Brunsfeld
30fdb70dfd Initialize app-started promise before reloading AtomWindow 2016-09-20 09:53:54 -07:00
Nathan Sobo
7bba3e86b2 Try this on travis 2016-09-16 16:47:33 -06:00
Nathan Sobo
212cb0df34 Resolve AtomWindow.reload promise once window fully starts 2016-09-16 14:33:30 -06:00
Nathan Sobo
5fad2bdbf9 Return a promise from AtomWindow.reload that resolves on window:loaded 2016-09-16 14:10:34 -06:00
Nathan Sobo
0ff0b269b1 Don't wait for spec windows to save state
Since spec windows don't register handlers for the IPC messages requested window state to be saved, the promise never resolves and the close button needs to be clicked twice. To avoid this, we'll just resolve the promise immediately in a spec window so we can proceed to close it.
2016-09-12 10:26:40 -06:00
Damien Guard
77a09a7447 Remove app load time console output 2016-09-09 13:08:00 -07:00
Antonio Scandurra
ccd381b8ad Merge pull request #12645 from atom/as-fix-app-not-quitting-on-windows-and-linux
Fix app not quitting on win32 and linux when closing the last window
2016-09-09 17:57:57 +02:00
Antonio Scandurra
e2a3b75db2 Fix app not quitting on win32 and linux when closing the last window
This regression was caused by a nuance in the way we maintain state in
`AtomApplication` for open windows. Specifically, when closing the last
window on Windows and Linux, we were explicitly calling `app.quit`
*before* removing such window from the list of open ones. In turn, this
caused the new `before-quit` behavior introduced in #12619 to work
improperly because it made the application wait on saving the state of a
stale window before exiting.

With this commit we are fixing that by making sure the stale window is
removed before calling `app.quit` in `removeWindow`.
2016-09-09 10:51:40 +02:00
Damien Guard
6ebd1ad582 Remove accidental logging statements checked in 3eb55d7d 2016-09-08 21:49:48 -07:00
Damien Guard
3eb55d7db0 Add Windows file.ico lost in move to new build 2016-09-08 21:16:55 -07:00
Damien Guard
7c48b947d7 Windows shell upgrade fixes #12642 2016-09-08 15:58:27 -07:00
Antonio Scandurra
34a99f9c82 Write tests to ensure quitting the application works as expected 2016-09-07 14:18:52 +02:00
Antonio Scandurra
0f6eadcfce Wait for windows' state to be saved before closing the app or any window
Previously, we used to save the window's state in the renderer process
`beforeunload` event handler: because of the synchronous nature of event
handlers and the asynchronous design of IndexedDB, this could
potentially not save anything if windows close fast enough to prevent
IndexedDB from committing the pending transaction containing the state.
(Ref.: https://mzl.la/2bXCXDn)

With this commit, we will intercept the `before-quit` events on
`electron.app` and the `close` event on `BrowserWindow` (which will fire
respectively before quitting the application and before closing a
window), and prevent them from performing the default action. We will
then ask each renderer process to save its state and, finally, close the
window and/or the app.
2016-09-07 13:03:33 +02:00
Alan
71ee729f84 Change Help->Documentation url from https to http (Fix #12583)
The flight manual page does not have a secure connection, so navigating
to the https link would result in a SSL_ERROR_BAD_CERT_DOMAIN error.

It might be better to add a secure connection to the server rather than
pulling this commit.
2016-09-01 14:14:17 -07:00
Nathan Sobo
b3009f1387 Focus application on all code paths that open windows in main process
I think this should take the application out of “app nap” on macOS,
leading to better responsiveness when opening paths from the CLI.
2016-08-28 06:17:41 -06:00
Damien Guard
cf36ecf3ca Merge branch 'master' into sm-windows-file-icon 2016-08-25 18:20:51 -07:00
Damien Guard
ba704cf29e Copy file icon and use as icon for Atom associated files 2016-08-25 11:31:17 -07:00
Damien Guard
b6a72b058d Set the app name in Windows file handler to handle beta 2016-08-23 13:32:42 -07:00
Damien Guard
d47fd28c86 Focus new window when existing copy of Atom running fixes #4324 2016-08-12 17:45:24 -07:00
Antonio Scandurra
753db274fc Clear storage data after each AtomApplication test
This, along with using a temporary directory as the ATOM_HOME, will make
sure that tests won't share any state with one another, possibly
increasing the level of resiliency of the suite.
2016-08-12 15:20:58 +02:00
Antonio Scandurra
c422699c80 Call @config.load() in AtomApplication constructor
This is needed in order to test configuration settings like
`restorePreviousWindowsOnStart`. Even if this call has side effects, its
scope is pretty constrained because it affects only the temporary
directory we create before each atom-application test.
2016-08-12 11:21:37 +02:00
Antonio Scandurra
f287e8783f Return an AtomWindow array in loadState or null if no state is found 2016-08-12 10:49:46 +02:00
Antonio Scandurra
fff2ecd162 Extract a AtomApplication.prototype.launch method
...so that we can exercise loading previously opened windows stored
state after the application is restarted. In addition, this resembles
more what we run in production, and therefore allows us to have a better
coverage of the code paths we run in the real application.
2016-08-12 10:44:09 +02:00
Antonio Scandurra
a8c73f0529 Fix calling atom --version 2016-08-12 09:33:15 +02:00
Nathan Sobo
dbfd0cc605 Move integration test of window persistence to main process tests 2016-08-11 15:28:11 -06:00
Nathan Sobo
f1295d39a8 Close all windows in AtomApplication.destroy 2016-08-11 14:31:36 -06:00
Nathan Sobo
6994060e72 Use fat arrow where it is needed 2016-08-11 14:31:23 -06:00
Nathan Sobo
2fe5027b57 Set the userData dir to a temp directory for main process tests
This ensures that the indexedDB is accessible even if another Atom is
running.
2016-08-11 14:30:52 -06:00
Nathan Sobo
324e8d6c7a Move env assignment into parseCommandLine
A bit of a misnomer but makes things more testable so I’ll accept it
until we can do more overhaul.
2016-08-11 14:30:22 -06:00
Nathan Sobo
847911f0fe Extract parseCommandLine from main.js to its own file for testing
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-11 12:44:20 -06:00
Nathan Sobo
502339b830 Replace chromedriver test of window offset with main process mocha test
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-11 10:33:12 -06:00
Nathan Sobo
d8b2a1f4b6 Break out constructor side effects into AtomApplication.initialize
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-11 08:15:00 -06:00
Antonio Scandurra
45afe07dc1 Don't throw an error when ATOM_HOME does not exist 2016-08-03 15:59:00 +02:00
Nathan Sobo
c1b2042bcc 🎨 2016-08-02 16:19:38 -06:00
Nathan Sobo
0240206d93 Merge branch 'master' into brumm-master 2016-08-02 15:39:57 -06:00
Damien Guard
f3caa67109 Ensure beta is detected from path 2016-07-29 15:51:45 -07:00
Damien Guard
82efce08ed Fix WinShell closure/for issue, improve error handling 2016-07-29 14:48:33 -07:00
Antonio Scandurra
9ad9a96b34 Copy comments 2016-07-27 15:09:08 +02:00
Antonio Scandurra
ccccafd4ea 🎨 2016-07-27 15:01:50 +02:00
Antonio Scandurra
4fc049461c var -> const 2016-07-27 14:59:24 +02:00
Antonio Scandurra
e4946a1892 Make Atom executable as a standard Electron app 2016-07-27 14:58:23 +02:00
Damien Guard
2fb0d68be8 Blank lines and for x in y syntax from review 2016-07-19 16:33:29 -07:00
Damien Guard
23dfa392c9 Fix up Squirrel specs 2016-07-18 22:56:02 -07:00
Damien Guard
1610bcedb1 Ensure install & upgrade fix up previous shell paths 2016-07-17 22:42:08 -07:00
Philipp Brumm
76357473ad call setSheetOffset on onDidChangeActiveThemes 2016-07-13 14:59:37 +02:00
Damien Guard
81ebb686bb Fixes from testing Windows shell integration 2016-07-11 09:59:08 -07:00
Damien Guard
6a4f6751d1 Revise API to reduce surface area 2016-07-08 13:31:19 -07:00
Damien Guard
3e826c1357 Initial checkpoint not yet tested with settings-view changes 2016-07-08 10:04:59 -07:00
Philipp Brumm
08a358228b move title bar setting check into method and check for isSpec as well 2016-07-06 14:22:17 +02:00
Philipp Brumm
29dab2e5b2 setSheetOffset to height of titlebar 2016-07-02 13:01:14 +02:00