diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 20:23:06 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 20:23:06 +0000 |
commit | 65d2159a91dc129beef49c2c3424eabccbf75488 (patch) | |
tree | c274c3be12432afb4e80fd3aba94d942177ac546 /chrome_frame | |
parent | 0f0063c5ad21e49b89e72b41b72c9de3a4cc0d4c (diff) | |
download | chromium_src-65d2159a91dc129beef49c2c3424eabccbf75488.zip chromium_src-65d2159a91dc129beef49c2c3424eabccbf75488.tar.gz chromium_src-65d2159a91dc129beef49c2c3424eabccbf75488.tar.bz2 |
Fix a crash in the chrome frame relaibility test suite which occurs while accessing a deleted
CommandLine object. The test suite on startup initializes the command line. It then initializes
the gtest TestSuite class which also initializes a new instance of the CommandLine object. This
ends up deleting the CommandLine instance initialized before leading to a crash when this is
accessed.
Fix is to remove the CommandLine initialization code from the test suite.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=77984
BUG=77984
TEST=ChromeFrame relaibility tests should now run correctly.
TBR=amit
Review URL: http://codereview.chromium.org/6781002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/reliability/run_all_unittests.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome_frame/test/reliability/run_all_unittests.cc b/chrome_frame/test/reliability/run_all_unittests.cc index d5b42da..418caee 100644 --- a/chrome_frame/test/reliability/run_all_unittests.cc +++ b/chrome_frame/test/reliability/run_all_unittests.cc @@ -13,13 +13,6 @@ static const char kRegisterDllFlag[] = "register"; int main(int argc, char **argv) { - - // If --register is passed, then we need to ensure that Chrome Frame is - // registered before starting up the reliability tests. - CommandLine::Init(argc, argv); - CommandLine* cmd_line = CommandLine::ForCurrentProcess(); - DCHECK(cmd_line); - // We create this slightly early as it is the one who instantiates THE // AtExitManager which some of the other stuff below relies on. ReliabilityTestSuite test_suite(argc, argv); @@ -28,6 +21,14 @@ int main(int argc, char **argv) { base::ProcessHandle crash_service = chrome_frame_test::StartCrashService(); int result = -1; + // If --register is passed, then we need to ensure that Chrome Frame is + // registered before starting up the reliability tests. + CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + DCHECK(cmd_line); + if (!cmd_line) { + NOTREACHED() << "CommandLine object not initialized"; + return result; + } if (cmd_line->HasSwitch(kRegisterDllFlag)) { std::wstring dll_path = cmd_line->GetSwitchValueNative(kRegisterDllFlag); |