Index: chrome/test/base/in_process_browser_test.cc |
=================================================================== |
--- chrome/test/base/in_process_browser_test.cc (revision 257128) |
+++ chrome/test/base/in_process_browser_test.cc (working copy) |
@@ -75,10 +75,6 @@ |
// Passed as value of kTestType. |
const char kBrowserTestType[] = "browser"; |
-// Used when running in single-process mode. |
-base::LazyInstance<ChromeContentRendererClient>::Leaky |
- g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER; |
- |
// A BrowserListObserver that makes sure that all browsers created are on the |
// |allowed_desktop_|. |
class SingleDesktopTestObserver : public chrome::BrowserListObserver, |
@@ -133,11 +129,17 @@ |
chrome_path = chrome_path.Append(chrome::kBrowserProcessExecutablePath); |
CHECK(PathService::Override(base::FILE_EXE, chrome_path)); |
#endif // defined(OS_MACOSX) |
+ |
CreateTestServer(base::FilePath(FILE_PATH_LITERAL("chrome/test/data"))); |
base::FilePath src_dir; |
CHECK(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); |
- embedded_test_server()->ServeFilesFromDirectory( |
- src_dir.AppendASCII("chrome/test/data")); |
+ base::FilePath test_data_dir = src_dir.AppendASCII("chrome/test/data"); |
+ embedded_test_server()->ServeFilesFromDirectory(test_data_dir); |
+ |
+ // chrome::DIR_TEST_DATA isn't going to be setup until after we call |
+ // ContentMain. However that is after tests' constructors or SetUp methods, |
+ // which sometimes need it. So just override it. |
+ CHECK(PathService::Override(chrome::DIR_TEST_DATA, test_data_dir)); |
} |
InProcessBrowserTest::~InProcessBrowserTest() { |
@@ -162,13 +164,6 @@ |
ASSERT_TRUE(SetUpUserDataDirectory()) |
<< "Could not set up user data directory."; |
- // Single-process mode is not set in BrowserMain, so process it explicitly, |
- // and set up renderer. |
- if (command_line->HasSwitch(switches::kSingleProcess)) { |
- content::SetRendererClientForTesting( |
- g_chrome_content_renderer_client.Pointer()); |
- } |
- |
#if defined(OS_CHROMEOS) |
// Make sure that the log directory exists. |
base::FilePath log_dir = logging::GetSessionLogFile(*command_line).DirName(); |