OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
13 | 13 |
14 using base::FilePath; | 14 using base::FilePath; |
15 | 15 |
16 // To test Windows quoting behavior, we use a string that has some backslashes | 16 // To test Windows quoting behavior, we use a string that has some backslashes |
17 // and quotes. | 17 // and quotes. |
18 // Consider the command-line argument: q\"bs1\bs2\\bs3q\\\" | 18 // Consider the command-line argument: q\"bs1\bs2\\bs3q\\\" |
19 // Here it is with C-style escapes. | 19 // Here it is with C-style escapes. |
20 static const CommandLine::StringType kTrickyQuoted = | 20 static const CommandLine::StringType kTrickyQuoted = |
21 FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\""); | 21 FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\""); |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 351 } |
352 #endif | 352 #endif |
353 | 353 |
354 // Calling Init multiple times should not modify the previous CommandLine. | 354 // Calling Init multiple times should not modify the previous CommandLine. |
355 TEST(CommandLineTest, Init) { | 355 TEST(CommandLineTest, Init) { |
356 CommandLine* initial = CommandLine::ForCurrentProcess(); | 356 CommandLine* initial = CommandLine::ForCurrentProcess(); |
357 EXPECT_FALSE(CommandLine::Init(0, NULL)); | 357 EXPECT_FALSE(CommandLine::Init(0, NULL)); |
358 CommandLine* current = CommandLine::ForCurrentProcess(); | 358 CommandLine* current = CommandLine::ForCurrentProcess(); |
359 EXPECT_EQ(initial, current); | 359 EXPECT_EQ(initial, current); |
360 } | 360 } |
OLD | NEW |