Partially Revert 2b9d241
2b9d2417722cd4052b0e22494886f93c5b4ef042 update_engine: Update libchrome APIS to r456626.
The above commit changes the libchrome API used in update_engine to r456626. But
the libchrome has not been upreved fully in the CrOS yet with the exception of
some changes represented in UE like CL:882543. So, now we need to revert the
changes partially untill the libchrome is updated.
BUG=chromium:815356
TEST=unittests, precq
Change-Id: If2207f0672c7b9f6dab84e676d9fb8423a047372
Reviewed-on: https://chromium-review.googlesource.com/965266
Commit-Ready: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Sen Jiang <senj@chromium.org>
diff --git a/update_manager/real_shill_provider_unittest.cc b/update_manager/real_shill_provider_unittest.cc
index 6506923..af674d0 100644
--- a/update_manager/real_shill_provider_unittest.cc
+++ b/update_manager/real_shill_provider_unittest.cc
@@ -94,9 +94,7 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- Time time;
- ignore_result(Time::FromLocalExploded(now_exp, &time));
- return time;
+ return Time::FromLocalExploded(now_exp);
}
Time ConnChangedTime() {
diff --git a/update_manager/real_time_provider.cc b/update_manager/real_time_provider.cc
index db26816..ca3acad 100644
--- a/update_manager/real_time_provider.cc
+++ b/update_manager/real_time_provider.cc
@@ -43,10 +43,7 @@
Time::Exploded now_exp;
clock_->GetWallclockTime().LocalExplode(&now_exp);
now_exp.hour = now_exp.minute = now_exp.second = now_exp.millisecond = 0;
- Time* now = new Time();
- bool success = Time::FromLocalExploded(now_exp, now);
- DCHECK(success);
- return now;
+ return new Time(Time::FromLocalExploded(now_exp));
}
private:
diff --git a/update_manager/real_time_provider_unittest.cc b/update_manager/real_time_provider_unittest.cc
index f8db30b..0e1ef34 100644
--- a/update_manager/real_time_provider_unittest.cc
+++ b/update_manager/real_time_provider_unittest.cc
@@ -51,9 +51,7 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- Time time;
- ignore_result(Time::FromLocalExploded(now_exp, &time));
- return time;
+ return Time::FromLocalExploded(now_exp);
}
FakeClock fake_clock_;
@@ -68,8 +66,7 @@
exploded.minute = 0;
exploded.second = 0;
exploded.millisecond = 0;
- Time expected;
- ignore_result(Time::FromLocalExploded(exploded, &expected));
+ const Time expected = Time::FromLocalExploded(exploded);
fake_clock_.SetWallclockTime(now);
UmTestUtils::ExpectVariableHasValue(expected, provider_->var_curr_date());
diff --git a/update_manager/real_updater_provider_unittest.cc b/update_manager/real_updater_provider_unittest.cc
index b653885..efe042c 100644
--- a/update_manager/real_updater_provider_unittest.cc
+++ b/update_manager/real_updater_provider_unittest.cc
@@ -57,9 +57,7 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- Time time;
- ignore_result(Time::FromLocalExploded(now_exp, &time));
- return time;
+ return Time::FromLocalExploded(now_exp);
}
// Rounds down a timestamp to the nearest second. This is useful when faking
@@ -68,9 +66,7 @@
Time::Exploded exp;
time.LocalExplode(&exp);
exp.millisecond = 0;
- Time rounded_time;
- ignore_result(Time::FromLocalExploded(exp, &rounded_time));
- return rounded_time;
+ return Time::FromLocalExploded(exp);
}
ACTION_P(ActionSetUpdateEngineStatusLastCheckedTime, time) {
diff --git a/update_manager/update_manager_unittest.cc b/update_manager/update_manager_unittest.cc
index c2766ea..03f1610 100644
--- a/update_manager/update_manager_unittest.cc
+++ b/update_manager/update_manager_unittest.cc
@@ -67,9 +67,7 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- Time time;
- ignore_result(Time::FromLocalExploded(now_exp, &time));
- return time;
+ return Time::FromLocalExploded(now_exp);
}
} // namespace