testing.MockStorage Extends
A JS storage instance, implementing the HMTL5 Storage interface. See http://www.w3.org/TR/webstorage/ for details.

Inheritance

Constructor

goog.testing.MockStorage()

Instance Methods

Public Protected Private
clear()
Clears the storage.
code »
getItem(key) ?string
Gets an item from the storage. The item returned is the "structured clone" of the value from setItem. In practice this means it's the value cast to a string.
Arguments:
key : string
Storage key.
Returns: ?string  Storage value for key; null if does not exist.
code »
key(index) ?string
Returns the key at the given index.
Arguments:
index : number
The index for the key.
Returns: ?string  Key at the given index, null if not found.
code »
removeItem(key)
Removes and item from the storage.
Arguments:
key : string
Storage key.
code »
setItem(keyvalue)
Sets an item to the storage.
Arguments:
key : string
Storage key.
value : *
Storage value. Must be convertible to string.
code »

Instance Properties

length :
The number of elements in the storage.
Code »
store_ : goog.structs.Map
The underlying storage object.
Code »

Package testing

Package Reference