function mock_doc(aIdentity, aOrigin, aDoFunc) {
  let mockedDoc = {};
  mockedDoc.id = uuid();
  mockedDoc.loggedInUser = aIdentity;
  mockedDoc.origin = aOrigin;
  mockedDoc["do"] = aDoFunc;
  mockedDoc._mm = TEST_MESSAGE_MANAGER;
  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");
  mockedDoc.childProcessShutdown = partial(aDoFunc, "child-process-shutdown");

  mockedDoc.RP = mockedDoc;

  return mockedDoc;
}
// 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 mock_doc(aIdentity, aOrigin, aDoFunc) {
  let mockedDoc = {};
  mockedDoc.id = uuid();
  mockedDoc.loggedInUser = aIdentity;
  mockedDoc.origin = aOrigin;
  mockedDoc["do"] = aDoFunc;
  mockedDoc._mm = TEST_MESSAGE_MANAGER;
  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");
  mockedDoc.childProcessShutdown = partial(aDoFunc, "child-process-shutdown");
  mockedDoc.RP = mockedDoc;
  return mockedDoc;
}
function mock_doc ( aIdentity , aOrigin , aDoFunc ) { let mockedDoc = { } ; mockedDoc . id = uuid ( ) ; mockedDoc . loggedInUser = aIdentity ; mockedDoc . origin = aOrigin ; mockedDoc [ "do" ] = aDoFunc ; mockedDoc . _mm = TEST_MESSAGE_MANAGER ; 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" ) ; mockedDoc . childProcessShutdown = partial ( aDoFunc , "child-process-shutdown" ) ; mockedDoc . RP = mockedDoc ; return mockedDoc ; }
uses as a pointer back into the doc object
uses as a pointer back into the doc object