diff options
author | Rebecca Silberstein <silberst@google.com> | 2017-03-23 18:33:28 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-23 18:33:29 +0000 |
commit | 9fe2d67c7529c922f71d6dbc2e10fc65d141a11c (patch) | |
tree | 7c9d00e7e70e9394f706d033c3c4d93ee859a8a0 /tests | |
parent | 7a74c36073dfe94717b24741538502f9781140cb (diff) | |
parent | e7f3bdb1ecc717966166c8397a0d49b6493ba637 (diff) |
Merge "WifiStateMachineTest: update string matchers"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java | 20 |
1 files changed, 12 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 5755d9c4e..cc8535318 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java @@ -1288,14 +1288,15 @@ public class WifiStateMachineTest { mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE); mLooper.dispatchAll(); - when(mWifiNative.startWpsPbc(anyString())).thenReturn(true); + when(mWifiNative.startWpsPbc(eq(sBSSID))).thenReturn(true); WpsInfo wpsInfo = new WpsInfo(); wpsInfo.setup = WpsInfo.PBC; + wpsInfo.BSSID = sBSSID; mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); mLooper.stopAutoDispatch(); - verify(mWifiNative).startWpsPbc(anyString()); + verify(mWifiNative).startWpsPbc(eq(sBSSID)); assertEquals("WpsRunningState", getCurrentState().getName()); @@ -1317,14 +1318,15 @@ public class WifiStateMachineTest { mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE); mLooper.dispatchAll(); - when(mWifiNative.startWpsPbc(anyString())).thenReturn(false); + when(mWifiNative.startWpsPbc(eq(sBSSID))).thenReturn(false); WpsInfo wpsInfo = new WpsInfo(); wpsInfo.setup = WpsInfo.PBC; + wpsInfo.BSSID = sBSSID; mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); mLooper.stopAutoDispatch(); - verify(mWifiNative).startWpsPbc(anyString()); + verify(mWifiNative).startWpsPbc(eq(sBSSID)); assertFalse("WpsRunningState".equals(getCurrentState().getName())); } @@ -1338,14 +1340,15 @@ public class WifiStateMachineTest { mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE); mLooper.dispatchAll(); - when(mWifiNative.startWpsPinDisplay(anyString())).thenReturn("34545434"); + when(mWifiNative.startWpsPinDisplay(eq(sBSSID))).thenReturn("34545434"); WpsInfo wpsInfo = new WpsInfo(); wpsInfo.setup = WpsInfo.DISPLAY; + wpsInfo.BSSID = sBSSID; mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); mLooper.stopAutoDispatch(); - verify(mWifiNative).startWpsPinDisplay(anyString()); + verify(mWifiNative).startWpsPinDisplay(eq(sBSSID)); assertEquals("WpsRunningState", getCurrentState().getName()); @@ -1367,14 +1370,15 @@ public class WifiStateMachineTest { mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE); mLooper.dispatchAll(); - when(mWifiNative.startWpsPinDisplay(anyString())).thenReturn(null); + when(mWifiNative.startWpsPinDisplay(eq(sBSSID))).thenReturn(null); WpsInfo wpsInfo = new WpsInfo(); wpsInfo.setup = WpsInfo.DISPLAY; + wpsInfo.BSSID = sBSSID; mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); mLooper.stopAutoDispatch(); - verify(mWifiNative).startWpsPinDisplay(anyString()); + verify(mWifiNative).startWpsPinDisplay(eq(sBSSID)); assertFalse("WpsRunningState".equals(getCurrentState().getName())); } |