summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSohani Rao <sohanirao@google.com>2016-11-29 10:12:34 -0800
committerSohani Rao <sohanirao@google.com>2016-12-16 13:00:31 -0800
commit4fbaf3821bd5c3056c7c4cdd1aee3e17ac7046d0 (patch)
treec649a3458d0e296eed9a7e55a9b699e4b8ee2a53 /tests
parent5d5603055452debfeb6e958a17c419be516f4572 (diff)
Log API surfaces of WifiScanningService
Add logging to trace the following API surfaces in WifiScanningService - AIDL methods calls, - Async Channel messages sent to the scanning service - Use WifiHandler instead of Handler to define the client handler to trace incoming messsages - Async Channel messages sent by the service - Use WifiAsyncChannel to trace reply messages sent by the service - Fully connected Async Channel is used here, therefore, it can send messages directly to the client's messenger without using Async channel methods. Add logging in replySucceeded() and replyFailed() to trace messages sent by the service directly to the client. Bug: 33085782 Test: Unit test suite, verify logging, sanity test (power on and connect to Wifi Access Point) Change-Id: I8df4f4077801c359e11a93fde2c1ce5ea811a0e4
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
index 8e3be65cb..d99d290fa 100644
--- a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
@@ -48,6 +48,7 @@ import com.android.internal.util.AsyncChannel;
import com.android.internal.util.Protocol;
import com.android.internal.util.test.BidirectionalAsyncChannel;
import com.android.server.wifi.Clock;
+import com.android.server.wifi.FakeWifiLog;
import com.android.server.wifi.ScanResults;
import com.android.server.wifi.TestUtil;
import com.android.server.wifi.WifiInjector;
@@ -62,6 +63,7 @@ import org.mockito.ArgumentCaptor;
import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
+import org.mockito.Spy;
import org.mockito.internal.matchers.CapturingMatcher;
import java.io.FileDescriptor;
@@ -89,6 +91,7 @@ public class WifiScanningServiceTest {
@Mock IBatteryStats mBatteryStats;
@Mock WifiInjector mWifiInjector;
@Mock Clock mClock;
+ @Spy FakeWifiLog mLog;
WifiMetrics mWifiMetrics;
TestLooper mLooper;
WifiScanningServiceImpl mWifiScanningServiceImpl;
@@ -114,6 +117,7 @@ public class WifiScanningServiceTest {
.thenReturn(mWifiScannerImpl);
when(mWifiScannerImpl.getChannelHelper()).thenReturn(channelHelper);
when(mWifiInjector.getWifiMetrics()).thenReturn(mWifiMetrics);
+ when(mWifiInjector.makeLog(anyString())).thenReturn(mLog);
mWifiScanningServiceImpl = new WifiScanningServiceImpl(mContext, mLooper.getLooper(),
mWifiScannerImplFactory, mBatteryStats, mWifiInjector);
}