summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2020-03-04 02:03:35 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-04 02:03:35 +0000
commit8b92a153539931940b5ec32e93f46968d4988317 (patch)
tree15d571352ed7eff79847668bbeeb04f78bd4c44e /tests
parentfaa2340e534c5506dcf33e2791c2fac3d4a3b6f7 (diff)
parent379ec441d42cb6ea1f57f6b1ea656bf52e460f32 (diff)
Merge "BssidBlocklistStats - high movement metrics" into rvc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java3
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java9
2 files changed, 12 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
index 3c37cdfee..acac4f2f4 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
@@ -724,6 +724,8 @@ public class WifiConnectivityManagerTest extends WifiBaseTest {
// Verify a candidate if found this time.
verify(mClientModeImpl).startConnectToNetwork(
CANDIDATE_NETWORK_ID, Process.WIFI_UID, CANDIDATE_BSSID);
+ verify(mWifiMetrics, times(2)).incrementNumHighMovementConnectionSkipped();
+ verify(mWifiMetrics).incrementNumHighMovementConnectionStarted();
}
/**
@@ -802,6 +804,7 @@ public class WifiConnectivityManagerTest extends WifiBaseTest {
// Verify connect is not started.
verify(mClientModeImpl, never()).startConnectToNetwork(
CANDIDATE_NETWORK_ID, Process.WIFI_UID, CANDIDATE_BSSID);
+ verify(mWifiMetrics, times(2)).incrementNumHighMovementConnectionSkipped();
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index 41f06720b..c898c7ec2 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -1673,6 +1673,11 @@ public class WifiMetricsTest extends WifiBaseTest {
mWifiMetrics.incrementNetworkSelectionFilteredBssidCount(i);
}
mWifiMetrics.incrementNetworkSelectionFilteredBssidCount(2);
+ mResources.setBoolean(R.bool.config_wifiHighMovementNetworkSelectionOptimizationEnabled,
+ true);
+ mWifiMetrics.incrementNumHighMovementConnectionStarted();
+ mWifiMetrics.incrementNumHighMovementConnectionSkipped();
+ mWifiMetrics.incrementNumHighMovementConnectionSkipped();
dumpProtoAndDeserialize();
Int32Count[] expectedHistogram = {
@@ -1682,6 +1687,10 @@ public class WifiMetricsTest extends WifiBaseTest {
};
assertKeyCountsEqual(expectedHistogram,
mDecodedProto.bssidBlocklistStats.networkSelectionFilteredBssidCount);
+ assertEquals(true, mDecodedProto.bssidBlocklistStats
+ .highMovementMultipleScansFeatureEnabled);
+ assertEquals(1, mDecodedProto.bssidBlocklistStats.numHighMovementConnectionStarted);
+ assertEquals(2, mDecodedProto.bssidBlocklistStats.numHighMovementConnectionSkipped);
}
/**