summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2018-03-22 09:28:06 -0700
committerRoshan Pius <rpius@google.com>2018-03-22 09:37:13 -0700
commitb195838541edf2597659b217291079c52623d85c (patch)
treec5bd01328226ee15f88cd361ad7862ae1573f534 /tests
parentee4e4d484fc699eea1492538b68c125782e57883 (diff)
WifiMetrics: Send a different error code for assoc timeout
Note: This and all the other connection failure codes should be moved to the proto file. Bug: 34280407 Test: Unit tests Change-Id: I1d8842475b3cadb15abebe60c612f685b7397ae0
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java20
1 files changed, 20 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 d823f5a50..9f93e495f 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -977,6 +977,26 @@ public class WifiMetricsTest {
}
/**
+ * Test that WifiMetrics is serializing/deserializing association time out events.
+ */
+ @Test
+ public void testMetricsAssociationTimedOut() throws Exception {
+ mWifiMetrics.startConnectionEvent(null, "RED",
+ WifiMetricsProto.ConnectionEvent.ROAM_NONE);
+ mWifiMetrics.endConnectionEvent(
+ WifiMetrics.ConnectionEvent.FAILURE_ASSOCIATION_TIMED_OUT,
+ WifiMetricsProto.ConnectionEvent.HLF_NONE);
+
+ //Dump proto and deserialize
+ //This should clear all the metrics in mWifiMetrics,
+ dumpProtoAndDeserialize();
+ //Check there is only 1 connection events
+ assertEquals(mDecodedProto.connectionEvent.length, 1);
+ assertEquals(mDecodedProto.connectionEvent[0].level2FailureCode,
+ WifiMetrics.ConnectionEvent.FAILURE_ASSOCIATION_TIMED_OUT);
+ }
+
+ /**
* Test that WifiMetrics is being cleared after dumping via proto
*/
@Test