diff options
author | anantha@chromium.org <anantha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 23:35:42 +0000 |
---|---|---|
committer | anantha@chromium.org <anantha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-08 23:35:42 +0000 |
commit | 6b538469335c0805104dfcb0b8e120932813663e (patch) | |
tree | fa38b0140045679a8e9990f23047204f826e31fc /chrome/test/mini_installer_test | |
parent | 3c59ef0629260028c98b9648ee7e6732b24018a0 (diff) | |
download | chromium_src-6b538469335c0805104dfcb0b8e120932813663e.zip chromium_src-6b538469335c0805104dfcb0b8e120932813663e.tar.gz chromium_src-6b538469335c0805104dfcb0b8e120932813663e.tar.bz2 |
Added a command line parameter(-clean), which up on passing will uninstall current version of chrome on users machine. if the parameter is not passed then a message is displayed with usage details.
Also, standalone insatller test was looking for 1.0 to build the version number. Changed it to 2.0.
Review URL: http://codereview.chromium.org/119192
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17912 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/mini_installer_test')
-rw-r--r-- | chrome/test/mini_installer_test/chrome_mini_installer.cc | 2 | ||||
-rw-r--r-- | chrome/test/mini_installer_test/test.cc | 22 |
2 files changed, 19 insertions, 5 deletions
diff --git a/chrome/test/mini_installer_test/chrome_mini_installer.cc b/chrome/test/mini_installer_test/chrome_mini_installer.cc index 03ccbe0..769875b 100644 --- a/chrome/test/mini_installer_test/chrome_mini_installer.cc +++ b/chrome/test/mini_installer_test/chrome_mini_installer.cc @@ -578,7 +578,7 @@ bool ChromeMiniInstaller::GetStandaloneVersion(std::wstring* return_file_name) { file_name = file_name.substr(0, last_dot); std::wstring::size_type pos = file_name.find(L'_'); file_name.replace(pos, 1, L"."); - file_name = L"1.0." + file_name; + file_name = L"2.0." + file_name; return_file_name->assign(file_name.c_str()); printf("Standalone installer version is %ls\n", file_name.c_str()); return true; diff --git a/chrome/test/mini_installer_test/test.cc b/chrome/test/mini_installer_test/test.cc index fd14e88d0..09c7b66 100644 --- a/chrome/test/mini_installer_test/test.cc +++ b/chrome/test/mini_installer_test/test.cc @@ -1,6 +1,7 @@ // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "base/command_line.h" #include "base/platform_thread.h" #include "base/win_util.h" #include "chrome/installer/util/install_util.h" @@ -12,6 +13,20 @@ namespace { class MiniInstallTest : public testing::Test { protected: + void CheckArgs() { + // Check command line to decide if the tests should continue + // with cleaning the system. + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + if (command_line.HasSwitch(L"clean")) { + CleanTheSystem(); + } else { + printf("This test needs command line Arguments.\n"); + printf("Usage: mini_installer_tests.exe -clean\n"); + printf("Note: -clean arg will uninstall your chrome at all levels" + "and also delete profile.\n"); + exit(1); + } + } void CleanTheSystem() { ChromeMiniInstaller userinstall(mini_installer_constants::kUserInstall, mini_installer_constants::kDevChannelBuild); @@ -24,9 +39,8 @@ class MiniInstallTest : public testing::Test { } } virtual void SetUp() { - CleanTheSystem(); + CheckArgs(); } - virtual void TearDown() { PlatformThread::Sleep(2000); CleanTheSystem(); @@ -100,7 +114,7 @@ TEST_F(MiniInstallTest, DISABLED_MiniInstallerOverChromeMetaInstallerTest) { installer.OverInstall(); } -TEST_F(MiniInstallTest, DISABLED_MiniInstallerSystemInstallTest) { +TEST_F(MiniInstallTest, MiniInstallerSystemInstallTest) { if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { ChromeMiniInstaller installer(mini_installer_constants::kSystemInstall, mini_installer_constants::kDevChannelBuild); @@ -108,7 +122,7 @@ TEST_F(MiniInstallTest, DISABLED_MiniInstallerSystemInstallTest) { } } -TEST_F(MiniInstallTest, DISABLED_MiniInstallerUserInstallTest) { +TEST_F(MiniInstallTest, MiniInstallerUserInstallTest) { if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA) { ChromeMiniInstaller installer(mini_installer_constants::kUserInstall, mini_installer_constants::kDevChannelBuild); |