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

Unified Diff: chrome/common/chrome_content_client_unittest.cc

Issue 10907016: Fix CommandLine usage (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client_unittest.cc
diff --git a/chrome/common/chrome_content_client_unittest.cc b/chrome/common/chrome_content_client_unittest.cc
index 67f4d6eeba48df95c8f0553164daed0bef155803..11c52ce3749f080a6076e3ca77559c389cf02ddc 100644
--- a/chrome/common/chrome_content_client_unittest.cc
+++ b/chrome/common/chrome_content_client_unittest.cc
@@ -65,14 +65,16 @@ TEST(ChromeContentClientTest, Basic) {
#if !defined(OS_ANDROID)
CheckUserAgentStringOrdering(false);
#else
- // Do it once for mobile devices and once for other devices.
const char* kArguments[] = {"chrome"};
+ CommandLine::Reset();
+ CommandLine::Init(1, kArguments);
CommandLine* command_line = CommandLine::ForCurrentProcess();
- command_line->Reset();
- command_line->Init(1, kArguments);
+
+ // Do it for regular devices.
ASSERT_FALSE(command_line->HasSwitch(switches::kUseMobileUserAgent));
CheckUserAgentStringOrdering(false);
+ // Do it for mobile devices.
command_line->AppendSwitch(switches::kUseMobileUserAgent);
ASSERT_TRUE(command_line->HasSwitch(switches::kUseMobileUserAgent));
CheckUserAgentStringOrdering(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698