B2G/gecko/netwerk/test/httpserver/test/test_host.js
/**
 * Verifies that all .primary* getters on a server identity correctly throw
 * NS_ERROR_NOT_INITIALIZED.
 *
 * @param id : nsIHttpServerIdentity
 *   the server identity to test
 */
Verifies that all .primary* getters on a server identity correctly throw
NS_ERROR_NOT_INITIALIZED.

@param id : nsIHttpServerIdentity
the server identity to test
Verifies that all . primary * getters on a server identity correctly throw NS_ERROR_NOT_INITIALIZED . @param id : nsIHttpServerIdentity the server identity to test
function checkPrimariesThrow(id)
{
  var threw = false;
  try
  {
    id.primaryScheme;
  }
  catch (e)
  {
    threw = e === Cr.NS_ERROR_NOT_INITIALIZED;
  }
  do_check_true(threw);
  threw = false;
  try
  {
    id.primaryHost;
  }
  catch (e)
  {
    threw = e === Cr.NS_ERROR_NOT_INITIALIZED;
  }
  do_check_true(threw);
  threw = false;
  try
  {
    id.primaryPort;
  }
  catch (e)
  {
    threw = e === Cr.NS_ERROR_NOT_INITIALIZED;
  }
  do_check_true(threw);
}
function checkPrimariesThrow ( id ) { var threw = false ; try { id . primaryScheme ; } catch ( e ) { threw = e === Cr . NS_ERROR_NOT_INITIALIZED ; } do_check_true ( threw ) ; threw = false ; try { id . primaryHost ; } catch ( e ) { threw = e === Cr . NS_ERROR_NOT_INITIALIZED ; } do_check_true ( threw ) ; threw = false ; try { id . primaryPort ; } catch ( e ) { threw = e === Cr . NS_ERROR_NOT_INITIALIZED ; } do_check_true ( threw ) ; }
Verifies that all .primary* getters on a server identity correctly throw
 NS_ERROR_NOT_INITIALIZED.
Verifies that all . primary * getters on a server identity correctly throw NS_ERROR_NOT_INITIALIZED .