OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/installer/setup/install_worker.h" | 5 #include "chrome/installer/setup/install_worker.h" |
6 | 6 |
7 #include "base/win/registry.h" | 7 #include "base/win/registry.h" |
8 #include "base/version.h" | 8 #include "base/version.h" |
9 #include "chrome/common/chrome_constants.h" | 9 #include "chrome/common/chrome_constants.h" |
10 #include "chrome/installer/setup/setup_util.h" | 10 #include "chrome/installer/setup/setup_util.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 void set_package_type(PackageType type) { | 159 void set_package_type(PackageType type) { |
160 InstallerState::set_package_type(type); | 160 InstallerState::set_package_type(type); |
161 } | 161 } |
162 }; | 162 }; |
163 | 163 |
164 // The test fixture | 164 // The test fixture |
165 //------------------------------------------------------------------------------ | 165 //------------------------------------------------------------------------------ |
166 | 166 |
167 class InstallWorkerTest : public testing::Test { | 167 class InstallWorkerTest : public testing::Test { |
168 public: | 168 public: |
169 virtual void SetUp() { | 169 void SetUp() override { |
170 current_version_.reset(new Version("1.0.0.0")); | 170 current_version_.reset(new Version("1.0.0.0")); |
171 new_version_.reset(new Version("42.0.0.0")); | 171 new_version_.reset(new Version("42.0.0.0")); |
172 | 172 |
173 // Don't bother ensuring that these paths exist. Since we're just | 173 // Don't bother ensuring that these paths exist. Since we're just |
174 // building the work item lists and not running them, they shouldn't | 174 // building the work item lists and not running them, they shouldn't |
175 // actually be touched. | 175 // actually be touched. |
176 archive_path_ = | 176 archive_path_ = |
177 base::FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123\\chrome.7z"); | 177 base::FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123\\chrome.7z"); |
178 // TODO(robertshield): Take this from the BrowserDistribution once that | 178 // TODO(robertshield): Take this from the BrowserDistribution once that |
179 // no longer depends on MasterPreferences. | 179 // no longer depends on MasterPreferences. |
180 installation_path_ = | 180 installation_path_ = |
181 base::FilePath(L"C:\\Program Files\\Google\\Chrome\\"); | 181 base::FilePath(L"C:\\Program Files\\Google\\Chrome\\"); |
182 src_path_ = base::FilePath( | 182 src_path_ = base::FilePath( |
183 L"C:\\UnlikelyPath\\Temp\\chrome_123\\source\\Chrome-bin"); | 183 L"C:\\UnlikelyPath\\Temp\\chrome_123\\source\\Chrome-bin"); |
184 setup_path_ = base::FilePath( | 184 setup_path_ = base::FilePath( |
185 L"C:\\UnlikelyPath\\Temp\\CR_123.tmp\\setup.exe"); | 185 L"C:\\UnlikelyPath\\Temp\\CR_123.tmp\\setup.exe"); |
186 temp_dir_ = base::FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123"); | 186 temp_dir_ = base::FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123"); |
187 } | 187 } |
188 | 188 |
189 virtual void TearDown() { | 189 void TearDown() override {} |
190 } | |
191 | 190 |
192 void MaybeAddBinariesToInstallationState( | 191 void MaybeAddBinariesToInstallationState( |
193 bool system_level, | 192 bool system_level, |
194 MockInstallationState* installation_state) { | 193 MockInstallationState* installation_state) { |
195 if (installation_state->GetProductState( | 194 if (installation_state->GetProductState( |
196 system_level, BrowserDistribution::CHROME_BINARIES) == NULL) { | 195 system_level, BrowserDistribution::CHROME_BINARIES) == NULL) { |
197 MockProductState product_state; | 196 MockProductState product_state; |
198 product_state.set_version(new Version(*current_version_)); | 197 product_state.set_version(new Version(*current_version_)); |
199 product_state.set_brand(L"TEST"); | 198 product_state.set_brand(L"TEST"); |
200 product_state.set_multi_install(true); | 199 product_state.set_multi_install(true); |
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 prod_type_list[i_type_check]); | 797 prod_type_list[i_type_check]); |
799 bool prod_expect = (mach_after & (1 << i_type_check)) != 0; | 798 bool prod_expect = (mach_after & (1 << i_type_check)) != 0; |
800 EXPECT_EQ(prod_expect, prod_res); | 799 EXPECT_EQ(prod_expect, prod_res); |
801 } | 800 } |
802 } | 801 } |
803 } | 802 } |
804 } | 803 } |
805 } | 804 } |
806 | 805 |
807 #endif // defined(GOOGLE_CHROME_BUILD) | 806 #endif // defined(GOOGLE_CHROME_BUILD) |
OLD | NEW |