B2G/gecko/b2g/components/test/unit/head_identity.js
// uses as a pointer back into the doc object
uses as a pointer back into the doc object
uses as a pointer back into the doc object
function mockDoc(aParams, aDoFunc) {
  let mockedDoc = {};
  mockedDoc.id = uuid();
  Object.keys(aParams).forEach(function(param) {
    mockedDoc[param] = aParams[param];
  });
  mockedDoc.origin = "https://jedp.gov";
  mockedDoc['do'] = aDoFunc;
  mockedDoc.doReady = partial(aDoFunc, 'ready');
  mockedDoc.doLogin = partial(aDoFunc, 'login');
  mockedDoc.doLogout = partial(aDoFunc, 'logout');
  mockedDoc.doError = partial(aDoFunc, 'error');
  mockedDoc.doCancel = partial(aDoFunc, 'cancel');
  mockedDoc.doCoffee = partial(aDoFunc, 'coffee');
  return mockedDoc;
}
function mockDoc ( aParams , aDoFunc ) { let mockedDoc = { } ; mockedDoc . id = uuid ( ) ; Object . keys ( aParams ) . forEach ( function ( param ) { mockedDoc [ param ] = aParams [ param ] ; } ) ; mockedDoc . origin = "https://jedp.gov" ; mockedDoc [ 'do' ] = aDoFunc ; mockedDoc . doReady = partial ( aDoFunc , 'ready' ) ; mockedDoc . doLogin = partial ( aDoFunc , 'login' ) ; mockedDoc . doLogout = partial ( aDoFunc , 'logout' ) ; mockedDoc . doError = partial ( aDoFunc , 'error' ) ; mockedDoc . doCancel = partial ( aDoFunc , 'cancel' ) ; mockedDoc . doCoffee = partial ( aDoFunc , 'coffee' ) ; return mockedDoc ; }
uses as a pointer back into the doc object
uses as a pointer back into the doc object
// Properties of aParams may include loggedInUser // the origin is set inside nsDOMIdentity by looking at the // document.nodePrincipal.origin.  Here we, we must satisfy // ourselves with pretending.