Home

Class goog.testing.MockUserAgent

Class for unit testing code that uses goog.userAgent.

extends goog.Disposable
Instance Method Summary
disposeInternal()

Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:

mypackage.MyClass = function() {
goog.base(this);
// Constructor logic specific to MyClass.
...
};
goog.inherits(mypackage.MyClass, goog.Disposable);

mypackage.MyClass.prototype.disposeInternal = function() {
goog.base(this, 'disposeInternal');
// Dispose logic specific to MyClass.
...
};

getNavigator() ⇒ ?Object
getUserAgentString() ⇒ ?string
install()

Installs this MockUserAgent.

setNavigator(?Object navigator)
setUserAgentString(string userAgent)
uninstall()

Uninstalls the MockUserAgent.