public interface

BrowserManager

implements Remote
com.google.gwt.junit.remote.BrowserManager
Known Indirect Subclasses

Class Overview

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

Summary

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

Public Methods

public abstract void keepAlive (int token, long keepAliveMs)

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

public abstract void killBrowser (int token)

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
IllegalArgumentException if token does not represent a process that was returned from launchNewBrowser(String, long).
RemoteException if an error occurs calling a remote implementation.

public abstract int launchNewBrowser (String url, long keepAliveMs)

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
IllegalArgumentException if url is null.
IllegalArgumentException if keepAliveMs <= 0.
RuntimeException if an error occurs launching the browser process.
RemoteException if an error occurs calling a remote implementation.