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

Unified Diff: chrome/installer/util/conditional_work_item_list_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: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/util/conditional_work_item_list_unittest.cc
diff --git a/chrome/installer/util/conditional_work_item_list_unittest.cc b/chrome/installer/util/conditional_work_item_list_unittest.cc
index acdd80ab2fd87ee147207b8851210948c4a0ac16..ebdd1e8f51f4f1ede0bfd79a259295ef99950c8e 100644
--- a/chrome/installer/util/conditional_work_item_list_unittest.cc
+++ b/chrome/installer/util/conditional_work_item_list_unittest.cc
@@ -19,8 +19,8 @@ class MockWorkItem : public WorkItem {
public:
MockWorkItem() = default;
- MOCK_METHOD0(Do, bool());
- MOCK_METHOD0(Rollback, void());
+ MOCK_METHOD0(DoImpl, bool());
+ MOCK_METHOD0(RollbackImpl, void());
private:
DISALLOW_COPY_AND_ASSIGN(MockWorkItem);
@@ -59,12 +59,12 @@ TEST(ConditionalWorkItemListTest, ExecutionSuccess) {
// Expect all three items to be done in order then undone.
InSequence s;
- EXPECT_CALL(*item1, Do()).WillOnce(Return(true));
- EXPECT_CALL(*item2, Do()).WillOnce(Return(true));
- EXPECT_CALL(*item3, Do()).WillOnce(Return(true));
- EXPECT_CALL(*item3, Rollback());
- EXPECT_CALL(*item2, Rollback());
- EXPECT_CALL(*item1, Rollback());
+ EXPECT_CALL(*item1, DoImpl()).WillOnce(Return(true));
+ EXPECT_CALL(*item2, DoImpl()).WillOnce(Return(true));
+ EXPECT_CALL(*item3, DoImpl()).WillOnce(Return(true));
+ EXPECT_CALL(*item3, RollbackImpl());
+ EXPECT_CALL(*item2, RollbackImpl());
+ EXPECT_CALL(*item1, RollbackImpl());
}
// Add the items to the list.
@@ -94,10 +94,10 @@ TEST(ConditionalWorkItemListTest, ExecutionFailAndRollback) {
// Expect the two first work items to be done in order then undone.
InSequence s;
- EXPECT_CALL(*item1, Do()).WillOnce(Return(true));
- EXPECT_CALL(*item2, Do()).WillOnce(Return(false));
- EXPECT_CALL(*item2, Rollback());
- EXPECT_CALL(*item1, Rollback());
+ EXPECT_CALL(*item1, DoImpl()).WillOnce(Return(true));
+ EXPECT_CALL(*item2, DoImpl()).WillOnce(Return(false));
+ EXPECT_CALL(*item2, RollbackImpl());
+ EXPECT_CALL(*item1, RollbackImpl());
}
// Add the items to the list.

Powered by Google App Engine
This is Rietveld 408576698