summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-05-24 20:20:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-05-24 20:21:05 +0000
commit78156cd914c78f7bd427b85d4b5ebf338d8166c3 (patch)
tree561f6efcd2e7fc6d56eb8f763b6700b6217eba1c /tests
parent42e4920fdc3ad70f437f7a5967169b06116f1c62 (diff)
parent2a0ad34fff0956b85afa702617a3322ca85c3dca (diff)
Merge "WifiMetrics: Add methods to increment new hal/cond metrics" into oc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java22
1 files changed, 22 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 4d9c906ea..1c09cac38 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -231,6 +231,10 @@ public class WifiMetricsTest {
private static final int NUM_SOFTAP_START_SUCCESS = 3;
private static final int NUM_SOFTAP_FAILED_GENERAL_ERROR = 2;
private static final int NUM_SOFTAP_FAILED_NO_CHANNEL = 1;
+ private static final int NUM_HAL_CRASHES = 11;
+ private static final int NUM_WIFICOND_CRASHES = 12;
+ private static final int NUM_WIFI_ON_FAILURE_DUE_TO_HAL = 13;
+ private static final int NUM_WIFI_ON_FAILURE_DUE_TO_WIFICOND = 14;
private ScanDetail buildMockScanDetail(boolean hidden, NetworkDetail.HSRelease hSRelease,
String capabilities) {
@@ -403,6 +407,18 @@ public class WifiMetricsTest {
mWifiMetrics.incrementSoftApStartResult(false,
WifiManager.SAP_START_FAILURE_NO_CHANNEL);
}
+ for (int i = 0; i < NUM_HAL_CRASHES; i++) {
+ mWifiMetrics.incrementNumHalCrashes();
+ }
+ for (int i = 0; i < NUM_WIFICOND_CRASHES; i++) {
+ mWifiMetrics.incrementNumWificondCrashes();
+ }
+ for (int i = 0; i < NUM_WIFI_ON_FAILURE_DUE_TO_HAL; i++) {
+ mWifiMetrics.incrementNumWifiOnFailureDueToHal();
+ }
+ for (int i = 0; i < NUM_WIFI_ON_FAILURE_DUE_TO_WIFICOND; i++) {
+ mWifiMetrics.incrementNumWifiOnFailureDueToWificond();
+ }
}
/**
@@ -539,6 +555,12 @@ public class WifiMetricsTest {
mDeserializedWifiMetrics.softApReturnCode[2].startResult);
assertEquals(NUM_SOFTAP_FAILED_NO_CHANNEL,
mDeserializedWifiMetrics.softApReturnCode[2].count);
+ assertEquals(NUM_HAL_CRASHES, mDeserializedWifiMetrics.numHalCrashes);
+ assertEquals(NUM_WIFICOND_CRASHES, mDeserializedWifiMetrics.numWificondCrashes);
+ assertEquals(NUM_WIFI_ON_FAILURE_DUE_TO_HAL,
+ mDeserializedWifiMetrics.numWifiOnFailureDueToHal);
+ assertEquals(NUM_WIFI_ON_FAILURE_DUE_TO_WIFICOND,
+ mDeserializedWifiMetrics.numWifiOnFailureDueToWificond);
}
/**