summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2018-04-04 20:12:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-04-04 20:12:33 +0000
commit3ad2dd15a73e20fde7ad4ae6676c06396c92257a (patch)
tree44b7043c65649601820ee766f17b00ccccb3920d /tests
parentf4ec51d3b9d8b4d7f6f9d4b9cf0832293a8cfb14 (diff)
parentb195838541edf2597659b217291079c52623d85c (diff)
Merge "WifiMetrics: Send a different error code for assoc timeout" into pi-dev
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 07737b281..c31ecb03d 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -1047,6 +1047,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