Commit Graph

223 Commits

Author SHA1 Message Date
Max Brunsfeld
61e53834e6 Make StorageFolder.load, AtomApplication.launch async
Signed-off-by: Nathan Sobo <nathan@github.com>
2018-01-19 11:52:25 -08:00
Max Brunsfeld
0390548e2c Make FileRecoveryService async 2018-01-18 11:27:27 -08:00
Wliu
5c3d6abb12
Merge branch 'master' into wl-async-confirm 2018-01-07 21:08:32 -05:00
Max Brunsfeld
386b786d93 Let 'atom --wait -a folder' exit due to removing the project folder 2018-01-05 17:50:11 -08:00
Max Brunsfeld
1f4ccf3024 Allow existing windows to be reused when running --wait 2018-01-05 17:50:11 -08:00
Max Brunsfeld
7f76320387 Backfill a test for existing --wait functionality 2018-01-05 17:50:11 -08:00
Max Brunsfeld
b645852142 Don't rely on promise resolution timing in main process spec 2018-01-05 13:01:33 -08:00
Max Brunsfeld
1de37810f0 Rename hasQuitted -> didQuit 2018-01-05 12:11:10 -08:00
Max Brunsfeld
9b917dd8c8 Don't use babel for atom-application test 2018-01-05 12:11:10 -08:00
Wliu
f4bdbe87a0
Update message box mocking 2017-11-19 01:01:45 +01:00
Ash Wilson
9a0ad46739
Ensure app windows launch in the order we assert they do 2017-11-13 09:51:23 -05:00
Michelle Tilley
0267829211
Change the way we test this 2017-11-02 16:45:52 -07:00
Michelle Tilley
99bef8e7d1
More debugging 2017-11-02 16:09:57 -07:00
Michelle Tilley
444597c845
Let's add some debugging 2017-11-02 15:49:06 -07:00
Michelle Tilley
178756b62a
update test 2017-11-02 15:27:59 -07:00
Michelle Tilley
ada75ed1dd
Fix bug in test 2017-11-02 14:45:14 -07:00
Michelle Tilley
668397c1d0
Fix flaky test 2017-11-02 14:11:52 -07:00
Michelle Tilley
db0fd527ce
Add test for core URI handler window-selection logic 2017-11-02 13:35:29 -07:00
Michelle Tilley
158622ce48
Convert array of windows in AtomApplication to a WindowStack 2017-10-19 14:19:24 -07:00
Michelle Tilley
5e43084cd3
url -> URI 2017-10-17 15:23:10 -07:00
Michelle Tilley
eecd524788
Differenter 2017-09-21 14:57:33 -07:00
Michelle Tilley
c52d517d13
Limit argument parsing when --url-handler is set 2017-09-21 14:50:41 -07:00
Antonio Scandurra
e50a73b033 Fix tests 2017-08-14 12:28:19 +02:00
Antonio Scandurra
91b7c14281 Prompt user only once when quitting/restarting and canceling save dialog
I think this slipped through during the refactoring performed in
dc32018. With this commit we are fixing the regression and adding a new
main process regression test to exercise this behavior.
2017-08-14 12:21:19 +02:00
Ash Wilson
dc9fe25255
Wrap temp.cleanupSync() calls in try-catch blocks 2017-08-04 14:18:43 -04:00
Ash Wilson
97ffe46247
Consistently use require('temp').track() 2017-08-04 14:08:29 -04:00
Ash Wilson
e90441303d
🔥 console.logs 2017-08-02 19:34:44 -04:00
Ash Wilson
41cb5ce076
Configure Mocha to use the JUnit XML reporter 2017-08-01 11:27:16 -04:00
Damien Guard
45037c950a
Disable flakey main process test on Windows 2017-06-09 10:48:17 -07:00
Max Brunsfeld
dc320181fc Fix handling of .save and .saveAs rejections
* Make Pane.close, Pane.saveActiveItem, and Pane.saveActiveItemAs async.
* Refactor the logic for prompting to save on window unload
2017-05-31 17:46:04 -07:00
hansonw
e8cd4bf431 Fix the atom:// URL handler for real (with tests this time) 2017-05-16 11:51:54 -07:00
Bryant Ung
f464bb3579 Merge pull request #13947 from anatoli26/master
Make an option to always restore the last session
2017-05-08 09:33:23 -07:00
Max Brunsfeld
14f9c68659 Use getTreeViewRootDirectories helper in main process test 2017-04-17 13:53:20 -07:00
Max Brunsfeld
cca47d785f Handle active pane items that aren't text editors in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-04-07 14:28:51 -07:00
Max Brunsfeld
6d1cbd389a Wait until tree-view is asynchronously opened in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-04-07 14:28:25 -07:00
Max Brunsfeld
89f1710cfe Wait for paths to open in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-04-07 13:20:44 -07:00
Michelle Tilley
42fb2cc55f Convert more tests to use emitterEventPromise 2017-03-24 00:32:15 -07:00
Michelle Tilley
ae64b35dca We need more time 2017-03-23 23:58:27 -07:00
Michelle Tilley
67a9e19bf9 Oh we can put this back now 2017-03-23 23:48:19 -07:00
Michelle Tilley
132f199fae Fix main process test race conditions 2017-03-23 23:37:18 -07:00
Michelle Tilley
3c47b775d2 Let's make that async pls 2017-03-23 21:28:12 -07:00
Michelle Tilley
0f6489e347 Use test-until for more flexible test timeout 2017-03-23 16:51:59 -07:00
Michelle Tilley
648055c5a9 Just to be sure, let's use a longer timeout 2017-03-23 16:29:01 -07:00
Michelle Tilley
ed2c399997 Fix main process tests 2017-03-23 16:19:11 -07:00
Antonio Scandurra
bade347e01 Revert "Upgrade to Babel 6 and apply fewer transformations when transpiling babel files" 2017-03-17 12:40:38 +01:00
Anatoli
9e41a1b490 Make an option to *always* restore the last session, no matter how Atom is invoked (#9643), part2: new option in Settings is merged with the old one, the result is a 3-value combobox [no, yes, always] 2017-03-08 10:38:08 -03:00
Antonio Scandurra
85dde00e82 Merge branch 'master' into as-use-babel6 2017-02-16 12:59:05 +01:00
Max Brunsfeld
0c3b774c94 Avoid sending file path to renderer process in main process test
On windows, because the path contains backslashes, evaling a string containing
the path can interpret the backslashes as escape sequences
2017-02-15 13:53:08 -08:00
Max Brunsfeld
13055c8620 Wait on loadedPromise for workspace to deserialize in main process test 2017-02-15 11:05:21 -08:00
Antonio Scandurra
cf329d0f63 Use octal integer literal 2017-02-15 17:19:55 +01:00
Max Brunsfeld
ec0270b250 Explicitly save window states in main process test 2017-02-14 12:40:00 -08:00
Max Brunsfeld
ee962052b2 Tweak naming in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2017-02-14 12:05:17 -08:00
Max Brunsfeld
aea6896c2b Restore correct directory's project state when opening a new file from the command line 2017-02-13 17:23:11 -08:00
Nathan Sobo
c6cae5b8fd Store represented directory paths directly on AtomWindow in main process
Fixes #13729

Previously, when adding a window, we were unable to read its current
project paths out of the hash of the URL during window initialization
because the window still considered itself to be loading. Rather than
fixing this issue, we decided to completely eliminate the sharing of
state between processes in the window.location and instead switch to
cached synchronous RPC for the loadSettings and a dedicated RPC-based
mechanism for the project paths.
2017-02-07 13:15:27 -07:00
Max Brunsfeld
d6bddb4ce6 Avoid assertions about application.json in main process test
We can test the user-facing behavior by launching a second instance
of AtomApplication.

Refs #13564
2017-01-09 11:31:25 -08:00
Vladimir Timofeev
a7dda0e6f6 Refactor test code 2017-01-08 00:03:36 +03:00
Vladimir Timofeev
be57e4cd48 Additional check that storage/application.json exists 2017-01-07 23:58:28 +03:00
Vladimir Timofeev
4d5312fec5 Restore test behaviour to check content of storage/application.json 2017-01-07 23:52:29 +03:00
=
1fb066ad68 Really fix tests on windows
Path names with backslashes was not quoted.
2017-01-07 23:11:31 +03:00
Vladimir Timofeev
94f28a3877 Another try to fix tests on Windows.
Wait for ipc.
2017-01-07 14:10:24 +03:00
Vladimir Timofeev
4ba6919d4d Try fix tests on Windows.
Only count AtomApplication#saveState calls, not saved content.
2017-01-07 13:04:05 +03:00
Vladimir Timofeev
bc77a79e86 Add test to ensure the state saved when project folders changed. 2017-01-07 10:59:22 +03:00
Damien Guard
3fd1dbdce3
Clean up temporary files when running specs 2016-12-01 10:48:45 -08:00
Damien Guard
4c4fa2b478
Integration tests now pass on Win32 2016-11-29 16:55:14 -08:00
Max Brunsfeld
b88fa984cf Wait for project folder to be added in main process tests 2016-09-21 11:37:37 -07:00
Max Brunsfeld
3039024d17 Go back to using promise based on window:loaded event in main process tests 2016-09-21 11:37:24 -07:00
Max Brunsfeld
cff4de5195 Wait for project directory to be added in main process test 2016-09-21 11:04:29 -07:00
Max Brunsfeld
d1a4fd2378 Wait for reused window's project paths to update in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:52:47 -07:00
Max Brunsfeld
833b3b0ab0 Save state when reloading AtomWindow
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:10:11 -07:00
Max Brunsfeld
c2c7241eda Destroy AtomEnvironment in beforeunload handler, not unload handler
See https://github.com/electron/electron/issues/7278

Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-20 16:10:05 -07:00
Max Brunsfeld
46eb861f84 Try manually tearing down atom env before reloading window in main process spec 2016-09-20 12:37:40 -07:00
Max Brunsfeld
cec2c87793 Assert about remote directories' types in main process test 2016-09-20 09:54:28 -07:00
Max Brunsfeld
ee1b8160e5 Wait for each window to save its state in main process test
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-19 12:06:37 -07:00
Max Brunsfeld
511fe1a576 Tweak test again for travis
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-19 11:02:48 -07:00
Nathan Sobo
7bba3e86b2 Try this on travis 2016-09-16 16:47:33 -06:00
Nathan Sobo
f62bf2c7e0 Focus test on for travis 2016-09-16 14:22:23 -06:00
Nathan Sobo
5fad2bdbf9 Return a promise from AtomWindow.reload that resolves on window:loaded 2016-09-16 14:10:34 -06:00
Max Brunsfeld
e444076a46 WIP - debug travis CI failures 2016-09-15 17:29:02 -07:00
Max Brunsfeld
0d2b7d12b7 Fix test description 2016-09-15 16:56:10 -07:00
Max Brunsfeld
3758fe5646 Use fake directory provider in integration test for remote dirs
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-15 16:33:04 -07:00
Antonio Scandurra
5c3bad077d Run platform-specific specs without mocking process.platform 2016-09-09 17:58:23 +02:00
Antonio Scandurra
924ca8ecf6 Run main process tests on Windows 2016-09-09 17:58:23 +02:00
Antonio Scandurra
6841babc4a Run main process tests on Linux 2016-09-09 17:58:23 +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
Antonio Scandurra
bb7ff6d535 🎨 2016-09-07 16:36:01 +02:00
Antonio Scandurra
34a99f9c82 Write tests to ensure quitting the application works as expected 2016-09-07 14:18:52 +02:00
Antonio Scandurra
5b57669859 Disable telemetry on AtomApplication tests and smoke-spec.coffee
Unless a choice has been made by the user, this tab always shows up as
the first one when opening Atom, thus breaking some of the assumptions
we make in the main process tests.
2016-08-26 15:13:37 +02:00
Nathan Sobo
b6ab5530b5 Fix focus issues on CircleCI 2016-08-12 13:35:08 -06:00
Nathan Sobo
c861abc2a9 Fix timing issues in atom-application-test
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-12 11:46:12 -06:00
Antonio Scandurra
9847c4fc24 Wait until the window is focused before interacting with it in tests
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-08-12 17:46:13 +02:00
Antonio Scandurra
87d684132c Extract timeoutPromise into async-spec-helpers
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-08-12 17:46:12 +02:00
Antonio Scandurra
4bd644bea2 Bump timeout to 1 minute on AtomApplication tests
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-08-12 17:45:59 +02:00
Antonio Scandurra
336f6425da Discourage people from using temp directly
It's better if we fs.realpathSync the path returned by the temp module.

Signed-off-by: Nathan Sobo <nathan@github.com>
2016-08-12 17:45:56 +02:00
Antonio Scandurra
04d8b9bb86 Ensure we don't reuse the same window when testing the offset distance
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-08-12 17:45:50 +02: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
a817a354dc Use project paths instead of tree view directories to test remote paths 2016-08-12 14:35:40 +02:00
Antonio Scandurra
fe8aabd908 Use spec reporter to know which specs hang 2016-08-12 12:22:36 +02:00
Antonio Scandurra
7fe0f6b455 Move another integration test 2016-08-12 11:29:34 +02:00
Antonio Scandurra
da7b951c07 Move another integration test 2016-08-12 11:22:32 +02:00
Antonio Scandurra
02bc4282d0 Move another integration test 2016-08-12 10:58:59 +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
e8c7b27af4 Move another integration test 2016-08-12 10:10:20 +02:00
Nathan Sobo
3d99cde9e1 Move another integration spec to the main process tests 2016-08-11 16:43:26 -06:00
Nathan Sobo
a29db76073 Move another integration test 2016-08-11 16:33:36 -06:00
Nathan Sobo
b89c0cb415 Move another integration test 2016-08-11 16:33:25 -06:00
Nathan Sobo
29cf1025f1 Assert about tree view root directories rather than project directories
Since these are integration tests, making sure the user sees these
directories in their tree view seems like a good idea.
2016-08-11 16:20:29 -06:00
Nathan Sobo
f953588f91 Move opening multiple directories integration spec to main process tests
It was testing something that didn’t actually work, that opening a
directory that was already open in an existing window would recycle the
window. We explicitly don’t behave that way and the old test was passing
spuriously.
2016-08-11 16:12:41 -06:00
Nathan Sobo
dbfd0cc605 Move integration test of window persistence to main process tests 2016-08-11 15:28:11 -06:00
Nathan Sobo
5f414f4ea7 Move integration specs for reusing windows to main process tests 2016-08-11 15:10:38 -06:00
Nathan Sobo
15bb92f35e Move whitespace trimming integration spec to main process tests 2016-08-11 14:43:23 -06:00
Nathan Sobo
f80c800347 Move test for opening w/ a line:column from Chromedriver to main process 2016-08-11 14:36:47 -06:00
Nathan Sobo
4d4a2530ff Move test for opening w/ a line number from Chromedriver to main process 2016-08-11 14:33:54 -06:00
Nathan Sobo
52ea92803d Use parseCommandLine in atom-application-test.js 2016-08-11 12:45:54 -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
5a8ab1a2b2 🎨
Signed-off-by: Antonio Scandurra <as-cii@github.com>
2016-08-11 08:16:18 -06:00
Antonio Scandurra
6c34844956 🐛 Don't try to recover the same file twice 2016-05-26 11:27:56 +02:00
Antonio Scandurra
49a603a873 Show also a message box when recovery is not successful 2016-05-25 15:54:39 +02:00
Antonio Scandurra
c2b01d54b8 Make coupling looser between the recovery service and the windows 2016-05-25 15:46:37 +02:00
Antonio Scandurra
1a7858c9f1 Log a more informative message when cannot recover a file 2016-05-25 15:15:53 +02:00
Antonio Scandurra
3ce7d0a974 Merge branch 'master' into as-file-recovery-service 2016-05-25 14:04:16 +02:00
Antonio Scandurra
c8fae110e7 Handle recovery when many windows save the same file simultaneously 2016-05-25 14:01:36 +02:00
Antonio Scandurra
3b4c1015cc Forget window when it gets closed 2016-05-25 11:54:09 +02:00
Antonio Scandurra
df0b3dedd7 browser -> main-process 2016-05-25 11:02:29 +02:00