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

Side by Side Diff: win8/delegate_execute/delegate_execute_util_unittest.cc

Issue 12163003: Add FilePath to base namespace. (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 | « win8/delegate_execute/delegate_execute_util.cc ('k') | win8/metro_driver/file_picker_ash.h » ('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 "win8/delegate_execute/delegate_execute_util.h" 5 #include "win8/delegate_execute/delegate_execute_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 18 matching lines...) Expand all
29 // Parameters with a switch are parsed properly. 29 // Parameters with a switch are parsed properly.
30 cl = delegate_execute::CommandLineFromParameters( 30 cl = delegate_execute::CommandLineFromParameters(
31 base::StringPrintf(L"--%ls", ASCIIToWide(kSomeSwitch).c_str()).c_str()); 31 base::StringPrintf(L"--%ls", ASCIIToWide(kSomeSwitch).c_str()).c_str());
32 EXPECT_EQ(std::wstring(), cl.GetProgram().value()); 32 EXPECT_EQ(std::wstring(), cl.GetProgram().value());
33 EXPECT_TRUE(cl.HasSwitch(kSomeSwitch)); 33 EXPECT_TRUE(cl.HasSwitch(kSomeSwitch));
34 } 34 }
35 35
36 TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) { 36 TEST(DelegateExecuteUtil, MakeChromeCommandLineTest) {
37 static const wchar_t kSomeArgument[] = L"http://some.url/"; 37 static const wchar_t kSomeArgument[] = L"http://some.url/";
38 static const wchar_t kOtherArgument[] = L"http://some.other.url/"; 38 static const wchar_t kOtherArgument[] = L"http://some.other.url/";
39 const FilePath this_exe(CommandLine::ForCurrentProcess()->GetProgram()); 39 const base::FilePath this_exe(CommandLine::ForCurrentProcess()->GetProgram());
40 40
41 CommandLine cl(CommandLine::NO_PROGRAM); 41 CommandLine cl(CommandLine::NO_PROGRAM);
42 42
43 // Empty params and argument contains only the exe. 43 // Empty params and argument contains only the exe.
44 cl = delegate_execute::MakeChromeCommandLine( 44 cl = delegate_execute::MakeChromeCommandLine(
45 this_exe, delegate_execute::CommandLineFromParameters(NULL), string16()); 45 this_exe, delegate_execute::CommandLineFromParameters(NULL), string16());
46 EXPECT_EQ(1, cl.argv().size()); 46 EXPECT_EQ(1, cl.argv().size());
47 EXPECT_EQ(this_exe.value(), cl.GetProgram().value()); 47 EXPECT_EQ(this_exe.value(), cl.GetProgram().value());
48 48
49 // Empty params with arg contains the arg. 49 // Empty params with arg contains the arg.
(...skipping 20 matching lines...) Expand all
70 std::find(args.begin(), args.end(), string16(kOtherArgument))); 70 std::find(args.begin(), args.end(), string16(kOtherArgument)));
71 EXPECT_NE(args.end(), 71 EXPECT_NE(args.end(),
72 std::find(args.begin(), args.end(), string16(kSomeArgument))); 72 std::find(args.begin(), args.end(), string16(kSomeArgument)));
73 } 73 }
74 74
75 TEST(DelegateExecuteUtil, ParametersFromSwitchTest) { 75 TEST(DelegateExecuteUtil, ParametersFromSwitchTest) {
76 EXPECT_EQ(string16(), delegate_execute::ParametersFromSwitch(NULL)); 76 EXPECT_EQ(string16(), delegate_execute::ParametersFromSwitch(NULL));
77 EXPECT_EQ(string16(L"--some-switch"), 77 EXPECT_EQ(string16(L"--some-switch"),
78 delegate_execute::ParametersFromSwitch(kSomeSwitch)); 78 delegate_execute::ParametersFromSwitch(kSomeSwitch));
79 } 79 }
OLDNEW
« no previous file with comments | « win8/delegate_execute/delegate_execute_util.cc ('k') | win8/metro_driver/file_picker_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698