OLD | NEW |
1 // Copyright (c) 2010 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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #endif | 43 #endif |
44 EXPECT_FALSE(cl.HasSwitch("cruller")); | 44 EXPECT_FALSE(cl.HasSwitch("cruller")); |
45 EXPECT_FALSE(cl.HasSwitch("flim")); | 45 EXPECT_FALSE(cl.HasSwitch("flim")); |
46 EXPECT_FALSE(cl.HasSwitch("program")); | 46 EXPECT_FALSE(cl.HasSwitch("program")); |
47 EXPECT_FALSE(cl.HasSwitch("dog")); | 47 EXPECT_FALSE(cl.HasSwitch("dog")); |
48 EXPECT_FALSE(cl.HasSwitch("cat")); | 48 EXPECT_FALSE(cl.HasSwitch("cat")); |
49 EXPECT_FALSE(cl.HasSwitch("output-rotation")); | 49 EXPECT_FALSE(cl.HasSwitch("output-rotation")); |
50 EXPECT_FALSE(cl.HasSwitch("not-a-switch")); | 50 EXPECT_FALSE(cl.HasSwitch("not-a-switch")); |
51 EXPECT_FALSE(cl.HasSwitch("--")); | 51 EXPECT_FALSE(cl.HasSwitch("--")); |
52 | 52 |
53 EXPECT_EQ(L"program", cl.program()); | 53 EXPECT_EQ(FilePath(FILE_PATH_LITERAL("program")).value(), |
| 54 cl.GetProgram().value()); |
54 | 55 |
55 EXPECT_TRUE(cl.HasSwitch("foo")); | 56 EXPECT_TRUE(cl.HasSwitch("foo")); |
56 EXPECT_TRUE(cl.HasSwitch("bar")); | 57 EXPECT_TRUE(cl.HasSwitch("bar")); |
57 EXPECT_TRUE(cl.HasSwitch("baz")); | 58 EXPECT_TRUE(cl.HasSwitch("baz")); |
58 EXPECT_TRUE(cl.HasSwitch("spaetzle")); | 59 EXPECT_TRUE(cl.HasSwitch("spaetzle")); |
59 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
60 EXPECT_TRUE(cl.HasSwitch("SPAETZLE")); | 61 EXPECT_TRUE(cl.HasSwitch("SPAETZLE")); |
61 #endif | 62 #endif |
62 EXPECT_TRUE(cl.HasSwitch("other-switches")); | 63 EXPECT_TRUE(cl.HasSwitch("other-switches")); |
63 EXPECT_TRUE(cl.HasSwitch("input-translation")); | 64 EXPECT_TRUE(cl.HasSwitch("input-translation")); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 #if defined(OS_WIN) | 147 #if defined(OS_WIN) |
147 EXPECT_EQ(L"\"Program\" " | 148 EXPECT_EQ(L"\"Program\" " |
148 L"--switch1 " | 149 L"--switch1 " |
149 L"--switch2=value " | 150 L"--switch2=value " |
150 L"--switch3=\"a value with spaces\" " | 151 L"--switch3=\"a value with spaces\" " |
151 L"--switch4=\"\\\"a value with quotes\\\"\" " | 152 L"--switch4=\"\\\"a value with quotes\\\"\" " |
152 L"--quotes=\"" TRICKY_QUOTED L"\"", | 153 L"--quotes=\"" TRICKY_QUOTED L"\"", |
153 cl.command_line_string()); | 154 cl.command_line_string()); |
154 #endif | 155 #endif |
155 } | 156 } |
OLD | NEW |