summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMingguang Xu <mingguangxu@google.com>2019-04-23 06:00:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-23 06:00:22 +0000
commitb5f40c794badf717128b645225905948e6e5ea69 (patch)
tree544323fcfd0e3860f5c713f1843bf8c4dd10aea2 /tests
parent26baf9944cf023afe8dfba6d0e7619b57f6d1c79 (diff)
parentd9c0f4c52fbb2a0b0824688a8461a60874a675c2 (diff)
Merge "Wifi usability: Add timestamp in WifiUsabilityStats" into qt-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index d3b6b2ff8..4fa4e48bb 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -3243,6 +3243,8 @@ public class WifiMetricsTest {
WifiInfo info = mock(WifiInfo.class);
when(info.getRssi()).thenReturn(nextRandInt());
when(info.getLinkSpeed()).thenReturn(nextRandInt());
+ long eventTimeMs = nextRandInt();
+ when(mClock.getElapsedSinceBootMillis()).thenReturn(eventTimeMs);
WifiLinkLayerStats stats1 = nextRandomStats(new WifiLinkLayerStats());
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats1);
@@ -3258,6 +3260,7 @@ public class WifiMetricsTest {
assertEquals(WifiUsabilityStats.LABEL_GOOD, statsList[0].label);
assertEquals(WifiUsabilityStats.LABEL_BAD, statsList[1].label);
assertEquals(WifiIsUnusableEvent.TYPE_FIRMWARE_ALERT, statsList[1].triggerType);
+ assertEquals(eventTimeMs, statsList[1].timeStampMs);
assertEquals(2, statsList[1].firmwareAlertCode);
}
@@ -3271,6 +3274,8 @@ public class WifiMetricsTest {
WifiInfo info = mock(WifiInfo.class);
when(info.getRssi()).thenReturn(nextRandInt());
when(info.getLinkSpeed()).thenReturn(nextRandInt());
+ long eventTimeMs = nextRandInt();
+ when(mClock.getElapsedSinceBootMillis()).thenReturn(eventTimeMs);
WifiLinkLayerStats stats1 = nextRandomStats(new WifiLinkLayerStats());
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats1);
@@ -3286,6 +3291,7 @@ public class WifiMetricsTest {
assertEquals(WifiUsabilityStats.LABEL_BAD, statsList[1].label);
assertEquals(WifiIsUnusableEvent.TYPE_DATA_STALL_BAD_TX, statsList[1].triggerType);
assertEquals(-1, statsList[1].firmwareAlertCode);
+ assertEquals(eventTimeMs, statsList[1].timeStampMs);
}
/**
@@ -3608,6 +3614,8 @@ public class WifiMetricsTest {
WifiInfo info = mock(WifiInfo.class);
when(info.getRssi()).thenReturn(nextRandInt());
when(info.getLinkSpeed()).thenReturn(nextRandInt());
+ long eventTimeMs = nextRandInt();
+ when(mClock.getElapsedSinceBootMillis()).thenReturn(eventTimeMs);
WifiLinkLayerStats stats1 = nextRandomStats(new WifiLinkLayerStats());
mWifiMetrics.updateWifiUsabilityStatsEntries(info, stats1);
@@ -3622,6 +3630,7 @@ public class WifiMetricsTest {
WifiUsabilityStats[] statsList = mDecodedProto.wifiUsabilityStatsList;
assertEquals(WifiUsabilityStats.LABEL_BAD, statsList[1].label);
assertEquals(WifiUsabilityStats.TYPE_IP_REACHABILITY_LOST, statsList[1].triggerType);
+ assertEquals(eventTimeMs, statsList[1].timeStampMs);
}
/**