com.google.gwt.junit.remote
Interface BrowserManager

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
BrowserManagerServer

public interface BrowserManager
extends java.rmi.Remote

An interface to manage (possibly remote) browser windows. This class is experimental and unsupported.


Method Summary
 void keepAlive(int token, long keepAliveMs)
          Keeps the browser process represented by token alive for keepAliveMs, starting now.
 void killBrowser(int token)
          Forceably kills the browser process represented by token, disregarding any previous calls to keepAlive(int, long).
 int launchNewBrowser(java.lang.String url, long keepAliveMs)
          Launches a new browser window for the specified URL.
 

Method Detail

keepAlive

void keepAlive(int token,
               long keepAliveMs)
               throws java.rmi.RemoteException
Keeps the browser process represented by token alive for keepAliveMs, starting now.

Parameters:
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
Throws:
java.lang.IllegalStateException - if the process represented by token has already terminated.
java.lang.IllegalArgumentException - if token does not represent a process that was returned from launchNewBrowser(String, long).
java.lang.IllegalArgumentException - if keepAliveMs <= 0.
java.rmi.RemoteException - if an error occurs calling a remote implementation.

killBrowser

void killBrowser(int token)
                 throws java.rmi.RemoteException
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.

Parameters:
token - an opaque token representing the browser window process
Throws:
java.lang.IllegalArgumentException - if token does not represent a process that was returned from launchNewBrowser(String, long).
java.rmi.RemoteException - if an error occurs calling a remote implementation.

launchNewBrowser

int launchNewBrowser(java.lang.String url,
                     long keepAliveMs)
                     throws java.rmi.RemoteException
Launches a new browser window for the specified URL.

Parameters:
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
Returns:
a positive integer that serves an an opaque token representing the new browser window.
Throws:
java.lang.IllegalArgumentException - if url is null.
java.lang.IllegalArgumentException - if keepAliveMs <= 0.
java.lang.RuntimeException - if an error occurs launching the browser process.
java.rmi.RemoteException - if an error occurs calling a remote implementation.