| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/platform_thread.h" | 6 #include "base/platform_thread.h" |
| 7 #include "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
| 8 #include "base/win_util.h" | 8 #include "base/win_util.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/installer/util/install_util.h" | 10 #include "chrome/installer/util/install_util.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 userinstall.UnInstall(); | 46 userinstall.UnInstall(); |
| 47 ChromeMiniInstaller systeminstall(kSystemInstall, | 47 ChromeMiniInstaller systeminstall(kSystemInstall, |
| 48 cmd->HasSwitch(installer_util::switches::kChromeFrame)); | 48 cmd->HasSwitch(installer_util::switches::kChromeFrame)); |
| 49 systeminstall.UnInstall(); | 49 systeminstall.UnInstall(); |
| 50 } | 50 } |
| 51 } | 51 } |
| 52 | 52 |
| 53 virtual void SetUp() { | 53 virtual void SetUp() { |
| 54 // Parse test command-line arguments. | 54 // Parse test command-line arguments. |
| 55 const CommandLine* cmd = CommandLine::ForCurrentProcess(); | 55 const CommandLine* cmd = CommandLine::ForCurrentProcess(); |
| 56 std::wstring build = cmd->GetSwitchValue(switches::kInstallerTestBuild); | 56 std::wstring build = |
| 57 cmd->GetSwitchValueNative(switches::kInstallerTestBuild); |
| 57 if (build.empty()) | 58 if (build.empty()) |
| 58 build = L"latest"; | 59 build = L"latest"; |
| 59 force_tests_ = cmd->HasSwitch(switches::kInstallerTestForce); | 60 force_tests_ = cmd->HasSwitch(switches::kInstallerTestForce); |
| 60 chrome_frame_ = cmd->HasSwitch(installer_util::switches::kChromeFrame); | 61 chrome_frame_ = cmd->HasSwitch(installer_util::switches::kChromeFrame); |
| 61 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA || | 62 if (win_util::GetWinVersion() < win_util::WINVERSION_VISTA || |
| 62 force_tests_) { | 63 force_tests_) { |
| 63 CleanTheSystem(); | 64 CleanTheSystem(); |
| 64 // Separate the test output from cleaning output | 65 // Separate the test output from cleaning output |
| 65 printf("\nBEGIN test----------------------------------------\n"); | 66 printf("\nBEGIN test----------------------------------------\n"); |
| 66 | 67 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 TEST_F(MiniInstallTest, InstallMiniInstallerUser) { | 183 TEST_F(MiniInstallTest, InstallMiniInstallerUser) { |
| 183 if (!chrome_frame_) | 184 if (!chrome_frame_) |
| 184 user_inst_->Install(); | 185 user_inst_->Install(); |
| 185 } | 186 } |
| 186 | 187 |
| 187 TEST_F(MiniInstallTest, MiniInstallTestValidWindowsVersion) { | 188 TEST_F(MiniInstallTest, MiniInstallTestValidWindowsVersion) { |
| 188 // We run the tests on all supported OSes. | 189 // We run the tests on all supported OSes. |
| 189 // Make sure the code agrees. | 190 // Make sure the code agrees. |
| 190 EXPECT_TRUE(InstallUtil::IsOSSupported()); | 191 EXPECT_TRUE(InstallUtil::IsOSSupported()); |
| 191 } | 192 } |
| OLD | NEW |