Commit Graph

27 Commits

Author SHA1 Message Date
Thomas Johansen
a8147c09a2 🔥 Remove console.log shims 2015-11-18 17:46:20 +01:00
Antonio Scandurra
967fca7214 🎨 2015-11-13 18:51:06 +01:00
Antonio Scandurra
c7ca50b2b6 Set initialLoadComplete to true only in test mode 2015-11-13 18:01:21 +01:00
Nathan Sobo
ab6f26368b Add link to comment 2015-11-11 12:15:14 -07:00
Nathan Sobo
d46cea9c41 Disable throttling in test windows via WebAudio hack
Throttling in test windows is annoying when tests run interactively,
and *seems* to cause issues with animation frames not firing even in
headless tests, though it’s difficult to fully confirm since this issue
is intermittent.
2015-11-07 16:01:20 -07:00
Antonio Scandurra
6290822067 Export a function in windowInitializationScript
...so that we can pass BlobStore to AtomEnvironment
2015-11-03 09:51:08 +01:00
Nathan Sobo
979b08f5fe Override console.log/error/warn in headless mode to log to stdout/stderr 2015-10-17 10:55:23 -06:00
Nathan Sobo
c35411cd29 🎨 2015-10-17 10:52:39 -06:00
Antonio Scandurra
edddb6516e Remove shim to remote.process
This doesn't seem to work as expected. I think it's just better to encourage
emitting an event like 'write-to-stdout' or using directly `remote.process`.

/cc: @nathansobo
2015-10-15 09:55:28 +02:00
Nathan Sobo
9df40b4f4e Remove unnecessary fat arrow 2015-10-14 19:53:16 -06:00
Nathan Sobo
82cbf01c5b Set useCapture to true when handling keydown events in test windows
Prevents these events from getting intercepted by other handlers.
2015-10-14 15:57:45 -06:00
Nathan Sobo
e92cb86335 Introduce ApplicationDelegate to AtomEnvironment
All external actions are performed via this delegate for test-isolation
purposes.
2015-10-13 15:42:57 -06:00
Antonio Scandurra
cf5d94f084 Return a promise in test runners 2015-10-13 09:02:37 +02:00
Nathan Sobo
69e8b0cfb1 Prevent title change during specs 2015-10-12 15:19:55 -06:00
Antonio Scandurra
304d35a300 Shim process stdout and stderr 2015-10-12 15:39:56 +02:00
Antonio Scandurra
4863b71fd7 Set timeout in the main process 2015-10-09 09:20:19 +02:00
Antonio Scandurra
5da32540b1 🎨 2015-10-08 11:54:11 +02:00
Antonio Scandurra
1d280e8d92 Introduce timeout option
The idea with this commit is to implement a timeout functionality that does not
rely on a system utility (such as unix `timeout`). Tests could hang because of a
CPU-bound task and, as a result, we need to handle timeouts in a separate
process.

An ideal implementation would first spawn the timeout, which in turn would spawn
the tests, acting as a supervisor and making sure they do not exceed the
supplied time. However, setting up such an environment would have been trickier,
thus the test process spawns the timeout cop before running any test. This, in
turn, invokes a `setTimeout` function and kills the parent process as soon as
the timeout gets triggered, logging to console the reason why the parent process
was killed (and exiting the parent process with code 130).

I haven't used `Task` because, in order to log stuff to the console, we need to
fork the ChildProcess from `remote`, as otherwise nothing gets written out.
2015-10-08 11:38:48 +02:00
Antonio Scandurra
52c43a71d3 Pass legacyTestRunner parameter 2015-10-07 15:25:06 -05:00
Nathan Sobo
dcb1d8296f Pass buildAtomEnvironment function to test runner
Don’t build an AtomEnvironment or assign it to the atom global until
this function is called by the runner.
2015-10-07 15:25:00 -05:00
Nathan Sobo
d9776abea6 Rename Atom to AtomEnvironment 2015-10-07 15:25:00 -05:00
Nathan Sobo
4a00d6ba35 Bind cmd/ctrl-w to close window in tests
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-07 15:24:55 -05:00
Nathan Sobo
a3e1b34e95 Add reload and toggle dev tools key bindings to test window
Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
2015-10-07 15:24:55 -05:00
Nathan Sobo
6c67f42eab Move state loading for Atom environment to an instance method 2015-10-07 15:24:54 -05:00
Nathan Sobo
2e54ae1e57 Allow a custom test runner path to be specified in package.json
If the nearest containing package.json of a test path has an
atomTestRunner field, we’ll require the specified file as a test runner
rather than the default jasmine runner.
2015-10-07 15:24:50 -05:00
Nathan Sobo
e4d64309b7 Allow multiple test paths to be specified as command line arguments 2015-10-07 15:24:50 -05:00
Nathan Sobo
e886d8b253 Rename “bootstrap” scripts
They’re just window initialization scripts, and this new naming makes
that a lot clearer.
2015-10-07 15:24:50 -05:00