diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 18:03:34 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 18:03:34 +0000 |
commit | f96fe2c4946af3e6f51e07ea27bf25cef02b9426 (patch) | |
tree | 94a3365c927aa6e81408c9f855763b93ef4bd970 /base/command_line_unittest.cc | |
parent | 04eb2a4471cd1bcfbedd711360d5eaa1dc0d2bdf (diff) | |
download | chromium_src-f96fe2c4946af3e6f51e07ea27bf25cef02b9426.zip chromium_src-f96fe2c4946af3e6f51e07ea27bf25cef02b9426.tar.gz chromium_src-f96fe2c4946af3e6f51e07ea27bf25cef02b9426.tar.bz2 |
Base: Don't delete the previous command line when calling
CommandLine::Init()
In the multi-DLL build, we can end up initializing the object
twice at startup (once in chrome.exe and once in chrome.dll).
It should be harmless.
BUG=76996
TEST=base_unittests
Review URL: http://codereview.chromium.org/7273053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/command_line_unittest.cc')
-rw-r--r-- | base/command_line_unittest.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/base/command_line_unittest.cc b/base/command_line_unittest.cc index a8d1eed..c2bfd11 100644 --- a/base/command_line_unittest.cc +++ b/base/command_line_unittest.cc @@ -284,3 +284,11 @@ TEST(CommandLineTest, ProgramQuotes) { EXPECT_EQ('"', cmd_string[program_string.length() + 1]); } #endif + +// Calling Init multiple times should not modify the previous CommandLine. +TEST(CommandLineTest, Init) { + CommandLine* initial = CommandLine::ForCurrentProcess(); + CommandLine::Init(0, NULL); + CommandLine* current = CommandLine::ForCurrentProcess(); + EXPECT_EQ(initial, current); +} |