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

Unified Diff: postinstall_runner_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 | « postinstall_runner_action.cc ('k') | set_bootable_flag_action.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: postinstall_runner_action_unittest.cc
diff --git a/postinstall_runner_action_unittest.cc b/postinstall_runner_action_unittest.cc
index 9b19158e3526443ba083e61d9f9c389b6569457f..578f7f42d77c00d8f2bb142d41d686668ea4c6c0 100644
--- a/postinstall_runner_action_unittest.cc
+++ b/postinstall_runner_action_unittest.cc
@@ -24,17 +24,19 @@ class PostinstallRunnerActionTest : public ::testing::Test {
class PostinstActionProcessorDelegate : public ActionProcessorDelegate {
public:
- PostinstActionProcessorDelegate() : success_(false), success_set_(false) {}
+ PostinstActionProcessorDelegate()
+ : code_(kActionCodeError),
+ code_set_(false) {}
void ActionCompleted(ActionProcessor* processor,
AbstractAction* action,
- bool success) {
+ ActionExitCode code) {
if (action->Type() == PostinstallRunnerAction::StaticType()) {
- success_ = success;
- success_set_ = true;
+ code_ = code;
+ code_set_ = true;
}
}
- bool success_;
- bool success_set_;
+ ActionExitCode code_;
+ bool code_set_;
};
TEST_F(PostinstallRunnerActionTest, RunAsRootSimpleTest) {
@@ -127,8 +129,8 @@ void PostinstallRunnerActionTest::DoTest(bool do_losetup, bool do_err_script) {
ASSERT_FALSE(processor.IsRunning())
<< "Update test to handle non-asynch actions";
- EXPECT_TRUE(delegate.success_set_);
- EXPECT_EQ(do_losetup && !do_err_script, delegate.success_);
+ EXPECT_TRUE(delegate.code_set_);
+ EXPECT_EQ(do_losetup && !do_err_script, delegate.code_ == kActionCodeSuccess);
EXPECT_EQ(do_losetup && !do_err_script,
!collector_action.object().install_path.empty());
if (do_losetup && !do_err_script) {
« no previous file with comments | « postinstall_runner_action.cc ('k') | set_bootable_flag_action.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698