B2G/gecko/netwerk/test/httpserver/test/test_async_response_sending.js
/**
   * Indicates that the given status is expected to be returned when the stream
   * listener for the copy indicates completion, that the expected data copied
   * by the copier to sink are the concatenation of the arrays of bytes in
   * receivedData, and kicks off the tasks in this test.
   *
   * @param expectedStatus : nsresult
   *   the status expected to be returned by the copier at completion
   * @param receivedData : [[uint]]
   *   an array containing arrays of bytes whose concatenation constitutes the
   *   expected copied data
   */
Indicates that the given status is expected to be returned when the stream
listener for the copy indicates completion, that the expected data copied
by the copier to sink are the concatenation of the arrays of bytes in
receivedData, and kicks off the tasks in this test.

@param expectedStatus : nsresult
the status expected to be returned by the copier at completion
@param receivedData : [[uint]]
an array containing arrays of bytes whose concatenation constitutes the
expected copied data
Indicates that the given status is expected to be returned when the stream listener for the copy indicates completion that the expected data copied by the copier to sink are the concatenation of the arrays of bytes in receivedData and kicks off the tasks in this test . @param expectedStatus : nsresult the status expected to be returned by the copier at completion @param receivedData : [[ uint ]] an array containing arrays of bytes whose concatenation constitutes the expected copied data
function expect(expectedStatus, receivedData)
  {
    this._expectedStatus = expectedStatus;
    this._expectedData = [];
    for (var i = 0, sz = receivedData.length; i < sz; i++)
      this._expectedData.push.apply(this._expectedData, receivedData[i]);
    this._stageNextTask();
  }
function expect ( expectedStatus , receivedData ) { this . _expectedStatus = expectedStatus ; this . _expectedData = [ ] ; for ( var i = 0 , sz = receivedData . length ; i < sz ; i ++ ) this . _expectedData . push . apply ( this . _expectedData , receivedData [ i ] ) ; this . _stageNextTask ( ) ; }
Indicates that the given status is expected to be returned when the stream
 listener for the copy indicates completion, that the expected data copied
 by the copier to sink are the concatenation of the arrays of bytes in
 receivedData, and kicks off the tasks in this test.
Indicates that the given status is expected to be returned when the stream listener for the copy indicates completion that the expected data copied by the copier to sink are the concatenation of the arrays of bytes in receivedData and kicks off the tasks in this test .