In https://github.com/electron/electron/commit/7613afe6d70eadd7446db921918dca086cd324c0 I had to disable the check that validates that the constructor is called on the right thread, because the check fails when the tests run.

Let's make sure the check doesn't fail and re-enable it. Or refactor so that the thread affinity is not required and remove the check.
atom/browser/api/atom_api_app.cc
bool* prevent_default,
    const std::string& type,
    const base::DictionaryValue& user_info) {
  *prevent_default = Emit("update-activity-state", type, user_info);
}
void App::OnNewWindowForTab() {
  Emit("new-window-for-tab");
}
#endif
void App::OnLogin(LoginHandler* login_handler,
                  const base::DictionaryValue& request_details) {
  v8::Locker locker(isolate());
  v8::HandleScope handle_scope(isolate());
  bool prevent_default = false;
  content::WebContents* web_contents = login_handler->GetWebContents();
  if (web_contents) {
    prevent_default =
        Emit("login",
             WebContents::CreateFrom(isolate(), web_contents),
             request_details,
             login_handler->auth_info(),
             base::Bind(&PassLoginInformation,
                        make_scoped_refptr(login_handler)));
  }
  
  if (!prevent_default)
    login_handler->CancelAuth();
}
void App::OnCreateWindow(