Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Unified Diff: chrome/test/base/in_process_browser_test.cc

Issue 11567053: Fix test-running in --single-process mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/test/base/in_process_browser_test.cc
diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc
index 8371e28b7e1716542465e69d14ed14a55eb1e4a0..fb3c5faaeaf4fa80d7357d1c3273d6ee0579c92c 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)
« chrome/browser/profiles/profile_destroyer.cc ('K') | « chrome/test/base/in_process_browser_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698