summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@google.com>2017-04-01 15:29:38 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-04-01 15:29:38 +0000
commitace3b44de5691c5b3d4097f29ef3001b3754f125 (patch)
treecc347272cd42578cea404d4435c7454196eeb193 /tests
parentd2dba288d79962fea5bfa6057faa8ee786a66c61 (diff)
parent9eacd39e43a93090038e24b6145735408b774387 (diff)
Merge "Revert "hotspot2: track creator UID for installed providers"" into oc-dev
am: 9eacd39e43 Change-Id: I02670ba449c43d14cfb578b0554cf4248dd34b91
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java12
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java6
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java35
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java3
4 files changed, 26 insertions, 30 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index b64ea0d90..7ef8d2b69 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -1199,19 +1199,19 @@ public class WifiStateMachineTest {
*/
@Test
public void syncAddOrUpdatePasspointConfig() throws Exception {
- when(mPasspointManager.addOrUpdateProvider(any(PasspointConfiguration.class),
- eq(MANAGED_PROFILE_UID))).thenReturn(true);
+ when(mPasspointManager.addOrUpdateProvider(any(PasspointConfiguration.class)))
+ .thenReturn(true);
mLooper.startAutoDispatch();
assertTrue(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel,
- new PasspointConfiguration(), MANAGED_PROFILE_UID));
+ new PasspointConfiguration()));
mLooper.stopAutoDispatch();
reset(mPasspointManager);
- when(mPasspointManager.addOrUpdateProvider(any(PasspointConfiguration.class),
- eq(MANAGED_PROFILE_UID))).thenReturn(false);
+ when(mPasspointManager.addOrUpdateProvider(any(PasspointConfiguration.class)))
+ .thenReturn(false);
mLooper.startAutoDispatch();
assertFalse(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel,
- new PasspointConfiguration(), MANAGED_PROFILE_UID));
+ new PasspointConfiguration()));
mLooper.stopAutoDispatch();
}
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
index cd3120f9e..5b2eabfd3 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigStoreDataTest.java
@@ -59,7 +59,6 @@ public class PasspointConfigStoreDataTest {
private static final String TEST_CLIENT_CERTIFICATE_ALIAS = "ClientCert";
private static final String TEST_CLIENT_PRIVATE_KEY_ALIAS = "ClientPrivateKey";
private static final long TEST_PROVIDER_ID = 1;
- private static final int TEST_CREATOR_UID = 1234;
@Mock WifiKeyStore mKeyStore;
@Mock SIMAccessor mSimAccessor;
@@ -235,9 +234,8 @@ public class PasspointConfigStoreDataTest {
// Setup expected data.
List<PasspointProvider> providerList = new ArrayList<>();
providerList.add(new PasspointProvider(createFullPasspointConfiguration(),
- mKeyStore, mSimAccessor, TEST_PROVIDER_ID, TEST_CREATOR_UID,
- TEST_CA_CERTIFICATE_ALIAS, TEST_CLIENT_CERTIFICATE_ALIAS,
- TEST_CLIENT_PRIVATE_KEY_ALIAS));
+ mKeyStore, mSimAccessor, TEST_PROVIDER_ID, TEST_CA_CERTIFICATE_ALIAS,
+ TEST_CLIENT_CERTIFICATE_ALIAS, TEST_CLIENT_PRIVATE_KEY_ALIAS));
// Serialize data for user store.
when(mDataSource.getProviders()).thenReturn(providerList);
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
index c8ca7139d..28d7e2df0 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointManagerTest.java
@@ -106,7 +106,6 @@ public class PasspointManagerTest {
private static final int TEST_ANQP_DOMAIN_ID = 0;
private static final ANQPNetworkKey TEST_ANQP_KEY = ANQPNetworkKey.buildKey(
TEST_SSID, TEST_BSSID, TEST_HESSID, TEST_ANQP_DOMAIN_ID);
- private static final int TEST_CREATOR_UID = 1234;
@Mock Context mContext;
@Mock WifiNative mWifiNative;
@@ -249,8 +248,8 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
+ eq(mSimAccessor), anyLong())).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config));
return provider;
}
@@ -400,7 +399,7 @@ public class PasspointManagerTest {
*/
@Test
public void addProviderWithNullConfig() throws Exception {
- assertFalse(mManager.addOrUpdateProvider(null, TEST_CREATOR_UID));
+ assertFalse(mManager.addOrUpdateProvider(null));
}
/**
@@ -410,7 +409,7 @@ public class PasspointManagerTest {
*/
@Test
public void addProviderWithEmptyConfig() throws Exception {
- assertFalse(mManager.addOrUpdateProvider(new PasspointConfiguration(), TEST_CREATOR_UID));
+ assertFalse(mManager.addOrUpdateProvider(new PasspointConfiguration()));
}
/**
@@ -424,7 +423,7 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
// EAP-TLS not allowed for user credential.
config.getCredential().getUserCredential().setEapType(EAPConstants.EAP_TLS);
- assertFalse(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
+ assertFalse(mManager.addOrUpdateProvider(config));
}
/**
@@ -437,8 +436,8 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithUserCredential();
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
+ eq(mSimAccessor), anyLong())).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config));
verifyInstalledConfig(config);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
@@ -472,8 +471,8 @@ public class PasspointManagerTest {
PasspointConfiguration config = createTestConfigWithSimCredential();
PasspointProvider provider = createMockProvider(config);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
+ eq(mSimAccessor), anyLong())).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config));
verifyInstalledConfig(config);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
@@ -510,8 +509,8 @@ public class PasspointManagerTest {
PasspointConfiguration origConfig = createTestConfigWithSimCredential();
PasspointProvider origProvider = createMockProvider(origConfig);
when(mObjectFactory.makePasspointProvider(eq(origConfig), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(origProvider);
- assertTrue(mManager.addOrUpdateProvider(origConfig, TEST_CREATOR_UID));
+ eq(mSimAccessor), anyLong())).thenReturn(origProvider);
+ assertTrue(mManager.addOrUpdateProvider(origConfig));
verifyInstalledConfig(origConfig);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
@@ -527,8 +526,8 @@ public class PasspointManagerTest {
PasspointConfiguration newConfig = createTestConfigWithUserCredential();
PasspointProvider newProvider = createMockProvider(newConfig);
when(mObjectFactory.makePasspointProvider(eq(newConfig), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(newProvider);
- assertTrue(mManager.addOrUpdateProvider(newConfig, TEST_CREATOR_UID));
+ eq(mSimAccessor), anyLong())).thenReturn(newProvider);
+ assertTrue(mManager.addOrUpdateProvider(newConfig));
verifyInstalledConfig(newConfig);
verify(mWifiConfigManager).saveToStore(true);
@@ -551,8 +550,8 @@ public class PasspointManagerTest {
PasspointProvider provider = mock(PasspointProvider.class);
when(provider.installCertsAndKeys()).thenReturn(false);
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), anyLong(), eq(TEST_CREATOR_UID))).thenReturn(provider);
- assertFalse(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
+ eq(mSimAccessor), anyLong())).thenReturn(provider);
+ assertFalse(mManager.addOrUpdateProvider(config));
}
/**
@@ -815,8 +814,8 @@ public class PasspointManagerTest {
PasspointProvider provider = createMockProvider(config);
// Verify the provider ID used to create the new provider.
when(mObjectFactory.makePasspointProvider(eq(config), eq(mWifiKeyStore),
- eq(mSimAccessor), eq(providerIndex), eq(TEST_CREATOR_UID))).thenReturn(provider);
- assertTrue(mManager.addOrUpdateProvider(config, TEST_CREATOR_UID));
+ eq(mSimAccessor), eq(providerIndex))).thenReturn(provider);
+ assertTrue(mManager.addOrUpdateProvider(config));
verifyInstalledConfig(config);
verify(mWifiConfigManager).saveToStore(true);
reset(mWifiConfigManager);
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
index c416a961a..afa04b549 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointProviderTest.java
@@ -67,7 +67,6 @@ import java.util.Set;
@SmallTest
public class PasspointProviderTest {
private static final long PROVIDER_ID = 12L;
- private static final int CREATOR_UID = 1234;
private static final String CA_CERTIFICATE_NAME = "CACERT_HS2_12";
private static final String CLIENT_CERTIFICATE_NAME = "USRCERT_HS2_12";
private static final String CLIENT_PRIVATE_KEY_NAME = "USRPKEY_HS2_12";
@@ -92,7 +91,7 @@ public class PasspointProviderTest {
* @return {@link com.android.server.wifi.hotspot2.PasspointProvider}
*/
private PasspointProvider createProvider(PasspointConfiguration config) {
- return new PasspointProvider(config, mKeyStore, mSimAccessor, PROVIDER_ID, CREATOR_UID);
+ return new PasspointProvider(config, mKeyStore, mSimAccessor, PROVIDER_ID);
}
/**