#include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
+#include "content/public/test/browser_test_utils.h"
using content::RenderViewHost;
using content::RenderWidgetHost;
RenderViewHost* host = RenderViewHost::From(widget);
WebContents* contents = WebContents::FromRenderViewHost(host);
GURL url = contents->GetURL();
- if (url.SchemeIs(chrome::kChromeDevToolsScheme))
+ if (url.SchemeIs(content::kChromeDevToolsScheme))
return host;
}
return NULL;
CHECK(wc->GetURL() == page);
WaitForLauncherThread();
+ WaitForMessageProcessing(wc);
return wc->GetRenderProcessHost()->GetHandle();
}
CHECK(wc->GetVisibleURL() == page);
WaitForLauncherThread();
+ WaitForMessageProcessing(wc);
return wc->GetRenderProcessHost()->GetHandle();
}
base::MessageLoop::current()->Run();
}
+ // Implicitly waits for the renderer process associated with the specified
+ // WebContents to process outstanding IPC messages by running some JavaScript
+ // and waiting for the result.
+ void WaitForMessageProcessing(WebContents* wc) {
+ bool result = false;
+ ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
+ wc, "window.domAutomationController.send(true);", &result));
+ ASSERT_TRUE(result);
+ }
+
// When we hit the max number of renderers, verify that the way we do process
// sharing behaves correctly. In particular, this test is verifying that even
// when we hit the max process limit, that renderers of each type will wind up
// We don't change process priorities on Mac or Posix because the user lacks the
// permission to raise a process' priority even after lowering it.
+// flaky, disabling on branch
#if defined(OS_WIN) || defined(OS_LINUX)
-IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, Backgrounding) {
+IN_PROC_BROWSER_TEST_F(ChromeRenderProcessHostTest, DISABLED_Backgrounding) {
if (!base::Process::CanBackgroundProcesses()) {
LOG(ERROR) << "Can't background processes";
return;