goog.Disposable | |
goog.events.EventTarget | goog.Disposable |
goog.testing.net.XhrIo | goog.events.EventTarget |
opt_testQueue
: goog.testing.TestQueue=
Test queue for inserting test
events.
|
![]()
Abort the current XMLHttpRequest
Arguments:
|
code » | |||
![]()
Creates a new XHR object.
Returns: goog.net.XhrLike.OrNative
The newly created XHR
object.
|
code » | |||
Gets the text of all the headers in the response.
Will only return correct result when called from the context of a callback
and the request has completed
Returns: string
The string containing all the response headers.
|
code » | |||
Gets the last POST content that was requested.
|
code » | |||
Gets the last error message.
Returns: string
Last error message.
|
code » | |||
![]()
Gets the last error message.
Returns: goog.net.ErrorCode
Last error code.
|
code » | |||
Gets the last HTTP method that was requested.
|
code » | |||
Gets the headers of the last request.
Returns: Object | goog.structs.Map | undefined
Last headers manually set in send
call or undefined if no additional headers were specified.
|
code » | |||
Gets the last URI that was requested.
Returns: string
Last URI.
|
code » | |||
Returns the readystate.
Returns: number
goog.net.XmlHttp.ReadyState.*.
|
code » | |||
![]()
Get the response as the type specificed by
#setResponseType . At time
of writing, this is only supported in very recent versions of WebKit
(10.0.612.1 dev and later).
Returns: *
The response.
|
code » | |||
Gets the response body from the Xhr object. Will only return correct result
when called from the context of a callback.
Returns: Object
Binary result from the server or null.
|
code » | |||
Get the value of the response-header with the given name from the Xhr object
Will only return correct result when called from the context of a callback
and the request has completed
|
code » | |||
Returns all response headers as a key-value map.
Multiple values for the same header key can be combined into one,
separated by a comma and a space.
Note that the native getResponseHeader method for retrieving a single header
does a case insensitive match on the header name. This method does not
include any case normalization logic, it will just return a key-value
representation of the headers.
See: http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader()-method
|
code » | |||
Gets the response and evaluates it as JSON from the Xhr object. Will only
return correct result when called from the context of a callback.
Arguments:
Returns: Object
JavaScript object.
|
code » | |||
Gets the response text from the Xhr object. Will only return correct result
when called from the context of a callback.
Returns: string
Result from the server.
|
code » | |||
![]()
Gets the desired type for the response.
Returns: goog.net.XhrIo.ResponseType
The desired type for the response.
|
code » | |||
Gets the response XML from the Xhr object. Will only return correct result
when called from the context of a callback.
Returns: Document
Result from the server if it was XML.
|
code » | |||
Get the status from the Xhr object. Will only return correct result when
called from the context of a callback.
Returns: number
Http status.
|
code » | |||
Get the status text from the Xhr object. Will only return correct result
when called from the context of a callback.
Returns: string
Status text.
|
code » | |||
Returns the number of milliseconds after which an incomplete request will be
aborted, or 0 if no timeout is set.
Returns: number
Timeout interval in milliseconds.
|
code » | |||
Gets whether a "credentialed" request is to be sent.
Returns: boolean
The desired type for the response.
|
code » | |||
No description.
Returns: boolean
Whether there is an active request.
|
code » | |||
Has the request completed.
Returns: boolean
Whether the request has completed.
|
code » | |||
Has the request compeleted with a success.
Returns: boolean
Whether the request compeleted successfully.
|
code » | |||
![]()
Simulates the XhrIo send.
|
code » | |||
![]()
Sets the desired type for the response. At time of writing, this is only
supported in very recent versions of WebKit (10.0.612.1 dev and later).
If this is used, the response may only be accessed via
#getResponse .
Arguments:
|
code » | |||
![]()
Sets the number of milliseconds after which an incomplete request will be
aborted and a
goog.net.EventType.TIMEOUT event raised; 0 means no
timeout is set.
Arguments:
|
code » | |||
![]()
Sets whether a "credentialed" request that is aware of cookie and
authentication information should be made. This option is only supported by
browsers that support HTTP Access Control. As of this writing, this option
is not supported in IE.
Arguments:
|
code » | |||
![]()
Simulate receiving some bytes but the request not fully completing, and
the XHR entering the 'INTERACTIVE' state.
Arguments:
|
code » | |||
![]()
Simulates the Xhr is ready for the next request.
|
code » | |||
![]()
Simulates changing to the new ready state.
Arguments:
|
code » | |||
![]()
Simulates receiving a response.
|
code » | |||
![]()
Causes timeout events to be fired.
|
code » |
![]()
Use
#listen instead, when possible. Otherwise, use
goog.events.listen if you are passing Object
(instead of Function) as handler.
Adds an event listener to the event target. The same handler can only be
added once per the type. Even if you add the same handler multiple times
using the same type then it will only be called once when the event is
dispatched.
Arguments:
|
code » | |||||
![]()
Asserts that the event target instance is initialized properly.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Removes listeners from this object. Classes that extend EventTarget may
need to override this method in order to remove references to DOM Elements
and additional listeners.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
Returns the parent of this event target to use for bubbling.
Returns: goog.events.EventTarget
The parent EventTarget or null if
there is no parent.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
Use
#unlisten instead, when possible. Otherwise, use
goog.events.unlisten if you are passing Object
(instead of Function) as handler.
Removes an event listener from the event target. The handler must be the
same object as the one added. If the handler has not been added then
nothing is done.
Arguments:
|
code » | |||||
![]()
Sets the parent of this event target to use for capture/bubble
mechanism.
Arguments:
|
code » | |||||
![]()
Sets the target to be used for
event.target when firing
event. Mainly used for testing. For example, see
goog.testing.events.mixinListenable .
Arguments:
|
code » | |||||
![]()
No description.
|
code » | |||||
![]()
No description.
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
![]()
Whether MockXhrIo is active.
|
Code » | |
![]()
No description.
|
Code » | |
Map of default headers to add to every request, use:
XhrIo.headers.set(name, value)
|
Code » | |
![]()
Last POST content that was requested.
|
Code » | |
![]()
Last error code.
|
Code » | |
![]()
Last error message.
|
Code » | |
![]()
Additional headers that were requested in the last query.
|
Code » | |
![]()
Last HTTP method that was requested.
|
Code » | |
![]()
Last URI that was requested.
|
Code » | |
![]()
Mock ready state.
|
Code » | |
![]()
Stores the simulated response headers for the requests which are sent through
this XhrIo.
|
Code » | |
![]()
The requested type for the response. The empty string means use the default
XHR behavior.
|
Code » | |
![]()
The response object.
|
Code » | |
Queue of events write to.
|
Code » | |
![]()
Window timeout ID used to cancel the timeout event handler if the request
completes successfully.
|
Code » | |
![]()
Number of milliseconds after which an incomplete request will be aborted and
a
goog.net.EventType.TIMEOUT event raised; 0 means no timeout is set.
|
Code » | |
![]()
Whether a "credentialed" request is to be sent (one that is aware of cookies
and authentication) . This is applicable only for cross-domain requests and
more recent browsers that support this part of the HTTP Access Control
standard.
|
Code » | |
![]()
Whether there's currently an underlying XHR object.
|
Code » |
The object to use for event.target. Useful when mixing in an
EventTarget to another object.
|
Code » | |
![]()
No description.
|
Code » | |
Maps of event type to an array of listeners.
|
Code » | |
Parent event target, used during event bubbling.
TODO(user): Change this to goog.events.Listenable. This
currently breaks people who expect getParentEventTarget to return
goog.events.EventTarget.
|
Code » |
![]()
Disposes all non-disposed instances of goog.testing.net.XhrIo created by
goog.testing.net.XhrIo.send .
|
code » | |||||||
![]()
Disposes of the specified goog.testing.net.XhrIo created by
goog.testing.net.XhrIo.send and removes it from
goog.testing.net.XhrIo.pendingStaticSendInstances_ .
Arguments:
|
code » | |||||||
Returns an Array containing all non-disposed instances of
goog.testing.net.XhrIo created by
goog.testing.net.XhrIo.send .
Returns: Array
Array of goog.testing.net.XhrIo instances.
|
code » | |||||||
![]()
Simulates the static XhrIo send method.
Arguments:
|
code » |
![]()
All non-disposed instances of goog.testing.net.XhrIo created
by
goog.testing.net.XhrIo.send are in this Array.
|
Code » | |
![]()
No description.
|
Code » |
![]()
Alias this enum here to make mocking of goog.net.XhrIo easier.
Constants:
|
Code » |