goog.testing.fs
Functions
createObjectUrl( blob ) → string
string
Create a fake object URL for a given fake blob. This can be used as a real URL, and it can be created and revoked normally.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getBlob( ...var_args ) → goog.testing.fs.Blob
goog.testing.fs.Blob
Concatenates one or more values together and converts them to a fake blob.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getBlobWithProperties( parts, opt_type, opt_endings ) → goog.testing.fs.Blob
goog.testing.fs.Blob
Creates a blob with the given properties. See https://developer.mozilla.org/en-US/docs/Web/API/Blob for more details.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getPersistent( size ) → goog.async.Deferred
goog.async.Deferred
Get a filesystem object. Since these are mocks, there's no difference between temporary and persistent filesystems.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
getTemporary( size ) → goog.async.Deferred
goog.async.Deferred
Get a filesystem object. Since these are mocks, there's no difference between temporary and persistent filesystems.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
install( stubs ) → void
void
Installs goog.testing.fs in place of the standard goog.fs. After calling this, code that uses goog.fs should work without issue using goog.testing.fs.
Parameters |
|
---|
isObjectUrlGranted( blob ) → boolean
boolean
Return whether or not a URL has been granted for the given blob.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
revokeObjectUrl( url ) → void
void
sliceBlob( testBlob, start, opt_end ) → goog.testing.fs.Blob
goog.testing.fs.Blob
Slices the blob. The returned blob contains data from the start byte (inclusive) till the end byte (exclusive). Negative indices can be used to count bytes from the end of the blob (-1 == blob.size - 1). Indices are always clamped to blob range. If end is omitted, all the data till the end of the blob is taken.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|