Ignore --try-chrome-again when no argument is given.

The browser startup codepaths that interpret it all require that it have
a value. This change applies the same policy to the other two places
that check for the switch on the command line.

BUG=784447

Change-Id: I62702cbd377ca95f15e56d3f64f3f13533f15abd
Reviewed-on: https://chromium-review.googlesource.com/768725
Commit-Queue: Lei Zhang <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#516795}
diff --git a/chrome/browser/active_use_util_unittest.cc b/chrome/browser/active_use_util_unittest.cc
index 6a0ecae6..48e39c5 100644
--- a/chrome/browser/active_use_util_unittest.cc
+++ b/chrome/browser/active_use_util_unittest.cc
@@ -19,6 +19,18 @@
 #endif
 }
 
+// --try-chrome-again by itself shouldn't do anything, just like the
+// OrdinaryCommand case.
+TEST(ShouldRecordActiveUse, FakeTryChromeAgainCommand) {
+  base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
+  cmd_line.AppendSwitch(switches::kTryChromeAgain);
+#if !defined(OS_WIN) || defined(GOOGLE_CHROME_BUILD)
+  EXPECT_TRUE(ShouldRecordActiveUse(cmd_line));
+#else
+  EXPECT_FALSE(ShouldRecordActiveUse(cmd_line));
+#endif
+}
+
 TEST(ShouldRecordActiveUse, TryChromeAgainCommand) {
   base::CommandLine cmd_line(base::FilePath(FILE_PATH_LITERAL("foo.exe")));
   cmd_line.AppendSwitchASCII(switches::kTryChromeAgain, "0");