1
0
Fork 0
mirror of https://github.com/teampoltergeist/poltergeist.git synced 2022-11-09 12:05:00 -05:00
Commit graph

34 commits

Author SHA1 Message Date
Jon Leighton
467c9b9ea0 Fix setting of fixed port 2013-02-04 20:25:13 +00:00
Jon Leighton
98d4a4a893 Fix JRuby support
I also deleted some pointless brittle tests.
2013-01-31 22:05:05 +00:00
Jon Leighton
3365dadfb6 Allow :phantomjs_logger to be a non-FD
It seems inevitable that somebody will try to use StringIO with it, so
may as well make it work.

Also it caused an error with the ci_reporter gem already (#246).

Fixes #246.
2013-01-31 21:17:07 +00:00
Jon Leighton
af162c9f71 Fix broken test 2013-01-31 20:50:28 +00:00
Jon Leighton
7036574ec1 Get the port from the server
Ask, don't tell, or something like that!

Now the WebSocketServer decides what port it will use and everything
else relies on that. By default an ephemeral port is used, but a fixed
port number can be passed in too.

This work is necessary to support Windows (#240) because on Windows a
TCP socket cannot be closed and immediately reopened, which we are doing
in the tests. So this change means that when restarting, a new ephemeral
port can be used by the server.
2013-01-31 20:44:55 +00:00
Gabe Bell
57b2d5e2b1 Add support for custom phantomjs loggers
- supports any `IO` compatible object
- defaults to `$stdout`
- specified via `:phantomjs_logger` in `Driver.new`
2013-01-26 18:47:09 -05:00
Jon Leighton
def06a6387 JRuby doesn't support Process::WNOHANG
Use timeout stdlib instead
2013-01-26 22:48:29 +00:00
Jon Leighton
219a8dd05e Send SIGKILL to PhantomJS if it doesn't exit within 2 seconds
Closes #196
2013-01-26 21:57:22 +00:00
Jon Leighton
a62b9f001a Remove multi_json dependency
Since we depend on Ruby 1.9, we can rely on the presence of json in the
stdlib.
2013-01-26 15:45:56 +00:00
Jon Leighton
3abab5c4c3 Remove childprocess dependency
We no longer need to support Ruby 1.8.
2013-01-26 15:45:09 +00:00
Jon Leighton
b71c21445b Use any available port
This reverts the default port setting to how it was before the 1.0
release. However the `:port` configuration option is still available for
those who need to set it to something static.

The reason for changing this back is that I have seend EADDRINUSE errors
crop up and in general had second thoughts on whether it was a good idea
to use a static port number as the default. I think it's much better and
less error prone to use any available port by default but to allow the
port number to be configured in the small number of cases where that's
necessary.

Closes #174.
2012-10-15 22:44:27 +01:00
Jon Leighton
78ce1cca31 Make the port used deterministic
Fixes #111
2012-10-06 16:57:46 +01:00
Jon Leighton
45c8b4396d use an options hash 2012-07-11 20:25:17 +01:00
Jon Leighton
e270c89d1d move inspector options into phantomjs_options 2012-07-11 20:14:17 +01:00
Jon Leighton
ad7e7b9efa fix steps and tidy a bit 2012-07-11 20:05:10 +01:00
wynst
2a9902d8c4 add phantomjs command-line options 2012-07-09 21:36:50 +07:00
Sumit Shah
6ac4078b3a support setting http request headers 2012-07-02 15:07:33 -07:00
Tom Stuart
0db1eb9767 Allow passing desired browser size as an option 2012-06-04 17:18:25 +02:00
Tom Stuart
96ab96a494 Remove all of the shoulds 2012-06-04 14:21:09 +02:00
Rodrigo Manhães
04118450c2 fix multi_json deprecated calls 2012-04-18 10:17:11 -03:00
Jon Leighton
e251839ed9 JSON -> MultiJson 2012-03-11 11:03:08 +00:00
Jon Leighton
98c3bb564f Remove posix-spawn dependency.
posix-spawn relies on a C extension. This does work under JRuby, but it
won't work on Travis CI as they disallow JRuby C extensions, as they are
considered to not be a good practice.

Instead we are using either Process.spawn on Ruby 1.9, or the
childprocess gem on Ruby 1.8. childprocess uses native JVM APIs on
JRuby, and fork+exec on others.
2012-03-11 10:35:02 +00:00
Jon Leighton
f61ca77cd4 Use posix-spawn gem rather than sfl, as sfl requires fork, which can't work on JRuby. 2012-02-29 22:52:27 +00:00
Jon Leighton
edf3bae153 Add test for :timeout option to driver setting the server's timeout. Closes #36, which was fixed by 84feb34e16. 2012-02-29 12:36:37 +00:00
Jon Leighton
84feb34e16 refactoring 2012-02-29 12:32:13 +00:00
Jon Leighton
335b1d300c fix specs 2012-02-29 12:01:37 +00:00
Jon Leighton
806a204697 Raise a better error when phantomjs returns a non-zero exit status. Fixes #23. 2012-02-29 11:44:05 +00:00
Jon Leighton
3645c3e295 Add test for #22. Closes #22. 2012-02-29 11:25:43 +00:00
Jon Leighton
8d9b224de1 Extract inspector code to a separate class. Implement Driver#debug and Driver#pause methods for using inspector. 2012-02-29 00:02:43 +00:00
Jon Leighton
3810618ea0 Check PhantomJS version from Ruby. Fixes #13. 2012-01-27 17:31:21 +00:00
Jon Leighton
34af795960 Stop using EventMachine for WebSocket server.
Using EventMachine was causing issues when run alongside Thin.

In general running the event loop is quite slow, presumably because it
is mostly spinning idly wasting cycles (unsure). We were mitigating
this by stopping the thread when it wasn't needed, but this is
incorrect when Thin is also running.

Implemented WebSocket server using raw TCP sockets and a WebSocket
parser provided by faye-websocket. This is faster and neater and removes
the need to dick around with threads.

Fixes #6.
2012-01-13 14:34:36 +00:00
Jon Leighton
8745b8bcce Move TimeoutError up a namespace level, and fix the message 2011-10-30 19:02:37 +00:00
Jon Leighton
0bf7501271 Deal with the ServerManager timeout properly 2011-10-28 19:11:36 +01:00
Jon Leighton
76fe32debd omg 2011-10-27 23:34:14 +01:00