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

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

Issue 1882923003: Add best-effort/allow rollback flags on WorkItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_list_tests
Patch Set: fix build error Created 4 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
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 <vector> 7 #include <vector>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 CopyOverWriteOption, 59 CopyOverWriteOption,
60 const std::wstring&)); 60 const std::wstring&));
61 MOCK_METHOD1(AddCreateDirWorkItem, WorkItem* (const base::FilePath&)); 61 MOCK_METHOD1(AddCreateDirWorkItem, WorkItem* (const base::FilePath&));
62 MOCK_METHOD3(AddCreateRegKeyWorkItem, 62 MOCK_METHOD3(AddCreateRegKeyWorkItem,
63 WorkItem*(HKEY, const std::wstring&, REGSAM)); 63 WorkItem*(HKEY, const std::wstring&, REGSAM));
64 MOCK_METHOD3(AddDeleteRegKeyWorkItem, 64 MOCK_METHOD3(AddDeleteRegKeyWorkItem,
65 WorkItem*(HKEY, const std::wstring&, REGSAM)); 65 WorkItem*(HKEY, const std::wstring&, REGSAM));
66 MOCK_METHOD4( 66 MOCK_METHOD4(
67 AddDeleteRegValueWorkItem, 67 AddDeleteRegValueWorkItem,
68 WorkItem*(HKEY, const std::wstring&, REGSAM, const std::wstring&)); 68 WorkItem*(HKEY, const std::wstring&, REGSAM, const std::wstring&));
69 MOCK_METHOD3(AddDeleteTreeWorkItem,
70 WorkItem*(const base::FilePath&,
71 const base::FilePath&,
72 const std::vector<base::FilePath>&));
73 MOCK_METHOD2(AddDeleteTreeWorkItem, 69 MOCK_METHOD2(AddDeleteTreeWorkItem,
74 WorkItem*(const base::FilePath&, const base::FilePath&)); 70 WorkItem*(const base::FilePath&, const base::FilePath&));
75 MOCK_METHOD4(AddMoveTreeWorkItem, 71 MOCK_METHOD4(AddMoveTreeWorkItem,
76 WorkItem*(const std::wstring&, 72 WorkItem*(const std::wstring&,
77 const std::wstring&, 73 const std::wstring&,
78 const std::wstring&, 74 const std::wstring&,
79 MoveTreeOption)); 75 MoveTreeOption));
80 // Workaround for gmock problems with disambiguating between string pointers 76 // Workaround for gmock problems with disambiguating between string pointers
81 // and DWORD. 77 // and DWORD.
82 virtual WorkItem* AddSetRegValueWorkItem(HKEY a1, 78 virtual WorkItem* AddSetRegValueWorkItem(HKEY a1,
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 452
457 const HKEY kRegRoot = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 453 const HKEY kRegRoot = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
458 static const wchar_t kRegKeyPath[] = L"Software\\Chromium\\test"; 454 static const wchar_t kRegKeyPath[] = L"Software\\Chromium\\test";
459 std::unique_ptr<CreateRegKeyWorkItem> create_reg_key_work_item( 455 std::unique_ptr<CreateRegKeyWorkItem> create_reg_key_work_item(
460 WorkItem::CreateCreateRegKeyWorkItem(kRegRoot, kRegKeyPath, 456 WorkItem::CreateCreateRegKeyWorkItem(kRegRoot, kRegKeyPath,
461 WorkItem::kWow64Default)); 457 WorkItem::kWow64Default));
462 std::unique_ptr<SetRegValueWorkItem> set_reg_value_work_item( 458 std::unique_ptr<SetRegValueWorkItem> set_reg_value_work_item(
463 WorkItem::CreateSetRegValueWorkItem( 459 WorkItem::CreateSetRegValueWorkItem(
464 kRegRoot, kRegKeyPath, WorkItem::kWow64Default, L"", L"", false)); 460 kRegRoot, kRegKeyPath, WorkItem::kWow64Default, L"", L"", false));
465 std::unique_ptr<DeleteTreeWorkItem> delete_tree_work_item( 461 std::unique_ptr<DeleteTreeWorkItem> delete_tree_work_item(
466 WorkItem::CreateDeleteTreeWorkItem(base::FilePath(), base::FilePath(), 462 WorkItem::CreateDeleteTreeWorkItem(base::FilePath(), base::FilePath()));
467 std::vector<base::FilePath>()));
468 std::unique_ptr<DeleteRegKeyWorkItem> delete_reg_key_work_item( 463 std::unique_ptr<DeleteRegKeyWorkItem> delete_reg_key_work_item(
469 WorkItem::CreateDeleteRegKeyWorkItem(kRegRoot, kRegKeyPath, 464 WorkItem::CreateDeleteRegKeyWorkItem(kRegRoot, kRegKeyPath,
470 WorkItem::kWow64Default)); 465 WorkItem::kWow64Default));
471 466
472 std::unique_ptr<InstallationState> installation_state( 467 std::unique_ptr<InstallationState> installation_state(
473 BuildChromeInstallationState(system_level, multi_install)); 468 BuildChromeInstallationState(system_level, multi_install));
474 469
475 std::unique_ptr<InstallerState> installer_state(BuildChromeInstallerState( 470 std::unique_ptr<InstallerState> installer_state(BuildChromeInstallerState(
476 system_level, multi_install, *installation_state, 471 system_level, multi_install, *installation_state,
477 InstallerState::SINGLE_INSTALL_OR_UPDATE)); 472 InstallerState::SINGLE_INSTALL_OR_UPDATE));
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 prod_type_list[i_type_check]); 821 prod_type_list[i_type_check]);
827 bool prod_expect = (mach_after & (1 << i_type_check)) != 0; 822 bool prod_expect = (mach_after & (1 << i_type_check)) != 0;
828 EXPECT_EQ(prod_expect, prod_res); 823 EXPECT_EQ(prod_expect, prod_res);
829 } 824 }
830 } 825 }
831 } 826 }
832 } 827 }
833 } 828 }
834 829
835 #endif // defined(GOOGLE_CHROME_BUILD) 830 #endif // defined(GOOGLE_CHROME_BUILD)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698