OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/file_path.h" | 6 #include "base/file_path.h" |
7 #include "base/logging.h" | |
8 #include "chrome/common/chrome_switches.h" | 7 #include "chrome/common/chrome_switches.h" |
9 #include "chrome_frame/chrome_launcher.h" | 8 #include "chrome_frame/chrome_launcher.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
11 | 10 |
12 TEST(ChromeLauncher, IsValidCommandLine) { | 11 TEST(ChromeLauncher, IsValidCommandLine) { |
13 CommandLine bad(FilePath(L"dummy.exe")); | 12 CommandLine bad(FilePath(L"dummy.exe")); |
14 bad.AppendSwitch(switches::kNoFirstRun); // in whitelist | 13 bad.AppendSwitch(switches::kNoFirstRun); // in whitelist |
15 bad.AppendSwitch("no-such-switch"); // does not exist | 14 bad.AppendSwitch("no-such-switch"); // does not exist |
16 bad.AppendSwitch(switches::kHomePage); // exists but not in whitelist | 15 bad.AppendSwitch(switches::kHomePage); // exists but not in whitelist |
17 | 16 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"chrome-frame")); | 64 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"chrome-frame")); |
66 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"-chrome-frame")); | 65 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"-chrome-frame")); |
67 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"---chrome-frame")); | 66 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"---chrome-frame")); |
68 EXPECT_FALSE(chrome_launcher::IsValidArgument(L" --chrome-frame")); | 67 EXPECT_FALSE(chrome_launcher::IsValidArgument(L" --chrome-frame")); |
69 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"--chrome-framefoobar")); | 68 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"--chrome-framefoobar")); |
70 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"foobar--chrome-frame")); | 69 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"foobar--chrome-frame")); |
71 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"--chrome-frames")); | 70 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"--chrome-frames")); |
72 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"--Chrome-frame")); | 71 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"--Chrome-frame")); |
73 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"")); | 72 EXPECT_FALSE(chrome_launcher::IsValidArgument(L"")); |
74 } | 73 } |
OLD | NEW |