summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2017-06-01 22:00:49 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-01 22:00:50 +0000
commit13610da7d3a18a66e505b299c63f93e080ad7f9a (patch)
tree4c1bfc2b84a0413ef04cf79308ab73e3d15818a0 /tests
parent67a334898c38341f4e945d5746e6619971a0d30f (diff)
parentc5742a340a7cc7d1d66b12d35103fa6b0a6633c5 (diff)
Merge "[AWARE] Perform delayed initialization on Aware thread"
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java5
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java
index 9fc8fe383..4985fe333 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareDataPathStateManagerTest.java
@@ -91,6 +91,7 @@ public class WifiAwareDataPathStateManagerTest {
private TestLooper mMockLooper;
private Handler mMockLooperHandler;
private WifiAwareStateManager mDut;
+ @Mock private WifiAwareNativeManager mMockNativeManager;
@Mock private WifiAwareNativeApi mMockNative;
@Mock private Context mMockContext;
@Mock private IWifiAwareManager mMockAwareService;
@@ -130,9 +131,10 @@ public class WifiAwareDataPathStateManagerTest {
when(mMockContext.getSystemService(PowerManager.class)).thenReturn(mMockPowerManager);
mDut = new WifiAwareStateManager();
- mDut.setNative(mMockNative);
+ mDut.setNative(mMockNativeManager, mMockNative);
mDut.start(mMockContext, mMockLooper.getLooper(), mAwareMetricsMock);
mDut.startLate();
+ mMockLooper.dispatchAll();
when(mMockNative.getCapabilities(anyShort())).thenReturn(true);
when(mMockNative.enableAndConfigure(anyShort(), any(), anyBoolean(),
diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java
index d146c6710..6947d6af3 100644
--- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java
@@ -146,8 +146,10 @@ public class WifiAwareStateManagerTest {
ArgumentCaptor<BroadcastReceiver> bcastRxCaptor = ArgumentCaptor.forClass(
BroadcastReceiver.class);
mDut = new WifiAwareStateManager();
- mDut.setNative(mMockNative);
+ mDut.setNative(mMockNativeManager, mMockNative);
mDut.start(mMockContext, mMockLooper.getLooper(), mAwareMetricsMock);
+ mDut.startLate();
+ mMockLooper.dispatchAll();
verify(mMockContext).registerReceiver(bcastRxCaptor.capture(), any(IntentFilter.class));
mPowerBcastReceiver = bcastRxCaptor.getValue();
installMocksInStateManager(mDut, mMockAwareRttStateManager, mMockAwareDataPathStatemanager);
@@ -2945,6 +2947,7 @@ public class WifiAwareStateManagerTest {
ArgumentCaptor<Short> transactionId = ArgumentCaptor.forClass(Short.class);
IWifiAwareEventCallback mockCallback = mock(IWifiAwareEventCallback.class);
InOrder inOrder = inOrder(mMockContext, mMockNativeManager, mMockNative, mockCallback);
+ inOrder.verify(mMockNativeManager).start();
mDut.enableUsage();
mMockLooper.dispatchAll();