java.lang.Object | ||||
↳ | java.rmi.server.RemoteObject | |||
↳ | java.rmi.server.RemoteServer | |||
↳ | java.rmi.server.UnicastRemoteObject | |||
↳ | com.google.gwt.junit.remote.BrowserManagerServer |
Manages instances of a web browser as child processes. This class is experimental and unsupported. An instance of this class can create browser windows using one specific shell-level command. It performs process management (baby sitting) on behalf of a remote client. This can be useful for running a GWTTestCase on a browser that cannot be run on the native platform. For example, a GWTTestCase test running on Linux could use a remote call to a Windows machine to test with Internet Explorer.
Calling main(String[])
can instantiate and register multiple
instances of this class at given RMI namespace locations.
This system has been tested on Internet Explorer 6 & 7. Firefox does not work in the general case; if an existing Firefox process is already running, new processes simply delegate to the existing process and terminate, which breaks the model. A shell script that sets MOZNOREMOTE=1 and cleans up locks/sessions is needed. Safari on MacOS requires very special treatment given Safari's poor command line support, but that is beyond the scope of this documentation.
TODO(scottb): We technically need a watchdog thread to slurp up stdout and stderr from the child processes, or they might block. However, most browsers never write to stdout and stderr, so this is low priority. (There is now a thread that is spawned for each task to wait for an exit value - this might be adapted for that purpose one day.)
This class is not actually serializable as-is, because timer is not serializable.
see http://bugs.sun.com/bugdatabase/view_bug.do;:YfiG?bug_id=4062587
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.rmi.server.RemoteObject
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Keeps the browser process represented by token alive for keepAliveMs,
starting now.
| |||||||||||
Forceably kills the browser process represented by
token ,
disregarding any previous calls to keepAlive(int, long) . | |||||||||||
Launches a new browser window for the specified URL.
| |||||||||||
Starts up and registers one or more browser servers.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.rmi.server.UnicastRemoteObject
| |||||||||||
From class
java.rmi.server.RemoteServer
| |||||||||||
From class
java.rmi.server.RemoteObject
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.google.gwt.junit.remote.BrowserManager
|
Keeps the browser process represented by token alive for keepAliveMs, starting now.
token | an opaque token representing the browser window |
---|---|
keepAliveMs | the number of milliseconds to let the browser process
live; if roughly keepAliveMs milliseconds elapse
without a subsequent call to this method, the browser process
associated with token will be forceably terminated |
Forceably kills the browser process represented by token
,
disregarding any previous calls to keepAlive(int, long)
. If the
process has already terminated, this method completes normally.
token | an opaque token representing the browser window process |
---|
Launches a new browser window for the specified URL.
url | the URL to browse to |
---|---|
keepAliveMs | the initial number of milliseconds to let the browser
process live; if roughly keepAliveMs milliseconds
expire without a subsequent call to keepAlive(int, long) ,
the browser process will be forceably terminated |
Starts up and registers one or more browser servers. Command-line entry point.
Exception |
---|