B2G/gecko/netwerk/test/httpserver/test/head_utils.js
/**
 * Represents a path to load from the tested HTTP server, along with actions to
 * take before, during, and after loading the associated page.
 *
 * @param path
 *   the URL to load from the server
 * @param initChannel
 *   a function which takes as a single parameter a channel created for path and
 *   initializes its state, or null if no additional initialization is needed
 * @param onStartRequest
 *   called during onStartRequest for the load of the URL, with the same
 *   parameters; the request parameter has been QI'd to nsIHttpChannel and
 *   nsIHttpChannelInternal for convenience; may be null if nothing needs to be
 *   done
 * @param onStopRequest
 *   called during onStopRequest for the channel, with the same parameters plus
 *   a trailing parameter containing an array of the bytes of data downloaded in
 *   the body of the channel response; the request parameter has been QI'd to
 *   nsIHttpChannel and nsIHttpChannelInternal for convenience; may be null if
 *   nothing needs to be done
 */
Represents a path to load from the tested HTTP server, along with actions to
take before, during, and after loading the associated page.

@param path
the URL to load from the server
@param initChannel
a function which takes as a single parameter a channel created for path and
initializes its state, or null if no additional initialization is needed
@param onStartRequest
called during onStartRequest for the load of the URL, with the same
parameters; the request parameter has been QI'd to nsIHttpChannel and
nsIHttpChannelInternal for convenience; may be null if nothing needs to be
done
@param onStopRequest
called during onStopRequest for the channel, with the same parameters plus
a trailing parameter containing an array of the bytes of data downloaded in
the body of the channel response; the request parameter has been QI'd to
nsIHttpChannel and nsIHttpChannelInternal for convenience; may be null if
nothing needs to be done
Represents a path to load from the tested HTTP server along with actions to take before during and after loading the associated page . @param path the URL to load from the server @param initChannel a function which takes as a single parameter a channel created for path and initializes its state or null if no additional initialization is needed @param onStartRequest called during onStartRequest for the load of the URL with the same parameters ; the request parameter has been QI ' d to nsIHttpChannel and nsIHttpChannelInternal for convenience ; may be null if nothing needs to be done @param onStopRequest called during onStopRequest for the channel with the same parameters plus a trailing parameter containing an array of the bytes of data downloaded in the body of the channel response ; the request parameter has been QI ' d to nsIHttpChannel and nsIHttpChannelInternal for convenience ; may be null if nothing needs to be done
function Test(path, initChannel, onStartRequest, onStopRequest)
{
  function nil() { }
  this.path = path;
  this.initChannel = initChannel || nil;
  this.onStartRequest = onStartRequest || nil;
  this.onStopRequest = onStopRequest || nil;
}
function Test ( path , initChannel , onStartRequest , onStopRequest ) { function nil ( ) { } this . path = path ; this . initChannel = initChannel || nil ; this . onStartRequest = onStartRequest || nil ; this . onStopRequest = onStopRequest || nil ; }
Represents a path to load from the tested HTTP server, along with actions to
 take before, during, and after loading the associated page.
Represents a path to load from the tested HTTP server along with actions to take before during and after loading the associated page .