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" | |
9 #include "base/command_line.h" | 8 #include "base/command_line.h" |
10 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "build/build_config.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 | 15 |
15 namespace base { | 16 namespace base { |
16 | 17 |
17 // To test Windows quoting behavior, we use a string that has some backslashes | 18 // To test Windows quoting behavior, we use a string that has some backslashes |
18 // and quotes. | 19 // and quotes. |
19 // Consider the command-line argument: q\"bs1\bs2\\bs3q\\\" | 20 // Consider the command-line argument: q\"bs1\bs2\\bs3q\\\" |
20 // Here it is with C-style escapes. | 21 // Here it is with C-style escapes. |
21 static const CommandLine::StringType kTrickyQuoted = | 22 static const CommandLine::StringType kTrickyQuoted = |
22 FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\""); | 23 FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\""); |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 CommandLine assigned = *initial; | 398 CommandLine assigned = *initial; |
398 CommandLine::SwitchMap switch_map = initial->GetSwitches(); | 399 CommandLine::SwitchMap switch_map = initial->GetSwitches(); |
399 initial.reset(); | 400 initial.reset(); |
400 for (const auto& pair : switch_map) | 401 for (const auto& pair : switch_map) |
401 EXPECT_TRUE(copy_constructed.HasSwitch(pair.first)); | 402 EXPECT_TRUE(copy_constructed.HasSwitch(pair.first)); |
402 for (const auto& pair : switch_map) | 403 for (const auto& pair : switch_map) |
403 EXPECT_TRUE(assigned.HasSwitch(pair.first)); | 404 EXPECT_TRUE(assigned.HasSwitch(pair.first)); |
404 } | 405 } |
405 | 406 |
406 } // namespace base | 407 } // namespace base |
OLD | NEW |