summaryrefslogtreecommitdiffstats
path: root/chrome/test
diff options
context:
space:
mode:
authorjyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 21:57:21 +0000
committerjyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-17 21:57:21 +0000
commitc7a6442fbcc4ed7f4ea4c0f7d84ddf9cf8cd1618 (patch)
tree99c0753c91cce4502248eff19780fad3486e3f33 /chrome/test
parente89b01d7541f219db3f926580ed7d27af9d93ad7 (diff)
downloadchromium_src-c7a6442fbcc4ed7f4ea4c0f7d84ddf9cf8cd1618.zip
chromium_src-c7a6442fbcc4ed7f4ea4c0f7d84ddf9cf8cd1618.tar.gz
chromium_src-c7a6442fbcc4ed7f4ea4c0f7d84ddf9cf8cd1618.tar.bz2
Fix test-running in --single-process mode.
* Avoid destroying the ContentRendererClient, since that asserts we're on the renderer's thread * Avoid asserting that all RenderProcessHosts are destroyed, since r170644 avoided destroying them in single-process mode. Review URL: https://chromiumcodereview.appspot.com/11567053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173543 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r--chrome/test/base/in_process_browser_test.cc9
-rw-r--r--chrome/test/base/in_process_browser_test.h3
2 files changed, 6 insertions, 6 deletions
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index 8371e28..fb3c5fa 100644
--- a/chrome/test/base/in_process_browser_test.cc
+++ b/chrome/test/base/in_process_browser_test.cc
@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/lazy_instance.h"
#include "base/path_service.h"
#include "base/string_number_conversions.h"
#include "base/test/test_file_util.h"
@@ -60,6 +61,10 @@ namespace {
// Passed as value of kTestType.
const char kBrowserTestType[] = "browser";
+// Used when running in single-process mode.
+base::LazyInstance<chrome::ChromeContentRendererClient>::Leaky
+ g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
+
} // namespace
InProcessBrowserTest::InProcessBrowserTest()
@@ -111,10 +116,8 @@ void InProcessBrowserTest::SetUp() {
// Single-process mode is not set in BrowserMain, so process it explicitly,
// and set up renderer.
if (command_line->HasSwitch(switches::kSingleProcess)) {
- single_process_renderer_client_.reset(
- new chrome::ChromeContentRendererClient);
content::GetContentClient()->set_renderer_for_testing(
- single_process_renderer_client_.get());
+ &g_chrome_content_renderer_client.Get());
}
#if defined(OS_CHROMEOS)
diff --git a/chrome/test/base/in_process_browser_test.h b/chrome/test/base/in_process_browser_test.h
index de72dc2..33667ba 100644
--- a/chrome/test/base/in_process_browser_test.h
+++ b/chrome/test/base/in_process_browser_test.h
@@ -188,9 +188,6 @@ class InProcessBrowserTest : public content::BrowserTestBase {
// Browser created from CreateBrowser.
Browser* browser_;
- // ContentRendererClient when running in single-process mode.
- scoped_ptr<content::ContentRendererClient> single_process_renderer_client_;
-
// Host resolver to use during the test.
scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_;