summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGlen Kuhne <kuh@google.com>2017-05-19 00:16:00 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-05-19 00:16:00 +0000
commit61274d029f2fba9a116cfb516fa113e26adb577d (patch)
treed73c537d5c158a392b023397ef93ba8930d58644 /tests
parent664f7b477ff05349510a14855e41220b411d9ff8 (diff)
parent59a3ed49892642ee146f7f140fc55c39fda7b7ea (diff)
Merge "P2P: Fix cancelServiceDiscovery mis-cast" into oc-dev
am: 59a3ed4989 Change-Id: I4cc116ecc2d425c00d39834c38e5182693d5c708
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceHalTest.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceHalTest.java b/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceHalTest.java
index 4f5864bca..2ac70bae5 100644
--- a/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/p2p/SupplicantP2pIfaceHalTest.java
@@ -1777,18 +1777,21 @@ public class SupplicantP2pIfaceHalTest {
assertFalse(mDut.isInitializationComplete());
}
+ // Test constant used in cancelServiceDiscovery tests
+ static final String SERVICE_IDENTIFIER_STR = "521918410304";
+ static final long SERVICE_IDENTIFIER_LONG = 521918410304L;
/**
* Sunny day scenario for cancelServiceDiscovery()
*/
@Test
public void testCancelServiceDiscovery_success() throws Exception {
- when(mISupplicantP2pIfaceMock.cancelServiceDiscovery(1234))
+ when(mISupplicantP2pIfaceMock.cancelServiceDiscovery(SERVICE_IDENTIFIER_LONG))
.thenReturn(mStatusSuccess);
// Default value when service is not initialized.
- assertFalse(mDut.cancelServiceDiscovery("1234"));
+ assertFalse(mDut.cancelServiceDiscovery(SERVICE_IDENTIFIER_STR));
executeAndValidateInitializationSequence(false, false, false);
- assertTrue(mDut.cancelServiceDiscovery("1234"));
+ assertTrue(mDut.cancelServiceDiscovery(SERVICE_IDENTIFIER_STR));
}
/**
@@ -1811,7 +1814,7 @@ public class SupplicantP2pIfaceHalTest {
executeAndValidateInitializationSequence(false, false, false);
when(mISupplicantP2pIfaceMock.cancelServiceDiscovery(anyLong()))
.thenReturn(mStatusFailure);
- assertFalse(mDut.cancelServiceDiscovery("1234"));
+ assertFalse(mDut.cancelServiceDiscovery(SERVICE_IDENTIFIER_STR));
// Check that service is still alive.
assertTrue(mDut.isInitializationComplete());
}
@@ -1824,7 +1827,7 @@ public class SupplicantP2pIfaceHalTest {
executeAndValidateInitializationSequence(false, false, false);
when(mISupplicantP2pIfaceMock.cancelServiceDiscovery(anyLong()))
.thenThrow(mRemoteException);
- assertFalse(mDut.cancelServiceDiscovery("1234"));
+ assertFalse(mDut.cancelServiceDiscovery(SERVICE_IDENTIFIER_STR));
// Check service is dead.
assertFalse(mDut.isInitializationComplete());
}