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

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

Issue 10805043: (re-commit) Implement installation of the Chrome App Host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix setup_unittests Created 8 years, 5 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
« no previous file with comments | « chrome/installer/setup/install_worker.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/util/delete_reg_key_work_item.h" 10 #include "chrome/installer/util/delete_reg_key_work_item.h"
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 virtual void TearDown() { 184 virtual void TearDown() {
185 } 185 }
186 186
187 void MaybeAddBinariesToInstallationState( 187 void MaybeAddBinariesToInstallationState(
188 bool system_level, 188 bool system_level,
189 MockInstallationState* installation_state) { 189 MockInstallationState* installation_state) {
190 if (installation_state->GetProductState( 190 if (installation_state->GetProductState(
191 system_level, BrowserDistribution::CHROME_BINARIES) == NULL) { 191 system_level, BrowserDistribution::CHROME_BINARIES) == NULL) {
192 MockProductState product_state; 192 MockProductState product_state;
193 product_state.set_version(new Version(*current_version_)); 193 product_state.set_version(new Version(*current_version_));
194 product_state.set_brand(L"TEST");
195 product_state.set_multi_install(true);
196 BrowserDistribution* dist =
197 BrowserDistribution::GetSpecificDistribution(
198 BrowserDistribution::CHROME_BINARIES);
199 FilePath install_path =
200 installer::GetChromeInstallPath(system_level, dist);
201 product_state.SetUninstallProgram(
202 install_path.AppendASCII(current_version_->GetString())
203 .Append(installer::kInstallerDir)
204 .Append(installer::kSetupExe));
205 product_state.AddUninstallSwitch(installer::switches::kUninstall);
206 product_state.AddUninstallSwitch(installer::switches::kMultiInstall);
207 if (system_level)
208 product_state.AddUninstallSwitch(installer::switches::kSystemLevel);
194 installation_state->SetProductState(system_level, 209 installation_state->SetProductState(system_level,
195 BrowserDistribution::CHROME_BINARIES, 210 BrowserDistribution::CHROME_BINARIES,
196 product_state); 211 product_state);
197 } 212 }
198 } 213 }
199 214
200 void AddChromeToInstallationState( 215 void AddChromeToInstallationState(
201 bool system_level, 216 bool system_level,
202 bool multi_install, 217 bool multi_install,
203 bool with_chrome_frame_ready_mode, 218 bool with_chrome_frame_ready_mode,
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 installer_state->set_operation(operation); 310 installer_state->set_operation(operation);
296 // Hope this next one isn't checked for now. 311 // Hope this next one isn't checked for now.
297 installer_state->set_state_key(L"PROBABLY_INVALID_REG_PATH"); 312 installer_state->set_state_key(L"PROBABLY_INVALID_REG_PATH");
298 installer_state->set_state_type(BrowserDistribution::CHROME_BROWSER); 313 installer_state->set_state_type(BrowserDistribution::CHROME_BROWSER);
299 installer_state->set_package_type(multi_install ? 314 installer_state->set_package_type(multi_install ?
300 InstallerState::MULTI_PACKAGE : 315 InstallerState::MULTI_PACKAGE :
301 InstallerState::SINGLE_PACKAGE); 316 InstallerState::SINGLE_PACKAGE);
302 return installer_state.release(); 317 return installer_state.release();
303 } 318 }
304 319
320 static void AddChromeBinariesToInstallerState(
321 const InstallationState& machine_state,
322 MockInstallerState* installer_state) {
323 if (!installer_state->is_multi_install()) {
324 NOTREACHED();
325 return;
326 }
327 if (installer_state->FindProduct(BrowserDistribution::CHROME_BINARIES))
328 return;
329
330 // Fresh install or upgrade?
331 const ProductState* chrome_binaries =
332 machine_state.GetProductState(installer_state->system_install(),
333 BrowserDistribution::CHROME_BINARIES);
334 if (chrome_binaries != NULL) {
335 installer_state->AddProductFromState(BrowserDistribution::CHROME_BINARIES,
336 *chrome_binaries);
337 } else {
338 BrowserDistribution* dist =
339 BrowserDistribution::GetSpecificDistribution(
340 BrowserDistribution::CHROME_BINARIES);
341 scoped_ptr<Product> product(new Product(dist));
342 product->SetOption(installer::kOptionMultiInstall, true);
343 installer_state->AddProduct(&product);
344 }
345 }
346
305 static void AddChromeToInstallerState( 347 static void AddChromeToInstallerState(
306 const InstallationState& machine_state, 348 const InstallationState& machine_state,
307 MockInstallerState* installer_state) { 349 MockInstallerState* installer_state) {
308 // Fresh install or upgrade? 350 // Fresh install or upgrade?
309 const ProductState* chrome = 351 const ProductState* chrome =
310 machine_state.GetProductState(installer_state->system_install(), 352 machine_state.GetProductState(installer_state->system_install(),
311 BrowserDistribution::CHROME_BROWSER); 353 BrowserDistribution::CHROME_BROWSER);
312 if (chrome != NULL && 354 if (chrome != NULL &&
313 chrome->is_multi_install() == installer_state->is_multi_install()) { 355 chrome->is_multi_install() == installer_state->is_multi_install()) {
314 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, 356 installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 392 }
351 393
352 static MockInstallerState* BuildChromeInstallerState( 394 static MockInstallerState* BuildChromeInstallerState(
353 bool system_install, 395 bool system_install,
354 bool multi_install, 396 bool multi_install,
355 const InstallationState& machine_state, 397 const InstallationState& machine_state,
356 InstallerState::Operation operation) { 398 InstallerState::Operation operation) {
357 scoped_ptr<MockInstallerState> installer_state( 399 scoped_ptr<MockInstallerState> installer_state(
358 BuildBasicInstallerState(system_install, multi_install, machine_state, 400 BuildBasicInstallerState(system_install, multi_install, machine_state,
359 operation)); 401 operation));
402 if (multi_install)
403 AddChromeBinariesToInstallerState(machine_state, installer_state.get());
360 AddChromeToInstallerState(machine_state, installer_state.get()); 404 AddChromeToInstallerState(machine_state, installer_state.get());
361 return installer_state.release(); 405 return installer_state.release();
362 } 406 }
363 407
364 static MockInstallerState* BuildChromeFrameInstallerState( 408 static MockInstallerState* BuildChromeFrameInstallerState(
365 bool system_install, 409 bool system_install,
366 bool multi_install, 410 bool multi_install,
367 bool ready_mode, 411 bool ready_mode,
368 const InstallationState& machine_state, 412 const InstallationState& machine_state,
369 InstallerState::Operation operation) { 413 InstallerState::Operation operation) {
414 // This method only works for installation/upgrade.
415 DCHECK(operation != InstallerState::UNINSTALL);
370 scoped_ptr<MockInstallerState> installer_state( 416 scoped_ptr<MockInstallerState> installer_state(
371 BuildBasicInstallerState(system_install, multi_install, machine_state, 417 BuildBasicInstallerState(system_install, multi_install, machine_state,
372 operation)); 418 operation));
419 if (multi_install)
420 AddChromeBinariesToInstallerState(machine_state, installer_state.get());
373 AddChromeFrameToInstallerState(machine_state, ready_mode, 421 AddChromeFrameToInstallerState(machine_state, ready_mode,
374 installer_state.get()); 422 installer_state.get());
375 return installer_state.release(); 423 return installer_state.release();
376 } 424 }
377 425
378 protected: 426 protected:
379 scoped_ptr<Version> current_version_; 427 scoped_ptr<Version> current_version_;
380 scoped_ptr<Version> new_version_; 428 scoped_ptr<Version> new_version_;
381 FilePath archive_path_; 429 FilePath archive_path_;
382 FilePath installation_path_; 430 FilePath installation_path_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 multi_install_ = std::tr1::get<1>(param); 492 multi_install_ = std::tr1::get<1>(param);
445 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 493 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
446 494
447 installation_state_.reset(new MockInstallationState()); 495 installation_state_.reset(new MockInstallationState());
448 AddChromeFrameToInstallationState(system_level_, multi_install_, false, 496 AddChromeFrameToInstallationState(system_level_, multi_install_, false,
449 installation_state_.get()); 497 installation_state_.get());
450 installer_state_.reset(BuildBasicInstallerState( 498 installer_state_.reset(BuildBasicInstallerState(
451 system_level_, multi_install_, *installation_state_, 499 system_level_, multi_install_, *installation_state_,
452 multi_install_ ? InstallerState::MULTI_UPDATE : 500 multi_install_ ? InstallerState::MULTI_UPDATE :
453 InstallerState::SINGLE_INSTALL_OR_UPDATE)); 501 InstallerState::SINGLE_INSTALL_OR_UPDATE));
502 if (multi_install_)
503 AddChromeBinariesToInstallerState(*installation_state_,
504 installer_state_.get());
454 AddChromeFrameToInstallerState(*installation_state_, false, 505 AddChromeFrameToInstallerState(*installation_state_, false,
455 installer_state_.get()); 506 installer_state_.get());
456 } 507 }
457 508
458 scoped_ptr<MockInstallationState> installation_state_; 509 scoped_ptr<MockInstallationState> installation_state_;
459 scoped_ptr<MockInstallerState> installer_state_; 510 scoped_ptr<MockInstallerState> installer_state_;
460 bool system_level_; 511 bool system_level_;
461 bool multi_install_; 512 bool multi_install_;
462 HKEY root_key_; 513 HKEY root_key_;
463 }; 514 };
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 715
665 const wchar_t QuickEnableAbsentTest::kRegKeyPath[] = 716 const wchar_t QuickEnableAbsentTest::kRegKeyPath[] =
666 L"Software\\Google\\Update\\Clients\\" 717 L"Software\\Google\\Update\\Clients\\"
667 L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}\\Commands\\quick-enable-cf"; 718 L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}\\Commands\\quick-enable-cf";
668 719
669 TEST_F(QuickEnableAbsentTest, CleanInstallSingleChrome) { 720 TEST_F(QuickEnableAbsentTest, CleanInstallSingleChrome) {
670 // Install single Chrome on a clean system. 721 // Install single Chrome on a clean system.
671 scoped_ptr<MockInstallerState> installer_state( 722 scoped_ptr<MockInstallerState> installer_state(
672 BuildChromeInstallerState(system_level_, false, *machine_state_, 723 BuildChromeInstallerState(system_level_, false, *machine_state_,
673 InstallerState::SINGLE_INSTALL_OR_UPDATE)); 724 InstallerState::SINGLE_INSTALL_OR_UPDATE));
674 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 725 AddQuickEnableChromeFrameWorkItems(*installer_state,
675 new_version_.get(), &work_item_list_); 726 *machine_state_,
727 &setup_path_,
728 new_version_.get(),
729 &work_item_list_);
676 } 730 }
677 731
678 TEST_F(QuickEnableAbsentTest, CleanInstallSingleChromeFrame) { 732 TEST_F(QuickEnableAbsentTest, CleanInstallSingleChromeFrame) {
679 // Install single Chrome Frame on a clean system. 733 // Install single Chrome Frame on a clean system.
680 scoped_ptr<MockInstallerState> installer_state( 734 scoped_ptr<MockInstallerState> installer_state(
681 BuildChromeFrameInstallerState(system_level_, false, false, 735 BuildChromeFrameInstallerState(system_level_, false, false,
682 *machine_state_, 736 *machine_state_,
683 InstallerState::SINGLE_INSTALL_OR_UPDATE)); 737 InstallerState::SINGLE_INSTALL_OR_UPDATE));
684 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 738 AddQuickEnableChromeFrameWorkItems(*installer_state,
685 new_version_.get(), &work_item_list_); 739 *machine_state_,
740 &setup_path_,
741 new_version_.get(),
742 &work_item_list_);
686 } 743 }
687 744
688 TEST_F(QuickEnableAbsentTest, CleanInstallMultiChromeFrame) { 745 TEST_F(QuickEnableAbsentTest, CleanInstallMultiChromeFrame) {
689 // Install multi Chrome Frame on a clean system. 746 // Install multi Chrome Frame on a clean system.
690 scoped_ptr<MockInstallerState> installer_state( 747 scoped_ptr<MockInstallerState> installer_state(
691 BuildChromeFrameInstallerState(system_level_, true, false, 748 BuildChromeFrameInstallerState(system_level_, true, false,
692 *machine_state_, 749 *machine_state_,
693 InstallerState::MULTI_INSTALL)); 750 InstallerState::MULTI_INSTALL));
694 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 751 AddQuickEnableChromeFrameWorkItems(*installer_state,
695 new_version_.get(), &work_item_list_); 752 *machine_state_,
753 &setup_path_,
754 new_version_.get(),
755 &work_item_list_);
696 } 756 }
697 757
698 TEST_F(QuickEnableAbsentTest, CleanInstallMultiChromeChromeFrame) { 758 TEST_F(QuickEnableAbsentTest, CleanInstallMultiChromeChromeFrame) {
699 // Install multi Chrome and Chrome Frame on a clean system. 759 // Install multi Chrome and Chrome Frame on a clean system.
700 scoped_ptr<MockInstallerState> installer_state( 760 scoped_ptr<MockInstallerState> installer_state(
701 BuildBasicInstallerState(system_level_, true, *machine_state_, 761 BuildBasicInstallerState(system_level_, true, *machine_state_,
702 InstallerState::MULTI_INSTALL)); 762 InstallerState::MULTI_INSTALL));
763 AddChromeBinariesToInstallerState(*machine_state_, installer_state.get());
703 AddChromeToInstallerState(*machine_state_, installer_state.get()); 764 AddChromeToInstallerState(*machine_state_, installer_state.get());
704 AddChromeFrameToInstallerState(*machine_state_, false, 765 AddChromeFrameToInstallerState(*machine_state_, false,
705 installer_state.get()); 766 installer_state.get());
706 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 767 AddQuickEnableChromeFrameWorkItems(*installer_state,
707 new_version_.get(), &work_item_list_); 768 *machine_state_,
769 &setup_path_,
770 new_version_.get(),
771 &work_item_list_);
708 } 772 }
709 773
710 TEST_F(QuickEnableAbsentTest, UninstallMultiChromeLeaveMultiChromeFrame) { 774 TEST_F(QuickEnableAbsentTest, UninstallMultiChromeLeaveMultiChromeFrame) {
711 // Uninstall multi Chrome on a machine with multi Chrome Frame. 775 // Uninstall multi Chrome on a machine with multi Chrome Frame.
712 AddChromeToInstallationState(system_level_, true, false, 776 AddChromeToInstallationState(system_level_, true, false,
713 machine_state_.get()); 777 machine_state_.get());
714 AddChromeFrameToInstallationState(system_level_, true, false, 778 AddChromeFrameToInstallationState(system_level_, true, false,
715 machine_state_.get()); 779 machine_state_.get());
716 scoped_ptr<MockInstallerState> installer_state( 780 scoped_ptr<MockInstallerState> installer_state(
717 BuildBasicInstallerState(system_level_, true, *machine_state_, 781 BuildBasicInstallerState(system_level_, true, *machine_state_,
718 InstallerState::UNINSTALL)); 782 InstallerState::UNINSTALL));
719 AddChromeToInstallerState(*machine_state_, installer_state.get()); 783 AddChromeToInstallerState(*machine_state_, installer_state.get());
720 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 784 AddQuickEnableChromeFrameWorkItems(*installer_state,
721 new_version_.get(), &work_item_list_); 785 *machine_state_,
786 &setup_path_,
787 new_version_.get(),
788 &work_item_list_);
722 } 789 }
723 790
724 TEST_F(QuickEnableAbsentTest, UninstallMultiChromeLeaveSingleChromeFrame) { 791 TEST_F(QuickEnableAbsentTest, UninstallMultiChromeLeaveSingleChromeFrame) {
725 // Uninstall multi Chrome on a machine with single Chrome Frame. 792 // Uninstall multi Chrome on a machine with single Chrome Frame.
726 AddChromeToInstallationState(system_level_, true, false, 793 AddChromeToInstallationState(system_level_, true, false,
727 machine_state_.get()); 794 machine_state_.get());
728 AddChromeFrameToInstallationState(system_level_, false, false, 795 AddChromeFrameToInstallationState(system_level_, false, false,
729 machine_state_.get()); 796 machine_state_.get());
730 scoped_ptr<MockInstallerState> installer_state( 797 scoped_ptr<MockInstallerState> installer_state(
731 BuildBasicInstallerState(system_level_, true, *machine_state_, 798 BuildBasicInstallerState(system_level_, true, *machine_state_,
732 InstallerState::UNINSTALL)); 799 InstallerState::UNINSTALL));
733 AddChromeToInstallerState(*machine_state_, installer_state.get()); 800 AddChromeToInstallerState(*machine_state_, installer_state.get());
734 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 801 AddChromeBinariesToInstallerState(*machine_state_, installer_state.get());
735 new_version_.get(), &work_item_list_); 802 AddQuickEnableChromeFrameWorkItems(*installer_state,
803 *machine_state_,
804 &setup_path_,
805 new_version_.get(),
806 &work_item_list_);
736 } 807 }
737 808
738 TEST_F(QuickEnableAbsentTest, AcceptReadyMode) { 809 TEST_F(QuickEnableAbsentTest, AcceptReadyMode) {
739 // Accept ready-mode. 810 // Accept ready-mode.
740 AddChromeToInstallationState(system_level_, true, true, 811 AddChromeToInstallationState(system_level_, true, true,
741 machine_state_.get()); 812 machine_state_.get());
742 AddChromeFrameToInstallationState(system_level_, true, true, 813 AddChromeFrameToInstallationState(system_level_, true, true,
743 machine_state_.get()); 814 machine_state_.get());
744 scoped_ptr<MockInstallerState> installer_state( 815 scoped_ptr<MockInstallerState> installer_state(
745 BuildBasicInstallerState(system_level_, true, *machine_state_, 816 BuildBasicInstallerState(system_level_, true, *machine_state_,
746 InstallerState::UNINSTALL)); 817 InstallerState::UNINSTALL));
747 AddChromeToInstallerState(*machine_state_, installer_state.get()); 818 AddChromeToInstallerState(*machine_state_, installer_state.get());
748 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get()); 819 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get());
749 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 820 AddChromeBinariesToInstallerState(*machine_state_, installer_state.get());
750 new_version_.get(), &work_item_list_); 821 AddQuickEnableChromeFrameWorkItems(*installer_state,
822 *machine_state_,
823 &setup_path_,
824 new_version_.get(),
825 &work_item_list_);
751 } 826 }
752 827
753 // Test scenarios under which the quick-enable-cf command should exist after the 828 // Test scenarios under which the quick-enable-cf command should exist after the
754 // run. 829 // run.
755 class QuickEnablePresentTest : public InstallWorkerTest { 830 class QuickEnablePresentTest : public InstallWorkerTest {
756 public: 831 public:
757 virtual void SetUp() { 832 virtual void SetUp() {
758 InstallWorkerTest::SetUp(); 833 InstallWorkerTest::SetUp();
759 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 834 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
760 create_reg_key_work_item_.reset( 835 create_reg_key_work_item_.reset(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 876
802 const wchar_t QuickEnablePresentTest::kRegKeyPath[] = 877 const wchar_t QuickEnablePresentTest::kRegKeyPath[] =
803 L"Software\\Google\\Update\\Clients\\" 878 L"Software\\Google\\Update\\Clients\\"
804 L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}\\Commands\\quick-enable-cf"; 879 L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}\\Commands\\quick-enable-cf";
805 880
806 TEST_F(QuickEnablePresentTest, CleanInstallMultiChrome) { 881 TEST_F(QuickEnablePresentTest, CleanInstallMultiChrome) {
807 // Install multi Chrome on a clean system. 882 // Install multi Chrome on a clean system.
808 scoped_ptr<MockInstallerState> installer_state( 883 scoped_ptr<MockInstallerState> installer_state(
809 BuildChromeInstallerState(system_level_, true, *machine_state_, 884 BuildChromeInstallerState(system_level_, true, *machine_state_,
810 InstallerState::MULTI_INSTALL)); 885 InstallerState::MULTI_INSTALL));
811 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 886 AddQuickEnableChromeFrameWorkItems(*installer_state,
812 new_version_.get(), &work_item_list_); 887 *machine_state_,
888 &setup_path_,
889 new_version_.get(),
890 &work_item_list_);
813 } 891 }
814 892
815 TEST_F(QuickEnablePresentTest, CleanInstallMultiChromeReadyMode) { 893 TEST_F(QuickEnablePresentTest, CleanInstallMultiChromeReadyMode) {
816 // Install multi Chrome with Chrome Frame ready-mode on a clean system. 894 // Install multi Chrome with Chrome Frame ready-mode on a clean system.
817 scoped_ptr<MockInstallerState> installer_state( 895 scoped_ptr<MockInstallerState> installer_state(
818 BuildBasicInstallerState(system_level_, true, *machine_state_, 896 BuildBasicInstallerState(system_level_, true, *machine_state_,
819 InstallerState::MULTI_INSTALL)); 897 InstallerState::MULTI_INSTALL));
898 AddChromeBinariesToInstallerState(*machine_state_, installer_state.get());
820 AddChromeToInstallerState(*machine_state_, installer_state.get()); 899 AddChromeToInstallerState(*machine_state_, installer_state.get());
821 AddChromeFrameToInstallerState(*machine_state_, true, 900 AddChromeFrameToInstallerState(*machine_state_, true,
822 installer_state.get()); 901 installer_state.get());
823 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 902 AddQuickEnableChromeFrameWorkItems(*installer_state,
824 new_version_.get(), &work_item_list_); 903 *machine_state_,
904 &setup_path_,
905 new_version_.get(),
906 &work_item_list_);
825 } 907 }
826 908
827 TEST_F(QuickEnablePresentTest, UninstallSingleChromeFrame) { 909 TEST_F(QuickEnablePresentTest, UninstallSingleChromeFrame) {
828 // Uninstall single Chrome Frame on a machine with multi Chrome. 910 // Uninstall single Chrome Frame on a machine with multi Chrome.
829 AddChromeToInstallationState(system_level_, true, false, 911 AddChromeToInstallationState(system_level_, true, false,
830 machine_state_.get()); 912 machine_state_.get());
831 AddChromeFrameToInstallationState(system_level_, false, false, 913 AddChromeFrameToInstallationState(system_level_, false, false,
832 machine_state_.get()); 914 machine_state_.get());
833 scoped_ptr<MockInstallerState> installer_state( 915 scoped_ptr<MockInstallerState> installer_state(
834 BuildBasicInstallerState(system_level_, false, *machine_state_, 916 BuildBasicInstallerState(system_level_, false, *machine_state_,
835 InstallerState::UNINSTALL)); 917 InstallerState::UNINSTALL));
836 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get()); 918 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get());
837 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 919 AddQuickEnableChromeFrameWorkItems(*installer_state,
838 new_version_.get(), &work_item_list_); 920 *machine_state_,
921 &setup_path_,
922 new_version_.get(),
923 &work_item_list_);
839 } 924 }
840 925
841 TEST_F(QuickEnablePresentTest, UninstallMultiChromeFrame) { 926 TEST_F(QuickEnablePresentTest, UninstallMultiChromeFrame) {
842 // Uninstall multi Chrome Frame on a machine with multi Chrome. 927 // Uninstall multi Chrome Frame on a machine with multi Chrome.
843 AddChromeToInstallationState(system_level_, true, false, 928 AddChromeToInstallationState(system_level_, true, false,
844 machine_state_.get()); 929 machine_state_.get());
845 AddChromeFrameToInstallationState(system_level_, true, false, 930 AddChromeFrameToInstallationState(system_level_, true, false,
846 machine_state_.get()); 931 machine_state_.get());
847 scoped_ptr<MockInstallerState> installer_state( 932 scoped_ptr<MockInstallerState> installer_state(
848 BuildBasicInstallerState(system_level_, true, *machine_state_, 933 BuildBasicInstallerState(system_level_, true, *machine_state_,
849 InstallerState::UNINSTALL)); 934 InstallerState::UNINSTALL));
850 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get()); 935 AddChromeFrameToInstallerState(*machine_state_, false, installer_state.get());
851 AddQuickEnableWorkItems(*installer_state, *machine_state_, &setup_path_, 936 AddQuickEnableChromeFrameWorkItems(*installer_state,
852 new_version_.get(), &work_item_list_); 937 *machine_state_,
938 &setup_path_,
939 new_version_.get(),
940 &work_item_list_);
853 } 941 }
854 942
855 #endif // defined(GOOGLE_CHROME_BUILD) 943 #endif // defined(GOOGLE_CHROME_BUILD)
OLDNEW
« no previous file with comments | « chrome/installer/setup/install_worker.cc ('k') | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698