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

Issue 4949004: Add a unit test for CommandLine that makes sure that GetProgram will not retu... (Closed)

Created:
10 years, 1 month ago by tommi (sloooow) - chröme
Modified:
9 years, 7 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Add a unit test for CommandLine that makes sure that GetProgram will not return a quoted string and that (on Windows) the program part of a command line string will always be quoted. BUG=none TEST=Run the ProgramQuotes test. Should be no visible changes. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67583

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Total comments: 1

Patch Set 3 : '' #

Total comments: 2

Patch Set 4 : '' #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -0 lines) Patch
M base/command_line_unittest.cc View 1 2 3 1 chunk +19 lines, -0 lines 2 comments Download

Messages

Total messages: 15 (0 generated)
tommi (sloooow) - chröme
10 years, 1 month ago (2010-11-15 20:50:57 UTC) #1
Evan Martin
http://codereview.chromium.org/4949004/diff/1/base/command_line.cc File base/command_line.cc (right): http://codereview.chromium.org/4949004/diff/1/base/command_line.cc#newcode128 base/command_line.cc:128: program_ = TrimQuotes(program.value()); I think this is wrong. A ...
10 years, 1 month ago (2010-11-15 21:01:08 UTC) #2
tommi (sloooow) - chröme
The intent is to make sure the CommandLine class always quotes the program part of ...
10 years, 1 month ago (2010-11-15 21:16:23 UTC) #3
Evan Martin
+FilePath master to back up my rationale If you're introducing this as a failsafe check, ...
10 years, 1 month ago (2010-11-15 21:46:36 UTC) #4
Mark Mentovai
I agree with Evan. The entirety of this change is Windows-specific. Please #if it accordingly. ...
10 years, 1 month ago (2010-11-15 22:01:22 UTC) #5
Mark Mentovai
I agree with Evan. The entirety of this change is Windows-specific. Please #if it accordingly.
10 years, 1 month ago (2010-11-15 22:03:11 UTC) #6
tommi (sloooow) - chröme
Thanks Mark and Evan. I changed it so that only Windows should be affected.
10 years, 1 month ago (2010-11-15 22:12:18 UTC) #7
Evan Martin
http://codereview.chromium.org/4949004/diff/13001/base/command_line.cc File base/command_line.cc (right): http://codereview.chromium.org/4949004/diff/13001/base/command_line.cc#newcode124 base/command_line.cc:124: program_ = TrimQuotes(program.value()); To be clear, if there are ...
10 years, 1 month ago (2010-11-15 22:21:57 UTC) #8
tommi (sloooow) - chröme
http://codereview.chromium.org/4949004/diff/13001/base/command_line.cc File base/command_line.cc (right): http://codereview.chromium.org/4949004/diff/13001/base/command_line.cc#newcode124 base/command_line.cc:124: program_ = TrimQuotes(program.value()); On 2010/11/15 22:21:57, Evan Martin wrote: ...
10 years, 1 month ago (2010-11-15 22:41:23 UTC) #9
tommi (sloooow) - chröme
(+robertshield for fyi) I'm also fine with reverting the change altogether or maybe just add ...
10 years, 1 month ago (2010-11-15 22:49:25 UTC) #10
Evan Martin
On 2010/11/15 22:41:23, tommi wrote: > > I guess you can also remove that TODO ...
10 years, 1 month ago (2010-11-15 22:50:12 UTC) #11
Evan Martin
Another idea: - check for quotes or trailing backslash - if so, NOTREACHED - and ...
10 years, 1 month ago (2010-11-15 22:52:32 UTC) #12
tommi (sloooow) - chröme
Hey Evan, I got distracted by a few other things in the last couple of ...
10 years ago (2010-11-29 20:36:21 UTC) #13
Evan Martin
LGTM http://codereview.chromium.org/4949004/diff/23001/base/command_line_unittest.cc File base/command_line_unittest.cc (right): http://codereview.chromium.org/4949004/diff/23001/base/command_line_unittest.cc#newcode187 base/command_line_unittest.cc:187: const FilePath kProgram(FILE_PATH_LITERAL("Program")); Since you're in a Windows-specific ...
10 years ago (2010-11-29 20:39:55 UTC) #14
tommi (sloooow) - chröme
10 years ago (2010-11-29 20:45:01 UTC) #15
Thanks.

http://codereview.chromium.org/4949004/diff/23001/base/command_line_unittest.cc
File base/command_line_unittest.cc (right):

http://codereview.chromium.org/4949004/diff/23001/base/command_line_unittest....
base/command_line_unittest.cc:187: const FilePath
kProgram(FILE_PATH_LITERAL("Program"));
On 2010/11/29 20:39:55, Evan Martin wrote:
> Since you're in a Windows-specific branch, L"Program" is also acceptable and
> perhaps more readable. 

Done.

Powered by Google App Engine
This is Rietveld 408576698