summaryrefslogtreecommitdiff
path: root/payload_state_unittest.cc
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2017-10-10 17:39:03 -0700
committerTianjie Xu <xunchang@google.com>2017-10-14 22:44:35 +0000
commit90aaa109e38f147ec4bfc772439d9949f1b237c0 (patch)
tree1a12f29bdb847a384dfacd3cce214bb3891d0ab8 /payload_state_unittest.cc
parent012aa5bc825f3efe810cc52864840ace6eae8275 (diff)
Collect metrics for android update attempt
Report the update attempt/result metrics when an upate finishes; and abnormally terminated updates/time to reboot when the device reboots. Bug: 30989466 Test: update_engine_unittest pass Change-Id: Iea16b4e8003ae3dab5e9b7c65cf4b38d2219d203
Diffstat (limited to 'payload_state_unittest.cc')
-rw-r--r--payload_state_unittest.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/payload_state_unittest.cc b/payload_state_unittest.cc
index a69c5ac6..c47e3894 100644
--- a/payload_state_unittest.cc
+++ b/payload_state_unittest.cc
@@ -1095,8 +1095,8 @@ TEST(PayloadStateTest, RebootAfterSuccessfulUpdateTest) {
FakePrefs fake_prefs;
// Set the clock to a well-known time (t = 30 seconds).
- fake_clock.SetWallclockTime(Time::FromInternalValue(
- 30 * Time::kMicrosecondsPerSecond));
+ fake_clock.SetMonotonicTime(
+ Time::FromInternalValue(30 * Time::kMicrosecondsPerSecond));
fake_system_state.set_clock(&fake_clock);
fake_system_state.set_prefs(&fake_prefs);
@@ -1114,8 +1114,8 @@ TEST(PayloadStateTest, RebootAfterSuccessfulUpdateTest) {
// (t = 500 seconds). We do this by using a new PayloadState object
// and checking that it emits the right UMA metric with the right
// value.
- fake_clock.SetWallclockTime(Time::FromInternalValue(
- 500 * Time::kMicrosecondsPerSecond));
+ fake_clock.SetMonotonicTime(
+ Time::FromInternalValue(500 * Time::kMicrosecondsPerSecond));
PayloadState payload_state2;
EXPECT_TRUE(payload_state2.Initialize(&fake_system_state));