diff options
author | Roshan Pius <rpius@google.com> | 2019-11-14 13:03:43 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-11-18 11:37:58 -0800 |
commit | 24047e6933dcabd530fb2886ee343fded08b2604 (patch) | |
tree | 03bc753779f3aecc35c5e69d5a7928d29cb8d7cf /tests | |
parent | 7703348beff18ed6cfe4abec9e4d8ab227833c85 (diff) |
WifiConfigStore: Support more than 1 shared store file
This is in preparation to move softap configuration to WifiConfigStore.
Bug: 144487256
Test: atest com.android.server.wifi
Change-Id: I42836a06b97b8539a70e71cfee8ec1d25579c3d9
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java | 6 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java | 5 |
2 files changed, 2 insertions, 9 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java index 895a169a1..460223e8e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java @@ -211,7 +211,6 @@ public class WifiConfigManagerTest extends WifiBaseTest { .updateNetworkKeys(any(WifiConfiguration.class), any())) .thenReturn(true); - when(mWifiConfigStore.areStoresPresent()).thenReturn(true); setupStoreDataForRead(new ArrayList<>(), new ArrayList<>(), new HashMap<>()); when(mWifiPermissionsUtil.checkNetworkSettingsPermission(anyInt())).thenReturn(true); @@ -3756,8 +3755,6 @@ public class WifiConfigManagerTest extends WifiBaseTest { */ @Test public void testFreshInstallLoadFromStore() throws Exception { - when(mWifiConfigStore.areStoresPresent()).thenReturn(false); - assertTrue(mWifiConfigManager.loadFromStore()); verify(mWifiConfigStore).read(); @@ -3772,8 +3769,6 @@ public class WifiConfigManagerTest extends WifiBaseTest { */ @Test public void testFreshInstallLoadFromStoreAfterUserUnlock() throws Exception { - when(mWifiConfigStore.areStoresPresent()).thenReturn(false); - int user1 = TEST_DEFAULT_USER; // Unlock the user1 (default user) for the first time and ensure that we don't read the @@ -3795,7 +3790,6 @@ public class WifiConfigManagerTest extends WifiBaseTest { @Test public void testHandleUserSwitchAfterFreshInstall() throws Exception { int user2 = TEST_DEFAULT_USER + 1; - when(mWifiConfigStore.areStoresPresent()).thenReturn(false); assertTrue(mWifiConfigManager.loadFromStore()); verify(mWifiConfigStore).read(); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java index 06a246593..814dc6134 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigStoreTest.java @@ -51,6 +51,7 @@ import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -212,7 +213,7 @@ public class WifiConfigStoreTest extends WifiBaseTest { setupMocks(); mWifiConfigStore = new WifiConfigStore(mContext, new Handler(mLooper.getLooper()), mClock, - mWifiMetrics, mSharedStore); + mWifiMetrics, Arrays.asList(mSharedStore)); // Enable verbose logging before tests. mWifiConfigStore.enableVerboseLogging(true); } @@ -420,7 +421,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { // |readRawData| would return null. mWifiConfigStore.registerStoreData(sharedStoreData); mWifiConfigStore.registerStoreData(userStoreData); - assertFalse(mWifiConfigStore.areStoresPresent()); mWifiConfigStore.read(); // Ensure that we got the call to deserialize empty shared data, but no user data. @@ -450,7 +450,6 @@ public class WifiConfigStoreTest extends WifiBaseTest { mWifiConfigStore.registerStoreData(userStoreData); // Read both share and user config store. mWifiConfigStore.setUserStores(mUserStores); - assertFalse(mWifiConfigStore.areStoresPresent()); mWifiConfigStore.read(); // Ensure that we got the call to deserialize empty shared & user data. |