| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/mini_installer_test/chrome_mini_installer.h" | 5 #include "chrome/test/mini_installer_test/chrome_mini_installer.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| 11 #include "base/process_util.h" | 11 #include "base/process_util.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/stringprintf.h" |
| 14 #include "base/threading/platform_thread.h" | 15 #include "base/threading/platform_thread.h" |
| 15 #include "base/win/registry.h" | 16 #include "base/win/registry.h" |
| 16 #include "chrome/installer/util/browser_distribution.h" | 17 #include "chrome/installer/util/browser_distribution.h" |
| 17 #include "chrome/installer/util/google_update_constants.h" | 18 #include "chrome/installer/util/google_update_constants.h" |
| 18 #include "chrome/installer/util/installation_validation_helper.h" | 19 #include "chrome/installer/util/installation_validation_helper.h" |
| 19 #include "chrome/test/mini_installer_test/mini_installer_test_constants.h" | 20 #include "chrome/test/mini_installer_test/mini_installer_test_constants.h" |
| 20 #include "chrome/test/mini_installer_test/mini_installer_test_util.h" | 21 #include "chrome/test/mini_installer_test/mini_installer_test_util.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 23 |
| 23 using base::win::RegKey; | 24 using base::win::RegKey; |
| 24 | 25 |
| 25 ChromeMiniInstaller::ChromeMiniInstaller(const std::wstring& install_type, | 26 ChromeMiniInstaller::ChromeMiniInstaller(const std::wstring& install_type, |
| 26 bool is_chrome_frame) | 27 bool is_chrome_frame) |
| 27 : is_chrome_frame_(is_chrome_frame), | 28 : is_chrome_frame_(is_chrome_frame), |
| 28 install_type_(install_type), | 29 install_type_(install_type), |
| 29 has_diff_installer_(false), | 30 has_diff_installer_(false), |
| 30 has_full_installer_(false), | 31 has_full_installer_(false), |
| 31 has_prev_installer_(false) { | 32 has_prev_installer_(false) { |
| 32 installer_name_ = StringPrintf(L"%ls (%ls)", | 33 installer_name_ = base::StringPrintf(L"%ls (%ls)", |
| 33 mini_installer_constants::kChromeBuildType, install_type_.c_str()); | 34 mini_installer_constants::kChromeBuildType, install_type_.c_str()); |
| 34 } | 35 } |
| 35 | 36 |
| 36 void ChromeMiniInstaller::SetBuildUnderTest(const std::wstring& build) { | 37 void ChromeMiniInstaller::SetBuildUnderTest(const std::wstring& build) { |
| 37 // Locate the full, diff, and previous installers. | 38 // Locate the full, diff, and previous installers. |
| 38 const wchar_t * build_prefix; | 39 const wchar_t * build_prefix; |
| 39 if (LowerCaseEqualsASCII(build, "dev")) | 40 if (LowerCaseEqualsASCII(build, "dev")) |
| 40 build_prefix = mini_installer_constants::kDevChannelBuild; | 41 build_prefix = mini_installer_constants::kDevChannelBuild; |
| 41 else if (LowerCaseEqualsASCII(build, "stable")) | 42 else if (LowerCaseEqualsASCII(build, "stable")) |
| 42 build_prefix = mini_installer_constants::kStableChannelBuild; | 43 build_prefix = mini_installer_constants::kStableChannelBuild; |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 // This method will verify if the installed build is correct. | 735 // This method will verify if the installed build is correct. |
| 735 bool ChromeMiniInstaller::VerifyStandaloneInstall() { | 736 bool ChromeMiniInstaller::VerifyStandaloneInstall() { |
| 736 std::wstring reg_key_value_returned, standalone_installer_version; | 737 std::wstring reg_key_value_returned, standalone_installer_version; |
| 737 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); | 738 MiniInstallerTestUtil::GetStandaloneVersion(&standalone_installer_version); |
| 738 GetChromeVersionFromRegistry(®_key_value_returned); | 739 GetChromeVersionFromRegistry(®_key_value_returned); |
| 739 if (standalone_installer_version.compare(reg_key_value_returned) == 0) | 740 if (standalone_installer_version.compare(reg_key_value_returned) == 0) |
| 740 return true; | 741 return true; |
| 741 else | 742 else |
| 742 return false; | 743 return false; |
| 743 } | 744 } |
| OLD | NEW |