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

Unified Diff: chrome/test/in_process_browser_test.cc

Issue 6596020: Reorganize CommandLine code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "Address comments." Created 9 years, 10 months 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
« base/command_line.cc ('K') | « chrome/test/in_process_browser_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/in_process_browser_test.cc
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index 45cb676e6b67ffae68714d2b3795c41f514f01c3..5c6291bd095cdf19b4ee1ce2ab0e5130f121f3ea 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -99,14 +99,6 @@ InProcessBrowserTest::~InProcessBrowserTest() {
}
void InProcessBrowserTest::SetUp() {
- // Remember the command line. Normally this doesn't matter, because the test
- // harness creates a new process for each test, but when the test harness is
- // running in single process mode, we can't let one test's command-line
- // changes (e.g. enabling DOM automation) affect other tests.
- // TODO(phajdan.jr): This save/restore logic is unnecessary. Remove it.
- CommandLine* command_line = CommandLine::ForCurrentProcessMutable();
- original_command_line_.reset(new CommandLine(*command_line));
-
// Create a temporary user data directory if required.
ASSERT_TRUE(CreateUserDataDirectory())
<< "Could not create user data directory.";
@@ -126,6 +118,7 @@ void InProcessBrowserTest::SetUp() {
// bundle we'll crash.
browser_shutdown::delete_resources_on_shutdown = false;
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
// Allow subclasses the opportunity to make changes to the command line before
// running any tests.
SetUpCommandLine(command_line);
@@ -216,7 +209,7 @@ void InProcessBrowserTest::PrepareTestCommandLine(
}
bool InProcessBrowserTest::CreateUserDataDirectory() {
- CommandLine* command_line = CommandLine::ForCurrentProcessMutable();
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
FilePath user_data_dir =
command_line->GetSwitchValuePath(switches::kUserDataDir);
if (user_data_dir.empty()) {
@@ -243,7 +236,6 @@ void InProcessBrowserTest::TearDown() {
BrowserView::SetShowState(-1);
#endif
- *CommandLine::ForCurrentProcessMutable() = *original_command_line_;
RenderProcessHost::set_run_renderer_in_process(original_single_process_);
}
« base/command_line.cc ('K') | « chrome/test/in_process_browser_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698