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

Unified Diff: components/metrics/data_use_tracker_unittest.cc

Issue 2605293002: Add WARN_UNUSED_RESULT to base::Time methods that return bool. (Closed)
Patch Set: Use ASSERT_TRUE in unit test Created 3 years, 12 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
Index: components/metrics/data_use_tracker_unittest.cc
diff --git a/components/metrics/data_use_tracker_unittest.cc b/components/metrics/data_use_tracker_unittest.cc
index 0cb96687bd189ed26a37b110ac3276ec1046e9e2..81278755cfc1f994ef63f18d7e7218c1ba7dfdb2 100644
--- a/components/metrics/data_use_tracker_unittest.cc
+++ b/components/metrics/data_use_tracker_unittest.cc
@@ -51,8 +51,11 @@ class FakeDataUseTracker : public DataUseTracker {
base::Time GetCurrentMeasurementDate() const override {
base::Time today_for_test;
- base::Time::FromUTCString(kTodayStr, &today_for_test);
- return today_for_test;
+ if (base::Time::FromUTCString(kTodayStr, &today_for_test)) {
+ return today_for_test;
+ } else {
+ return {};
+ }
}
std::string GetCurrentMeasurementDateAsString() const override {

Powered by Google App Engine
This is Rietveld 408576698