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

Side by Side Diff: base/command_line_unittest.cc

Issue 12286020: Replace FilePath with base::FilePath. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | « no previous file | base/file_path_unittest.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/file_path.h" 10 #include "base/file_path.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/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;
15
14 // 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
15 // and quotes. 17 // and quotes.
16 // Consider the command-line argument: q\"bs1\bs2\\bs3q\\\" 18 // Consider the command-line argument: q\"bs1\bs2\\bs3q\\\"
17 // Here it is with C-style escapes. 19 // Here it is with C-style escapes.
18 static const CommandLine::StringType kTrickyQuoted = 20 static const CommandLine::StringType kTrickyQuoted =
19 FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\""); 21 FILE_PATH_LITERAL("q\\\"bs1\\bs2\\\\bs3q\\\\\\\"");
20 // It should be parsed by Windows as: q"bs1\bs2\\bs3q\" 22 // It should be parsed by Windows as: q"bs1\bs2\\bs3q\"
21 // Here that is with C-style escapes. 23 // Here that is with C-style escapes.
22 static const CommandLine::StringType kTricky = 24 static const CommandLine::StringType kTricky =
23 FILE_PATH_LITERAL("q\"bs1\\bs2\\\\bs3q\\\""); 25 FILE_PATH_LITERAL("q\"bs1\\bs2\\\\bs3q\\\"");
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 } 351 }
350 #endif 352 #endif
351 353
352 // Calling Init multiple times should not modify the previous CommandLine. 354 // Calling Init multiple times should not modify the previous CommandLine.
353 TEST(CommandLineTest, Init) { 355 TEST(CommandLineTest, Init) {
354 CommandLine* initial = CommandLine::ForCurrentProcess(); 356 CommandLine* initial = CommandLine::ForCurrentProcess();
355 EXPECT_FALSE(CommandLine::Init(0, NULL)); 357 EXPECT_FALSE(CommandLine::Init(0, NULL));
356 CommandLine* current = CommandLine::ForCurrentProcess(); 358 CommandLine* current = CommandLine::ForCurrentProcess();
357 EXPECT_EQ(initial, current); 359 EXPECT_EQ(initial, current);
358 } 360 }
OLDNEW
« no previous file with comments | « no previous file | base/file_path_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698