Commit Graph

73 Commits

Author SHA1 Message Date
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
Philipp Brumm
6370db9d99 change dialog wording 2016-07-02 12:40:18 +02:00
Philipp Brumm
faa1f935f8 make custom titlebar user-configurable and prompt for relaunch on change 2016-07-02 12:28:14 +02:00
Philipp Brumm
a357228876 explicitly check for platform being darwin before applying titleBarStyle 2016-07-02 12:28:14 +02:00
Philipp Brumm
4897f4db26 replace OSX window title bar with custom title-bar 2016-07-02 12:28:14 +02:00
Damien Guard
22922dec96 CrashReporter should not run on UI thread on Win/Linux 2016-06-27 16:31:01 -07:00
Damien Guard
511587c3d0 Merge pull request #11929 from atom/windows-multiple-versions
Allow different versions of Atom to run simultaneously on Win32
2016-06-23 10:59:19 -07:00
Leonard Lamprecht
3a1ad3fd40 Replace OS X and Mac OS with macOS 2016-06-18 15:33:08 +02:00
Lee Dohm
c7e3b0c728 📝 Update old docs links to point to Flight Manual 2016-06-15 08:57:27 -07:00
Sam Hunter
2d68c49274 Only spec window's web view should force focus 2016-06-12 23:20:43 -07:00
Sam Hunter
2daa8d60f4 Fix WebView focus
This code is needed to automatically focus the webview when it is blurred
2016-06-12 23:16:26 -07:00
Sam Hunter
0f673ea884 Remove workaround for old Windows bug
The code removed is no longer needed as it was fixed in this issue of atom-shell

https://github.com/electron/electron/issues/380
2016-06-10 23:49:14 -07:00