B2G/gecko/dom/network/tests/unit/test_tcpsocket.js
/**
 * Test that data sent from the server correctly fires the ondata
 * callback on the client side.
 */
Test that data sent from the server correctly fires the ondata
callback on the client side.
Test that data sent from the server correctly fires the ondata callback on the client side .
function receiveData() {
  server.ondata = makeFailureCase('serverdata');
  sock.ondata = makeExpectData('data', DATA_ARRAY, true);
  server.binaryOutput.writeByteArray(DATA_ARRAY, DATA_ARRAY.length);
}
function receiveData ( ) { server . ondata = makeFailureCase ( 'serverdata' ) ; sock . ondata = makeExpectData ( 'data' , DATA_ARRAY , true ) ; server . binaryOutput . writeByteArray ( DATA_ARRAY , DATA_ARRAY . length ) ; }
Test that data sent from the server correctly fires the ondata
 callback on the client side.
Test that data sent from the server correctly fires the ondata callback on the client side .