summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAmin Shaikh <ashaikh@google.com>2016-12-12 17:11:06 -0800
committerAmin Shaikh <ashaikh@google.com>2016-12-21 11:46:44 -0800
commite8d771c2638ee06a3c06b676daf6a87fa85cdcd9 (patch)
tree0b16c46b2df4acc529fc6f63dbc6d52ed551794a /tests
parent56924e1d3b0d360406d661f051d500e6bc16a953 (diff)
Expose ScanResult#untrusted as a @SystemApi.
- Expose ScanResult#untrusted to inform NetworkRecommendationProviders that a ScanResult does not correspond to a saved network. - Add static construction methods and assertions to RecommendationResult Test: Updated RecommendedNetworkEvaluatorTest Bug: 33490132 Change-Id: I48279b7ab88fedefeea034a5f6e07731f653e448 Merged-In: I48279b7ab88fedefeea034a5f6e07731f653e448
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/RecommendedNetworkEvaluatorTest.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/RecommendedNetworkEvaluatorTest.java b/tests/wifitests/src/com/android/server/wifi/RecommendedNetworkEvaluatorTest.java
index 6c7b18255..9c1898d7d 100644
--- a/tests/wifitests/src/com/android/server/wifi/RecommendedNetworkEvaluatorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/RecommendedNetworkEvaluatorTest.java
@@ -162,7 +162,8 @@ public class RecommendedNetworkEvaluatorTest {
public void testEvaluateNetworks_recommendation_onlyTrustedNetworkAllowed() {
when(mWifiConfigManager.wasEphemeralNetworkDeleted(anyString())).thenReturn(false);
when(mNetworkScoreManager.requestRecommendation(any(RecommendationRequest.class)))
- .thenReturn(new RecommendationResult(TRUSTED_WIFI_CONFIGURATION));
+ .thenReturn(RecommendationResult
+ .createConnectRecommendation(TRUSTED_WIFI_CONFIGURATION));
WifiConfiguration result = mRecommendedNetworkEvaluator.evaluateNetworks(
Lists.newArrayList(TRUSTED_SCAN_DETAIL, UNTRUSTED_SCAN_DETAIL),
@@ -179,7 +180,8 @@ public class RecommendedNetworkEvaluatorTest {
public void testEvaluateNetworks_recommendation_untrustedNetworksAllowed() {
when(mWifiConfigManager.wasEphemeralNetworkDeleted(anyString())).thenReturn(false);
when(mNetworkScoreManager.requestRecommendation(any(RecommendationRequest.class)))
- .thenReturn(new RecommendationResult(TRUSTED_WIFI_CONFIGURATION));
+ .thenReturn(RecommendationResult
+ .createConnectRecommendation(TRUSTED_WIFI_CONFIGURATION));
WifiConfiguration result = mRecommendedNetworkEvaluator.evaluateNetworks(
Lists.newArrayList(TRUSTED_SCAN_DETAIL, UNTRUSTED_SCAN_DETAIL),
@@ -195,10 +197,10 @@ public class RecommendedNetworkEvaluatorTest {
}
@Test
- public void testEvaluateNetworks_noRecommendation_untrustedNetworksAllowed() {
+ public void testEvaluateNetworks_doNotConnectRecommendation_untrustedNetworksAllowed() {
when(mWifiConfigManager.wasEphemeralNetworkDeleted(anyString())).thenReturn(false);
when(mNetworkScoreManager.requestRecommendation(any(RecommendationRequest.class)))
- .thenReturn(new RecommendationResult(null));
+ .thenReturn(RecommendationResult.createDoNotConnectRecommendation());
WifiConfiguration result = mRecommendedNetworkEvaluator.evaluateNetworks(
Lists.newArrayList(TRUSTED_SCAN_DETAIL, UNTRUSTED_SCAN_DETAIL),