This is #12545 (send event to save state after 'Add Project Folder' or 'Remove Projec') + tests. Does it appropriate for merge now?
Copy of the description from #12545:
When we add or remove project folder, the window's current project path will be changed, then "initialPaths" will be reloaded, it is the best time to save state
/cc @maxbrunsfeld @lee-dohm
send event to save state after 'Add Project Folder' or 'Remove Projec…
rename to did-change-paths
delete empty line
Merge commit '1320ff28c39afd563820b30b43389ea38552e74c' into fix-12495
Add test to ensure the state saved when project folders changed.
Okey, windows fails... most probably because I try to read ATOM_HOME/storage/application.json too fast after creation.
There is some variants (and I need help from atom devs to select most appropriate one):
Try fix tests on Windows.
Only count AtomApplication#saveState calls, not saved content.
Bad, seems like on Windows AtomApplication#saveState does not called at all, will investigate...
Another try to fix tests on Windows.
Wait for ipc.
Hmm... I will try to setup dev environment on windows to fix that, but it will need some time...
If anyone with windows can fix it - welcome!
Really fix tests on windows
Path names with backslashes was not quoted.
Restore test behaviour to check content of storage/application.json
Additional check that storage/application.json exists
Refactor test code
Done. Now it pass tests.
After fixing test code for windows, I reverted tests to initial behavior to check actual ATOM_HOME/storage/application.json content.
I can if needed squash my commits into one and rebase this branch.
@vovkasm No need to squash or rebase these commits; they're fine as they are. Really nice job figuring out how to test this! I'll take a look on Monday.
👏 Great work @yuanwhy, @vovkasm.
Avoid assertions about application.json in main process test
We can test the user-facing behavior by launching a second instance
This will go out in Atom 1.14 Beta.