Closure Library API Documentation
Go to class or file:
storage.mechanism.MockThrowableStorage
Extends
A minimal WebStorage implementation that throws exceptions for disabled storage. Since we cannot have unit tests running in Safari private mode to test this, we need to mock an exception throwing when trying to set a value.
Useful links
Source Code
Git
Inheritance
goog.storage.mechanism.MockThrowableStorage
Constructor
goog.storage.mechanism.MockThrowableStorage(
opt_isStorageDisabled
)
Parameters
opt_isStorageDisabled
:
boolean=
If true, throws exceptions emulating Private browsing mode. If false, storage quota will be marked as exceeded.
Instance Methods
Public
Protected
Private
Defined in
goog.storage.mechanism.MockThrowableStorage
key
(
index
)
⇒
string
A very simple, dummy implementation of key(), merely to verify that calls to HTML5WebStorage#key are proxied through.
Arguments:
index
:
number
A key index.
Returns:
string
The key associated with that index.
code »
removeItem
()
No description.
code »
setItem
()
No description.
code »
Instance Properties
Defined in
goog.storage.mechanism.MockThrowableStorage
isStorageDisabled_
:
No description.
Code »
length
:
No description.
Code »
Package storage.mechanism
Package Reference