diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-04-02 04:58:32 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-04-02 04:58:33 +0000 |
commit | 39521e6d1069bcaea1865452dc456dea357cf322 (patch) | |
tree | c94bf8d9a610d4b74b64f4fdfc0c5b88da5d1f1d /tests | |
parent | 242c6e4b322a66f2031d6bb58bfaae03384a33f1 (diff) | |
parent | 6ecd7a8dcde46e3524c15c4a07075ca06ab681b5 (diff) |
Merge "hotspot2: initiate disconnect when updating current network's provider" into oc-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java index c901227e0..80e29c6b1 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java @@ -1166,23 +1166,34 @@ public class WifiStateMachineTest { */ @Test public void syncAddOrUpdatePasspointConfig() throws Exception { - when(mPasspointManager.addOrUpdateProvider(any(PasspointConfiguration.class))) - .thenReturn(true); + PasspointConfiguration config = new PasspointConfiguration(); + HomeSp homeSp = new HomeSp(); + homeSp.setFqdn("test.com"); + config.setHomeSp(homeSp); + + when(mPasspointManager.addOrUpdateProvider(config)).thenReturn(true); mLooper.startAutoDispatch(); - assertTrue(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel, - new PasspointConfiguration())); + assertTrue(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel, config)); mLooper.stopAutoDispatch(); reset(mPasspointManager); - when(mPasspointManager.addOrUpdateProvider(any(PasspointConfiguration.class))) - .thenReturn(false); + when(mPasspointManager.addOrUpdateProvider(config)).thenReturn(false); mLooper.startAutoDispatch(); - assertFalse(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel, - new PasspointConfiguration())); + assertFalse(mWsm.syncAddOrUpdatePasspointConfig(mWsmAsyncChannel, config)); mLooper.stopAutoDispatch(); } /** + * Verify that syncAddOrUpdatePasspointConfig will redirect calls to {@link PasspointManager} + * and returning the result that's returned from {@link PasspointManager} when in client mode. + */ + @Test + public void syncAddOrUpdatePasspointConfigInClientMode() throws Exception { + loadComponentsInStaMode(); + syncAddOrUpdatePasspointConfig(); + } + + /** * Verify that syncRemovePasspointConfig will redirect calls to {@link PasspointManager} * and returning the result that's returned from {@link PasspointManager}. */ |