summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-04-12 09:34:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-12 09:34:07 +0000
commite4a99c6c3d3ce34ac33c7fb63fc4202468580a91 (patch)
tree0884add557829144230e04c96329819535b4b798 /tests
parent6232408a5fc660b2d8642d56747e05c15c6255b8 (diff)
parent781fa6d27f15a1e3b8cc3d3cd7aaa63b38c8d56e (diff)
Merge "Fix START_WPS null exception" into oc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index d3da2e761..20dd11757 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -1545,4 +1545,20 @@ public class WifiStateMachineTest {
addNetworkAndVerifySuccess(false);
verify(mWifiConnectivityManager, never()).setUserConnectChoice(eq(0));
}
+
+ /**
+ * Test START_WPS with a null wpsInfo object fails gracefully (No NPE)
+ */
+ @Test
+ public void testStartWps_nullWpsInfo() throws Exception {
+ loadComponentsInStaMode();
+ mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE);
+ assertEquals(WifiStateMachine.CONNECT_MODE, mWsm.getOperationalModeForTest());
+ assertEquals("DisconnectedState", getCurrentState().getName());
+ mLooper.startAutoDispatch();
+ Message reply = mWsmAsyncChannel.sendMessageSynchronously(WifiManager.START_WPS, 0, 0,
+ null);
+ mLooper.stopAutoDispatch();
+ assertEquals(WifiManager.WPS_FAILED, reply.what);
+ }
}