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/atom_browser_client.cc
}
content::WebContents* AtomBrowserClient::GetWebContentsFromProcessID(
    int process_id) {
  
  
  if (base::ContainsKey(pending_processes_, process_id))
    return pending_processes_[process_id];
  
  
  return WebContentsPreferences::GetWebContentsFromProcessID(process_id);
}
bool AtomBrowserClient::ShouldCreateNewSiteInstance(
    content::RenderFrameHost* render_frame_host,
    content::BrowserContext* browser_context,
    content::SiteInstance* current_instance,
    const GURL& url) {
  if (url.SchemeIs(url::kJavaScriptScheme))
    
    return false;
  int process_id = current_instance->GetProcess()->GetID();
  if (!IsRendererSandboxed(process_id)) {
    if (!RendererUsesNativeWindowOpen(process_id)) {
      
      
      return true;
    }
    auto web_contents =
        content::WebContents::FromRenderFrameHost(render_frame_host);
    if (!ChildWebContentsTracker::IsChildWebContents(web_contents)) {