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

Unified Diff: download_action_unittest.cc

Issue 3022008: For actions, switch bool success into an exit code. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: switch to all positive error codes. Created 10 years, 5 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
« no previous file with comments | « download_action.cc ('k') | filesystem_copier_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_action_unittest.cc
diff --git a/download_action_unittest.cc b/download_action_unittest.cc
index 3b04eaedbee64042b4ebebbff66d23890eee8921..104107fb9fe5c75e00d781f58eb3aaba64b210ee 100644
--- a/download_action_unittest.cc
+++ b/download_action_unittest.cc
@@ -28,7 +28,8 @@ class DownloadActionTestProcessorDelegate : public ActionProcessorDelegate {
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 @@ class DownloadActionTestProcessorDelegate : public ActionProcessorDelegate {
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 @@ struct DownloadActionTestAction : public Action<DownloadActionTestAction> {
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 @@ namespace {
// 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 @@ TEST(DownloadActionTest, BadOutFileTest) {
feeder_action.set_obj(install_plan);
DownloadAction download_action(new MockHttpFetcher("x", 1));
download_action.SetTestFileWriter(&writer);
-
+
BondActions(&feeder_action, &download_action);
ActionProcessor processor;
« no previous file with comments | « download_action.cc ('k') | filesystem_copier_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698