Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: chrome/installer/setup/install_worker_unittest.cc

Issue 7976045: Fix in-use updates for Chrome Frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed line widths Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/installer/setup/install_worker.h" 5 #include "chrome/installer/setup/install_worker.h"
6 6
7 #include "base/test/test_reg_util_win.h"
7 #include "base/win/registry.h" 8 #include "base/win/registry.h"
8 #include "base/version.h" 9 #include "base/version.h"
9 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
10 #include "chrome/installer/util/delete_reg_key_work_item.h" 11 #include "chrome/installer/util/delete_reg_key_work_item.h"
11 #include "chrome/installer/util/create_reg_key_work_item.h" 12 #include "chrome/installer/util/create_reg_key_work_item.h"
12 #include "chrome/installer/util/helper.h" 13 #include "chrome/installer/util/helper.h"
13 #include "chrome/installer/util/google_update_constants.h" 14 #include "chrome/installer/util/google_update_constants.h"
14 #include "chrome/installer/util/installation_state.h" 15 #include "chrome/installer/util/installation_state.h"
16 #include "chrome/installer/util/installation_validation_helper.h"
15 #include "chrome/installer/util/installer_state.h" 17 #include "chrome/installer/util/installer_state.h"
16 #include "chrome/installer/util/set_reg_value_work_item.h" 18 #include "chrome/installer/util/set_reg_value_work_item.h"
17 #include "chrome/installer/util/util_constants.h" 19 #include "chrome/installer/util/util_constants.h"
18 #include "chrome/installer/util/work_item_list.h" 20 #include "chrome/installer/util/work_item_list.h"
19 21
20 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
21 #include "testing/gmock/include/gmock/gmock.h" 23 #include "testing/gmock/include/gmock/gmock.h"
22 24
25 using base::win::RegKey;
23 using installer::InstallationState; 26 using installer::InstallationState;
24 using installer::InstallerState; 27 using installer::InstallerState;
25 using installer::Product; 28 using installer::Product;
26 using installer::ProductState; 29 using installer::ProductState;
27 30
28 using ::testing::_; 31 using ::testing::_;
29 using ::testing::AtLeast; 32 using ::testing::AtLeast;
33 using ::testing::AtMost;
34 using ::testing::Bool;
35 using ::testing::Combine;
30 using ::testing::HasSubstr; 36 using ::testing::HasSubstr;
31 using ::testing::AtMost;
32 using ::testing::Eq; 37 using ::testing::Eq;
33 using ::testing::Return; 38 using ::testing::Return;
34 using ::testing::StrCaseEq; 39 using ::testing::StrCaseEq;
35 using ::testing::StrEq; 40 using ::testing::StrEq;
36 using ::testing::StrictMock; 41 using ::testing::StrictMock;
42 using ::testing::Values;
37 43
38 // Mock classes to help with testing 44 // Mock classes to help with testing
39 //------------------------------------------------------------------------------ 45 //------------------------------------------------------------------------------
40 46
41 class MockWorkItemList : public WorkItemList { 47 class MockWorkItemList : public WorkItemList {
42 public: 48 public:
43 MockWorkItemList() {} 49 MockWorkItemList() {}
44 50
51 MOCK_METHOD3(AddCopyRegKeyWorkItem, WorkItem* (HKEY,
52 const std::wstring&,
53 const std::wstring&));
45 MOCK_METHOD5(AddCopyTreeWorkItem, WorkItem*(const std::wstring&, 54 MOCK_METHOD5(AddCopyTreeWorkItem, WorkItem*(const std::wstring&,
46 const std::wstring&, 55 const std::wstring&,
47 const std::wstring&, 56 const std::wstring&,
48 CopyOverWriteOption, 57 CopyOverWriteOption,
49 const std::wstring&)); 58 const std::wstring&));
50 MOCK_METHOD1(AddCreateDirWorkItem, WorkItem* (const FilePath&)); 59 MOCK_METHOD1(AddCreateDirWorkItem, WorkItem* (const FilePath&));
51 MOCK_METHOD2(AddCreateRegKeyWorkItem, WorkItem* (HKEY, const std::wstring&)); 60 MOCK_METHOD2(AddCreateRegKeyWorkItem, WorkItem* (HKEY, const std::wstring&));
52 MOCK_METHOD2(AddDeleteRegKeyWorkItem, WorkItem* (HKEY, const std::wstring&)); 61 MOCK_METHOD2(AddDeleteRegKeyWorkItem, WorkItem* (HKEY, const std::wstring&));
53 MOCK_METHOD3(AddDeleteRegValueWorkItem, WorkItem* (HKEY, 62 MOCK_METHOD3(AddDeleteRegValueWorkItem, WorkItem* (HKEY,
54 const std::wstring&, 63 const std::wstring&,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 installation_path_ = FilePath(L"C:\\Program Files\\Google\\Chrome\\"); 178 installation_path_ = FilePath(L"C:\\Program Files\\Google\\Chrome\\");
170 src_path_ = 179 src_path_ =
171 FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123\\source\\Chrome-bin"); 180 FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123\\source\\Chrome-bin");
172 setup_path_ = FilePath(L"C:\\UnlikelyPath\\Temp\\CR_123.tmp\\setup.exe"); 181 setup_path_ = FilePath(L"C:\\UnlikelyPath\\Temp\\CR_123.tmp\\setup.exe");
173 temp_dir_ = FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123"); 182 temp_dir_ = FilePath(L"C:\\UnlikelyPath\\Temp\\chrome_123");
174 } 183 }
175 184
176 virtual void TearDown() { 185 virtual void TearDown() {
177 } 186 }
178 187
188 void MaybeAddBinariesToInstallationState(
189 bool system_level,
190 MockInstallationState* installation_state) {
191 if (installation_state->GetProductState(
192 system_level, BrowserDistribution::CHROME_BINARIES) == NULL) {
193 MockProductState product_state;
194 product_state.set_version(current_version_->Clone());
195 installation_state->SetProductState(system_level,
196 BrowserDistribution::CHROME_BINARIES,
197 product_state);
198 }
199 }
200
179 void AddChromeToInstallationState( 201 void AddChromeToInstallationState(
180 bool system_level, 202 bool system_level,
181 bool multi_install, 203 bool multi_install,
182 bool with_chrome_frame_ready_mode, 204 bool with_chrome_frame_ready_mode,
183 MockInstallationState* installation_state) { 205 MockInstallationState* installation_state) {
206 if (multi_install)
207 MaybeAddBinariesToInstallationState(system_level, installation_state);
184 MockProductState product_state; 208 MockProductState product_state;
185 product_state.set_version(current_version_->Clone()); 209 product_state.set_version(current_version_->Clone());
186 product_state.set_multi_install(multi_install); 210 product_state.set_multi_install(multi_install);
187 product_state.set_brand(L"TEST"); 211 product_state.set_brand(L"TEST");
188 product_state.set_eula_accepted(1); 212 product_state.set_eula_accepted(1);
189 BrowserDistribution* dist = 213 BrowserDistribution* dist =
190 BrowserDistribution::GetSpecificDistribution( 214 BrowserDistribution::GetSpecificDistribution(
191 BrowserDistribution::CHROME_BROWSER); 215 BrowserDistribution::CHROME_BROWSER);
192 FilePath install_path = 216 FilePath install_path =
193 installer::GetChromeInstallPath(system_level, dist); 217 installer::GetChromeInstallPath(system_level, dist);
194 product_state.SetUninstallProgram( 218 product_state.SetUninstallProgram(
195 install_path.Append(installer::kSetupExe)); 219 install_path.AppendASCII(current_version_->GetString())
220 .Append(installer::kInstallerDir)
221 .Append(installer::kSetupExe));
196 product_state.AddUninstallSwitch(installer::switches::kUninstall); 222 product_state.AddUninstallSwitch(installer::switches::kUninstall);
197 if (system_level) 223 if (system_level)
198 product_state.AddUninstallSwitch(installer::switches::kSystemLevel); 224 product_state.AddUninstallSwitch(installer::switches::kSystemLevel);
199 if (multi_install) { 225 if (multi_install) {
200 product_state.AddUninstallSwitch(installer::switches::kMultiInstall); 226 product_state.AddUninstallSwitch(installer::switches::kMultiInstall);
201 product_state.AddUninstallSwitch(installer::switches::kChrome); 227 product_state.AddUninstallSwitch(installer::switches::kChrome);
202 if (with_chrome_frame_ready_mode) { 228 if (with_chrome_frame_ready_mode) {
203 product_state.AddUninstallSwitch(installer::switches::kChromeFrame); 229 product_state.AddUninstallSwitch(installer::switches::kChromeFrame);
204 product_state.AddUninstallSwitch( 230 product_state.AddUninstallSwitch(
205 installer::switches::kChromeFrameReadyMode); 231 installer::switches::kChromeFrameReadyMode);
206 } 232 }
207 } 233 }
208 234
209 installation_state->SetProductState(system_level, 235 installation_state->SetProductState(system_level,
210 BrowserDistribution::CHROME_BROWSER, 236 BrowserDistribution::CHROME_BROWSER,
211 product_state); 237 product_state);
212 } 238 }
213 239
214 void AddChromeFrameToInstallationState( 240 void AddChromeFrameToInstallationState(
215 bool system_level, 241 bool system_level,
216 bool multi_install, 242 bool multi_install,
217 bool ready_mode, 243 bool ready_mode,
218 MockInstallationState* installation_state) { 244 MockInstallationState* installation_state) {
245 if (multi_install)
246 MaybeAddBinariesToInstallationState(system_level, installation_state);
219 MockProductState product_state; 247 MockProductState product_state;
220 product_state.set_version(current_version_->Clone()); 248 product_state.set_version(current_version_->Clone());
221 product_state.set_multi_install(multi_install); 249 product_state.set_multi_install(multi_install);
222 BrowserDistribution* dist = 250 BrowserDistribution* dist =
223 BrowserDistribution::GetSpecificDistribution( 251 BrowserDistribution::GetSpecificDistribution(
224 multi_install ? BrowserDistribution::CHROME_BINARIES : 252 multi_install ? BrowserDistribution::CHROME_BINARIES :
225 BrowserDistribution::CHROME_FRAME); 253 BrowserDistribution::CHROME_FRAME);
226 FilePath install_path = 254 FilePath install_path =
227 installer::GetChromeInstallPath(system_level, dist); 255 installer::GetChromeInstallPath(system_level, dist);
228 product_state.SetUninstallProgram( 256 product_state.SetUninstallProgram(
229 install_path.Append(installer::kSetupExe)); 257 install_path.AppendASCII(current_version_->GetString())
258 .Append(installer::kInstallerDir)
259 .Append(installer::kSetupExe));
230 product_state.AddUninstallSwitch(installer::switches::kUninstall); 260 product_state.AddUninstallSwitch(installer::switches::kUninstall);
231 product_state.AddUninstallSwitch(installer::switches::kChromeFrame); 261 product_state.AddUninstallSwitch(installer::switches::kChromeFrame);
232 if (system_level) 262 if (system_level)
233 product_state.AddUninstallSwitch(installer::switches::kSystemLevel); 263 product_state.AddUninstallSwitch(installer::switches::kSystemLevel);
234 if (multi_install) { 264 if (multi_install) {
235 product_state.AddUninstallSwitch(installer::switches::kMultiInstall); 265 product_state.AddUninstallSwitch(installer::switches::kMultiInstall);
236 if (ready_mode) { 266 if (ready_mode) {
237 product_state.AddUninstallSwitch( 267 product_state.AddUninstallSwitch(
238 installer::switches::kChromeFrameReadyMode); 268 installer::switches::kChromeFrameReadyMode);
239 } 269 }
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 *new_version_.get(), 416 *new_version_.get(),
387 &current_version_, 417 &current_version_,
388 &work_item_list); 418 &work_item_list);
389 } 419 }
390 420
391 namespace { 421 namespace {
392 422
393 const wchar_t elevation_key[] = 423 const wchar_t elevation_key[] =
394 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\" 424 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"
395 L"{E0A900DF-9611-4446-86BD-4B1D47E7DB2A}"; 425 L"{E0A900DF-9611-4446-86BD-4B1D47E7DB2A}";
396 const wchar_t dragdrop_key[] = 426 const wchar_t old_elevation_key[] =
397 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\DragDrop\\" 427 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"
398 L"{E0A900DF-9611-4446-86BD-4B1D47E7DB2A}"; 428 L"{6C288DD7-76FB-4721-B628-56FAC252E199}";
429
430 enum ProductBits {
431 CHROME_PB = 1 << 0,
432 CHROME_FRAME_PB = 1 << 1,
433 CHROME_AND_CHROME_FRAME_PB = CHROME_PB | CHROME_FRAME_PB,
434 };
399 435
400 } // namespace 436 } // namespace
401 437
402 TEST_F(InstallWorkerTest, ElevationPolicyWorkItems) { 438 // A test class for worker functions that manipulate the old IE low rights
403 const bool system_level = true; 439 // policies.
404 const HKEY root = HKEY_LOCAL_MACHINE; 440 // Parameters:
405 const bool multi_install = true; 441 // bool : system_level_
406 MockWorkItemList work_item_list; 442 // bool : multi_install_
443 // ProductBits : installed_products_
444 // bool : old_value_exists_
445 class OldIELowRightsTests : public InstallWorkerTest,
446 public ::testing::WithParamInterface<
447 std::tr1::tuple<bool, bool, ProductBits, bool> > {
448 protected:
449 virtual void SetUp() OVERRIDE {
450 InstallWorkerTest::SetUp();
407 451
408 scoped_ptr<MockInstallationState> installation_state( 452 const ParamType& param = GetParam();
409 BuildChromeInstallationState(system_level, multi_install)); 453 system_level_ = std::tr1::get<0>(param);
454 multi_install_ = std::tr1::get<1>(param);
455 installed_products_ = std::tr1::get<2>(param);
456 old_value_exists_ = std::tr1::get<3>(param);
457 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
410 458
411 scoped_ptr<MockInstallerState> installer_state( 459 registry_overrides_.OverrideRegistry(root_key_, L"OldIELowRightsTests");
412 BuildChromeInstallerState(system_level, multi_install, 460 if (old_value_exists_) {
413 *installation_state, 461 // Write an "old" low rights elevation policy.
414 InstallerState::MULTI_INSTALL)); 462 RegKey key(root_key_, old_elevation_key, KEY_WRITE);
463 }
464 // For simplicity's sake, pretend that both products in single install is
465 // only Chrome. We'll test that codepath twice, but who cares.
466 if (!multi_install_ && installed_products_ == CHROME_AND_CHROME_FRAME_PB)
467 installed_products_ = CHROME_PB;
415 468
416 EXPECT_CALL(work_item_list, AddCreateRegKeyWorkItem(root, 469 installation_state_.reset(new MockInstallationState());
417 StrEq(elevation_key))).Times(1); 470 if (installed_products_ & CHROME_PB) {
471 AddChromeToInstallationState(system_level_, multi_install_, false,
472 installation_state_.get());
473 }
474 if (installed_products_ & CHROME_FRAME_PB) {
475 AddChromeFrameToInstallationState(system_level_, multi_install_, false,
476 installation_state_.get());
477 }
478 #if 0
479 // TODO(grt): beef up the state building in this test so we can validate it.
480 installer::ExpectInstallationOfTypeForState(
481 *installation_state_, system_level_, GetInstallationType());
482 #endif
483 installer_state_.reset(BuildBasicInstallerState(
484 system_level_, multi_install_, *installation_state_,
485 multi_install_ ? InstallerState::MULTI_UPDATE :
486 InstallerState::SINGLE_INSTALL_OR_UPDATE));
487 if (installed_products_ & CHROME_PB)
488 AddChromeToInstallerState(*installation_state_, installer_state_.get());
489 if (installed_products_ & CHROME_FRAME_PB) {
490 AddChromeFrameToInstallerState(*installation_state_, false,
491 installer_state_.get());
492 }
493 }
418 494
419 EXPECT_CALL(work_item_list, AddCreateRegKeyWorkItem(root, 495 installer::InstallationValidator::InstallationType GetInstallationType()
420 StrEq(dragdrop_key))).Times(1); 496 const {
497 using installer::InstallationValidator;
498 uint32 bits = 0;
499 if (installed_products_ & CHROME_PB) {
500 bits |= (multi_install_
501 ? InstallationValidator::ProductBits::CHROME_MULTI
502 : InstallationValidator::ProductBits::CHROME_SINGLE);
503 }
504 if (installed_products_ & CHROME_FRAME_PB) {
505 bits |= (multi_install_
506 ? InstallationValidator::ProductBits::CHROME_FRAME_MULTI
507 : InstallationValidator::ProductBits::CHROME_FRAME_SINGLE);
508 }
509 return static_cast<InstallationValidator::InstallationType>(bits);
510 }
421 511
422 EXPECT_CALL(work_item_list, AddSetRegDwordValueWorkItem(root, 512 registry_util::RegistryOverrideManager registry_overrides_;
423 StrEq(elevation_key), StrEq(L"Policy"), 3, _)).Times(1); 513 scoped_ptr<MockInstallationState> installation_state_;
514 scoped_ptr<MockInstallerState> installer_state_;
515 bool system_level_;
516 bool multi_install_;
517 bool old_value_exists_;
518 ProductBits installed_products_;
519 HKEY root_key_;
520 };
424 521
425 EXPECT_CALL(work_item_list, AddSetRegStringValueWorkItem(root, 522 TEST_P(OldIELowRightsTests, MaybeAddDeleteOldIELowRightsPolicyWorkItems) {
426 StrEq(elevation_key), StrEq(L"AppName"), 523 StrictMock<MockWorkItemList> work_item_list;
427 StrEq(installer::kChromeLauncherExe), _)).Times(1);
428 524
429 EXPECT_CALL(work_item_list, AddSetRegStringValueWorkItem(root, 525 // The old elevation policy key should only be deleted when Chrome Frame is
430 StrEq(elevation_key), StrEq(L"AppPath"), _, _)).Times(1); 526 // being operated on.
527 if (installed_products_ & CHROME_FRAME_PB) {
528 EXPECT_CALL(work_item_list,
529 AddDeleteRegKeyWorkItem(root_key_, StrEq(old_elevation_key)))
530 .Times(1);
531 }
431 532
432 EXPECT_CALL(work_item_list, AddSetRegDwordValueWorkItem(root, 533 MaybeAddDeleteOldIELowRightsPolicyWorkItems(*installer_state_.get(),
433 StrEq(dragdrop_key), StrEq(L"Policy"), 3, _)).Times(1); 534 &work_item_list);
434
435 EXPECT_CALL(work_item_list, AddSetRegStringValueWorkItem(root,
436 StrEq(dragdrop_key), StrEq(L"AppName"),
437 StrEq(chrome::kBrowserProcessExecutableName), _)).Times(1);
438
439 EXPECT_CALL(work_item_list, AddSetRegStringValueWorkItem(root,
440 StrEq(dragdrop_key), StrEq(L"AppPath"), _, _)).Times(1);
441
442 AddElevationPolicyWorkItems(*installation_state.get(),
443 *installer_state.get(),
444 *new_version_.get(),
445 &work_item_list);
446 } 535 }
447 536
448 TEST_F(InstallWorkerTest, ElevationPolicyUninstall) { 537 TEST_P(OldIELowRightsTests, MaybeAddCopyIELowRightsPolicyWorkItems) {
449 const bool system_level = true; 538 StrictMock<MockWorkItemList> work_item_list;
450 const HKEY root = HKEY_LOCAL_MACHINE;
451 const bool multi_install = true;
452 MockWorkItemList work_item_list;
453 539
454 scoped_ptr<MockInstallationState> installation_state( 540 // The old elevation policy key should only be copied when Chrome Frame is
455 BuildChromeInstallationState(system_level, multi_install)); 541 // being operated on and when there's no old value.
542 if ((installed_products_ & CHROME_FRAME_PB) && !old_value_exists_) {
543 EXPECT_CALL(work_item_list,
544 AddCopyRegKeyWorkItem(root_key_, StrEq(elevation_key),
545 StrEq(old_elevation_key)))
546 .Times(1);
547 }
456 548
457 scoped_ptr<MockInstallerState> installer_state( 549 MaybeAddCopyIELowRightsPolicyWorkItems(*installer_state_.get(),
458 BuildChromeInstallerState(system_level, multi_install, 550 &work_item_list);
459 *installation_state,
460 InstallerState::UNINSTALL));
461
462 EXPECT_CALL(work_item_list, AddDeleteRegKeyWorkItem(root,
463 StrEq(elevation_key))).Times(1);
464 EXPECT_CALL(work_item_list, AddDeleteRegKeyWorkItem(root,
465 StrEq(dragdrop_key))).Times(1);
466
467 AddElevationPolicyWorkItems(*installation_state.get(),
468 *installer_state.get(),
469 *new_version_.get(),
470 &work_item_list);
471 } 551 }
472 552
473 TEST_F(InstallWorkerTest, ElevationPolicySingleNoop) { 553 INSTANTIATE_TEST_CASE_P(
474 const bool system_level = true; 554 Variations,
475 const bool multi_install = false; // nothing should be done for single. 555 OldIELowRightsTests,
476 MockWorkItemList work_item_list; 556 Combine(Bool(), Bool(),
477 557 Values(CHROME_PB, CHROME_FRAME_PB, CHROME_AND_CHROME_FRAME_PB),
478 scoped_ptr<MockInstallationState> installation_state( 558 Bool()));
479 BuildChromeInstallationState(system_level, multi_install));
480
481 scoped_ptr<MockInstallerState> installer_state(
482 BuildChromeInstallerState(system_level, multi_install,
483 *installation_state,
484 InstallerState::UNINSTALL));
485
486 EXPECT_CALL(work_item_list, AddDeleteRegKeyWorkItem(_, _)).Times(0);
487 EXPECT_CALL(work_item_list, AddCreateRegKeyWorkItem(_, _)).Times(0);
488 EXPECT_CALL(work_item_list, AddSetRegDwordValueWorkItem(_, _, _, _, _))
489 .Times(0);
490 EXPECT_CALL(work_item_list, AddSetRegStringValueWorkItem(_, _, _, _, _))
491 .Times(0);
492
493 AddElevationPolicyWorkItems(*installation_state.get(),
494 *installer_state.get(),
495 *new_version_.get(),
496 &work_item_list);
497 }
498
499 TEST_F(InstallWorkerTest, ElevationPolicyExistingSingleCFNoop) {
500 const bool system_level = true;
501 const bool multi_install = true;
502 MockWorkItemList work_item_list;
503
504 scoped_ptr<MockInstallationState> installation_state(
505 BuildChromeInstallationState(system_level, multi_install));
506
507 MockProductState cf_state;
508 cf_state.set_version(current_version_->Clone());
509 cf_state.set_multi_install(false);
510
511 installation_state->SetProductState(system_level,
512 BrowserDistribution::CHROME_FRAME, cf_state);
513
514 scoped_ptr<MockInstallerState> installer_state(
515 BuildChromeInstallerState(system_level, multi_install,
516 *installation_state,
517 InstallerState::MULTI_INSTALL));
518
519 EXPECT_CALL(work_item_list, AddDeleteRegKeyWorkItem(_, _)).Times(0);
520 EXPECT_CALL(work_item_list, AddCreateRegKeyWorkItem(_, _)).Times(0);
521 EXPECT_CALL(work_item_list, AddSetRegDwordValueWorkItem(_, _, _, _, _))
522 .Times(0);
523 EXPECT_CALL(work_item_list, AddSetRegStringValueWorkItem(_, _, _, _, _))
524 .Times(0);
525
526 AddElevationPolicyWorkItems(*installation_state.get(),
527 *installer_state.get(),
528 *new_version_.get(),
529 &work_item_list);
530 }
531 559
532 TEST_F(InstallWorkerTest, GoogleUpdateWorkItemsTest) { 560 TEST_F(InstallWorkerTest, GoogleUpdateWorkItemsTest) {
533 const bool system_level = true; 561 const bool system_level = true;
534 const bool multi_install = true; 562 const bool multi_install = true;
535 MockWorkItemList work_item_list; 563 MockWorkItemList work_item_list;
536 564
537 scoped_ptr<MockInstallationState> installation_state( 565 scoped_ptr<MockInstallationState> installation_state(
538 BuildChromeInstallationState(system_level, multi_install)); 566 BuildChromeInstallationState(system_level, multi_install));
539 567
540 MockProductState cf_state; 568 MockProductState cf_state;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 machine_state_.get()); 913 machine_state_.get());
886 scoped_ptr<MockInstallerState> installer_state( 914 scoped_ptr<MockInstallerState> installer_state(
887 BuildBasicInstallerState(system_level_, true, *machine_state_, 915 BuildBasicInstallerState(system_level_, true, *machine_state_,
888 InstallerState::UNINSTALL)); 916 InstallerState::UNINSTALL));
889 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get()); 917 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get());
890 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 918 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_,
891 new_version_.get(), &work_item_list_); 919 new_version_.get(), &work_item_list_);
892 } 920 }
893 921
894 #endif // defined(GOOGLE_CHROME_BUILD) 922 #endif // defined(GOOGLE_CHROME_BUILD)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698