Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: base/command_line_unittest.cc

Issue 102993018: Remove UTF string conversion functions from the global namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: aaaaaaaaaa Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/command_line.cc ('k') | base/i18n/file_util_icu.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 static const char kThirdArgName[] = "arg with space"; 191 static const char kThirdArgName[] = "arg with space";
192 static const char kFourthArgName[] = "nospace"; 192 static const char kFourthArgName[] = "nospace";
193 193
194 CommandLine cl(CommandLine::NO_PROGRAM); 194 CommandLine cl(CommandLine::NO_PROGRAM);
195 cl.AppendSwitchPath(kFirstArgName, FilePath(kPath1)); 195 cl.AppendSwitchPath(kFirstArgName, FilePath(kPath1));
196 cl.AppendSwitchPath(kSecondArgName, FilePath(kPath2)); 196 cl.AppendSwitchPath(kSecondArgName, FilePath(kPath2));
197 cl.AppendArg(kThirdArgName); 197 cl.AppendArg(kThirdArgName);
198 cl.AppendArg(kFourthArgName); 198 cl.AppendArg(kFourthArgName);
199 199
200 #if defined(OS_WIN) 200 #if defined(OS_WIN)
201 CommandLine::StringType expected_first_arg(UTF8ToUTF16(kFirstArgName)); 201 CommandLine::StringType expected_first_arg(
202 CommandLine::StringType expected_second_arg(UTF8ToUTF16(kSecondArgName)); 202 base::UTF8ToUTF16(kFirstArgName));
203 CommandLine::StringType expected_third_arg(UTF8ToUTF16(kThirdArgName)); 203 CommandLine::StringType expected_second_arg(
204 CommandLine::StringType expected_fourth_arg(UTF8ToUTF16(kFourthArgName)); 204 base::UTF8ToUTF16(kSecondArgName));
205 CommandLine::StringType expected_third_arg(
206 base::UTF8ToUTF16(kThirdArgName));
207 CommandLine::StringType expected_fourth_arg(
208 base::UTF8ToUTF16(kFourthArgName));
205 #elif defined(OS_POSIX) 209 #elif defined(OS_POSIX)
206 CommandLine::StringType expected_first_arg(kFirstArgName); 210 CommandLine::StringType expected_first_arg(kFirstArgName);
207 CommandLine::StringType expected_second_arg(kSecondArgName); 211 CommandLine::StringType expected_second_arg(kSecondArgName);
208 CommandLine::StringType expected_third_arg(kThirdArgName); 212 CommandLine::StringType expected_third_arg(kThirdArgName);
209 CommandLine::StringType expected_fourth_arg(kFourthArgName); 213 CommandLine::StringType expected_fourth_arg(kFourthArgName);
210 #endif 214 #endif
211 215
212 #if defined(OS_WIN) 216 #if defined(OS_WIN)
213 #define QUOTE_ON_WIN FILE_PATH_LITERAL("\"") 217 #define QUOTE_ON_WIN FILE_PATH_LITERAL("\"")
214 #else 218 #else
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 355 }
352 #endif 356 #endif
353 357
354 // Calling Init multiple times should not modify the previous CommandLine. 358 // Calling Init multiple times should not modify the previous CommandLine.
355 TEST(CommandLineTest, Init) { 359 TEST(CommandLineTest, Init) {
356 CommandLine* initial = CommandLine::ForCurrentProcess(); 360 CommandLine* initial = CommandLine::ForCurrentProcess();
357 EXPECT_FALSE(CommandLine::Init(0, NULL)); 361 EXPECT_FALSE(CommandLine::Init(0, NULL));
358 CommandLine* current = CommandLine::ForCurrentProcess(); 362 CommandLine* current = CommandLine::ForCurrentProcess();
359 EXPECT_EQ(initial, current); 363 EXPECT_EQ(initial, current);
360 } 364 }
OLDNEW
« no previous file with comments | « base/command_line.cc ('k') | base/i18n/file_util_icu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698