summaryrefslogtreecommitdiffstats
path: root/chrome/test/mini_installer_test/test.cc
diff options
context:
space:
mode:
authoranantha@chromium.org <anantha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 23:35:42 +0000
committeranantha@chromium.org <anantha@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 23:35:42 +0000
commit6b538469335c0805104dfcb0b8e120932813663e (patch)
treefa38b0140045679a8e9990f23047204f826e31fc /chrome/test/mini_installer_test/test.cc
parent3c59ef0629260028c98b9648ee7e6732b24018a0 (diff)
downloadchromium_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/test.cc')
-rw-r--r--chrome/test/mini_installer_test/test.cc22
1 files changed, 18 insertions, 4 deletions
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);