OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 <gtest/gtest.h> | 5 #include <gtest/gtest.h> |
6 #include "update_engine/action.h" | 6 #include "update_engine/action.h" |
7 #include "update_engine/action_processor.h" | 7 #include "update_engine/action_processor.h" |
8 | 8 |
9 namespace chromeos_update_engine { | 9 namespace chromeos_update_engine { |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 virtual void ProcessingDone(const ActionProcessor* processor) { | 63 virtual void ProcessingDone(const ActionProcessor* processor) { |
64 EXPECT_EQ(processor_, processor); | 64 EXPECT_EQ(processor_, processor); |
65 EXPECT_FALSE(processing_done_called_); | 65 EXPECT_FALSE(processing_done_called_); |
66 processing_done_called_ = true; | 66 processing_done_called_ = true; |
67 } | 67 } |
68 virtual void ProcessingStopped(const ActionProcessor* processor) { | 68 virtual void ProcessingStopped(const ActionProcessor* processor) { |
69 EXPECT_EQ(processor_, processor); | 69 EXPECT_EQ(processor_, processor); |
70 EXPECT_FALSE(processing_stopped_called_); | 70 EXPECT_FALSE(processing_stopped_called_); |
71 processing_stopped_called_ = true; | 71 processing_stopped_called_ = true; |
72 } | 72 } |
73 virtual void ActionCompleted(const ActionProcessor* processor, | 73 virtual void ActionCompleted(ActionProcessor* processor, |
74 const AbstractAction* action, | 74 AbstractAction* action, |
75 bool success) { | 75 bool success) { |
76 EXPECT_EQ(processor_, processor); | 76 EXPECT_EQ(processor_, processor); |
77 EXPECT_FALSE(action_completed_called_); | 77 EXPECT_FALSE(action_completed_called_); |
78 action_completed_called_ = true; | 78 action_completed_called_ = true; |
79 action_completed_success_ = success; | 79 action_completed_success_ = success; |
80 } | 80 } |
81 | 81 |
82 const ActionProcessor* processor_; | 82 const ActionProcessor* processor_; |
83 bool processing_done_called_; | 83 bool processing_done_called_; |
84 bool processing_stopped_called_; | 84 bool processing_stopped_called_; |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 action.CompleteAction(); | 159 action.CompleteAction(); |
160 | 160 |
161 action_processor.EnqueueAction(&action); | 161 action_processor.EnqueueAction(&action); |
162 action_processor.StartProcessing(); | 162 action_processor.StartProcessing(); |
163 action_processor.StopProcessing(); | 163 action_processor.StopProcessing(); |
164 | 164 |
165 action_processor.set_delegate(NULL); | 165 action_processor.set_delegate(NULL); |
166 } | 166 } |
167 | 167 |
168 } // namespace chromeos_update_engine | 168 } // namespace chromeos_update_engine |
OLD | NEW |