For actions, switch bool success into an exit code.
This way we can signal specific error conditions and then
send appropriate events to Omaha from the UpdateAttempter.
BUG=560
TEST=unit tests, gmerged and looked at logs
Review URL: http://codereview.chromium.org/3022008
diff --git a/download_action_unittest.cc b/download_action_unittest.cc
index 3b04eae..104107f 100644
--- a/download_action_unittest.cc
+++ b/download_action_unittest.cc
@@ -28,7 +28,8 @@
virtual ~DownloadActionTestProcessorDelegate() {
EXPECT_TRUE(processing_done_called_);
}
- virtual void ProcessingDone(const ActionProcessor* processor, bool success) {
+ virtual void ProcessingDone(const ActionProcessor* processor,
+ ActionExitCode code) {
ASSERT_TRUE(loop_);
g_main_loop_quit(loop_);
vector<char> found_data;
@@ -42,9 +43,9 @@
virtual void ActionCompleted(ActionProcessor* processor,
AbstractAction* action,
- bool success) {
+ ActionExitCode code) {
// make sure actions always succeed
- EXPECT_TRUE(success);
+ EXPECT_EQ(kActionCodeSuccess, code);
}
GMainLoop *loop_;
@@ -199,7 +200,7 @@
ASSERT_TRUE(HasInputObject());
EXPECT_TRUE(expected_input_object_ == GetInputObject());
ASSERT_TRUE(processor());
- processor()->ActionComplete(this, true);
+ processor()->ActionComplete(this, kActionCodeSuccess);
}
string Type() const { return "DownloadActionTestAction"; }
InstallPlan expected_input_object_;
@@ -212,7 +213,7 @@
// only by the test PassObjectOutTest.
class PassObjectOutTestProcessorDelegate : public ActionProcessorDelegate {
public:
- void ProcessingDone(const ActionProcessor* processor, bool success) {
+ void ProcessingDone(const ActionProcessor* processor, ActionExitCode code) {
ASSERT_TRUE(loop_);
g_main_loop_quit(loop_);
}
@@ -275,7 +276,7 @@
feeder_action.set_obj(install_plan);
DownloadAction download_action(new MockHttpFetcher("x", 1));
download_action.SetTestFileWriter(&writer);
-
+
BondActions(&feeder_action, &download_action);
ActionProcessor processor;