summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-09-08 15:50:42 -0700
committerRoshan Pius <rpius@google.com>2016-09-13 13:18:41 -0700
commitcdd9c486c7c3282ba95f4b52c68457b4ff12e93f (patch)
treeb2d46bc005fb80b023079d6fe3e2b1854ab290f7 /tests
parent42ed8f87e72cdf7780dc3cc87da751253a6d74ed (diff)
WifiConfigManager: Trigger buffered store writes
Trigger buffered store writes for frequently occuring internal configuration updates. The buffered write API of WifiConfigStore batches together all writes in a 10 second window. While there, Convert the scan detail cache to a normal hash map. This was a concurrent hash map in the old config manager. But, there are no multithreading concerns in the wifi stack now. BUG: 31380765 TEST: Unit tests Change-Id: I537af4f02e9bf3a50de1883598118077d8eab583
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index e576967b7..4edf324df 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -997,7 +997,7 @@ public class WifiConfigManagerTest {
* {@link WifiConfigManager#updateNetworkAfterConnect(int)} is invoked.
*/
@Test
- public void testUpdateConfigAfterConnect() {
+ public void testUpdateConfigAfterConnectHasEverConnectedTrue() {
WifiConfiguration openNetwork = WifiConfigurationTestUtil.createOpenNetwork();
verifyAddNetworkHasEverConnectedFalse(openNetwork);
verifyUpdateNetworkAfterConnectHasEverConnectedTrue(openNetwork.networkId);
@@ -1969,6 +1969,11 @@ public class WifiConfigManagerTest {
assertNotEquals(
network2.configKey(),
retrievedNetwork.getNetworkSelectionStatus().getConnectChoice());
+
+ // This should have triggered 2 buffered writes. 1 for setting the connect choice, 1 for
+ // clearing it after network removal.
+ mContextConfigStoreMockOrder.verify(mWifiConfigStore, times(2))
+ .write(eq(false), any(WifiConfigStoreData.class));
}
/**