goog.net.BrowserTestChannel
Classgoog.net.BrowserTestChannel(channel, channelDebug)
Encapsulates the logic for a single BrowserTestChannel.
channel
{goog.net.BrowserChannel
}
channelDebug
{goog.net.ChannelDebug
}
.abort()
Aborts the test channel.
.connect(path)
Starts the test channel. This initiates connections to the server.
path
{string
}
.createXhrIo(hostPrefix)
Factory method for XhrIo objects.
hostPrefix
{?string
}
goog.net.XhrIo
}
.getLastStatusCode()
Returns the last status code received for a request.
number
}
.isActive(browserChannel)
Gets whether this channel is currently active. This is used to determine the length of time to wait before retrying.
browserChannel
{goog.net.BrowserChannel
}
boolean
}
.isClosed()
Returns whether the test channel is closed. The ChannelRequest object expects this method to be implemented on its handler.
boolean
}
.notifyServerReachabilityEvent(reachabilityType)
Notifies the channel of a fine grained network event.
reachabilityType
{goog.net.BrowserChannel.ServerReachability
}
.onRequestComplete(req)
Callback from ChannelRequest that indicates a request has completed.
req
{goog.net.ChannelRequest
}
.onRequestData(req, responseText)
Callback from ChannelRequest for when new data is received
req
{goog.net.ChannelRequest
}
responseText
{string
}
.setExtraHeaders(extraHeaders)
Sets extra HTTP headers to add to all the requests sent to the server.
extraHeaders
{Object
}
.setParser(parser)
Sets a new parser for the response payload. A custom parser may be set to avoid using eval(), for example. By default, the parser uses {@code goog.json.unsafeParse}.
parser
{!goog.string.Parser
}
.shouldUseSecondaryDomains()
boolean
}