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

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

Issue 282363003: Add WOW64 support to the installer registry work items (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: nits. fix call to DeleteRegistryKey Created 6 years, 7 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
« 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/setup/setup_util.h" 10 #include "chrome/installer/setup/setup_util.h"
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 //------------------------------------------------------------------------------ 431 //------------------------------------------------------------------------------
432 432
433 TEST_F(InstallWorkerTest, TestInstallChromeSingleSystem) { 433 TEST_F(InstallWorkerTest, TestInstallChromeSingleSystem) {
434 const bool system_level = true; 434 const bool system_level = true;
435 const bool multi_install = false; 435 const bool multi_install = false;
436 MockWorkItemList work_item_list; 436 MockWorkItemList work_item_list;
437 437
438 const HKEY kRegRoot = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 438 const HKEY kRegRoot = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
439 static const wchar_t kRegKeyPath[] = L"Software\\Chromium\\test"; 439 static const wchar_t kRegKeyPath[] = L"Software\\Chromium\\test";
440 scoped_ptr<CreateRegKeyWorkItem> create_reg_key_work_item( 440 scoped_ptr<CreateRegKeyWorkItem> create_reg_key_work_item(
441 WorkItem::CreateCreateRegKeyWorkItem(kRegRoot, kRegKeyPath)); 441 WorkItem::CreateCreateRegKeyWorkItem(
442 kRegRoot, kRegKeyPath, WorkItem::kWow64Default));
442 scoped_ptr<SetRegValueWorkItem> set_reg_value_work_item( 443 scoped_ptr<SetRegValueWorkItem> set_reg_value_work_item(
443 WorkItem::CreateSetRegValueWorkItem(kRegRoot, kRegKeyPath, L"", L"", 444 WorkItem::CreateSetRegValueWorkItem(
444 false)); 445 kRegRoot, kRegKeyPath, WorkItem::kWow64Default, L"", L"", false));
445 446
446 scoped_ptr<InstallationState> installation_state( 447 scoped_ptr<InstallationState> installation_state(
447 BuildChromeInstallationState(system_level, multi_install)); 448 BuildChromeInstallationState(system_level, multi_install));
448 449
449 scoped_ptr<InstallerState> installer_state( 450 scoped_ptr<InstallerState> installer_state(
450 BuildChromeInstallerState(system_level, multi_install, 451 BuildChromeInstallerState(system_level, multi_install,
451 *installation_state, 452 *installation_state,
452 InstallerState::SINGLE_INSTALL_OR_UPDATE)); 453 InstallerState::SINGLE_INSTALL_OR_UPDATE));
453 454
454 // Set up some expectations. 455 // Set up some expectations.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 #if defined(GOOGLE_CHROME_BUILD) 677 #if defined(GOOGLE_CHROME_BUILD)
677 678
678 // Test scenarios under which the quick-enable-cf command should not exist after 679 // Test scenarios under which the quick-enable-cf command should not exist after
679 // the run. We're permissive in that we allow the DeleteRegKeyWorkItem even if 680 // the run. We're permissive in that we allow the DeleteRegKeyWorkItem even if
680 // it isn't strictly needed. 681 // it isn't strictly needed.
681 class QuickEnableAbsentTest : public InstallWorkerTest { 682 class QuickEnableAbsentTest : public InstallWorkerTest {
682 public: 683 public:
683 virtual void SetUp() { 684 virtual void SetUp() {
684 InstallWorkerTest::SetUp(); 685 InstallWorkerTest::SetUp();
685 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 686 root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
686 delete_reg_key_item_.reset( 687 delete_reg_key_item_.reset(WorkItem::CreateDeleteRegKeyWorkItem(
687 WorkItem::CreateDeleteRegKeyWorkItem(root_key_, kRegKeyPath)); 688 root_key_, kRegKeyPath, WorkItem::kWow64Default));
688 machine_state_.reset(new MockInstallationState()); 689 machine_state_.reset(new MockInstallationState());
689 EXPECT_CALL(work_item_list_, 690 EXPECT_CALL(work_item_list_,
690 AddDeleteRegKeyWorkItem(Eq(root_key_), StrCaseEq(kRegKeyPath))) 691 AddDeleteRegKeyWorkItem(Eq(root_key_), StrCaseEq(kRegKeyPath)))
691 .Times(AtMost(1)) 692 .Times(AtMost(1))
692 .WillRepeatedly(Return(delete_reg_key_item_.get())); 693 .WillRepeatedly(Return(delete_reg_key_item_.get()));
693 } 694 }
694 virtual void TearDown() { 695 virtual void TearDown() {
695 machine_state_.reset(); 696 machine_state_.reset();
696 delete_reg_key_item_.reset(); 697 delete_reg_key_item_.reset();
697 root_key_ = NULL; 698 root_key_ = NULL;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 prod_type_list[i_type_check]); 798 prod_type_list[i_type_check]);
798 bool prod_expect = (mach_after & (1 << i_type_check)) != 0; 799 bool prod_expect = (mach_after & (1 << i_type_check)) != 0;
799 EXPECT_EQ(prod_expect, prod_res); 800 EXPECT_EQ(prod_expect, prod_res);
800 } 801 }
801 } 802 }
802 } 803 }
803 } 804 }
804 } 805 }
805 806
806 #endif // defined(GOOGLE_CHROME_BUILD) 807 #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