summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitchell Wills <mwills@google.com>2016-05-03 17:23:38 -0700
committerMitchell Wills <mwills@google.com>2016-05-03 17:34:25 -0700
commit59298c7cfffdf856e32879ec967fe27c7e977a49 (patch)
tree8bd1d07b147ac64fbe9a0600bc56b8d593ff27e6 /tests
parent3d0be5a31795cb4cd74a2793bcd1c8c52aa8bfca (diff)
Add more details about what scan results were delivered to clients
Fixes: 28563549 Change-Id: I445054af4b176c69a26af6fe340a6eb88cf06452
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java26
1 files changed, 24 insertions, 2 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 30580ab7e..1fb0f951a 100644
--- a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java
@@ -292,7 +292,17 @@ public class WifiScanningServiceTest {
Pattern logLineRegex = Pattern.compile("^.+" + type + ": ClientInfo\\[uid=\\d+\\],Id=" +
id + ".*$", Pattern.MULTILINE);
assertTrue("dump did not contain log with type=" + type + ", id=" + id +
- " for scan request: " + serviceDump + "\n",
+ ": " + serviceDump + "\n",
+ logLineRegex.matcher(serviceDump).find());
+ }
+
+ private void assertDumpContainsCallbackLog(String callback, int id, String extra) {
+ String serviceDump = dumpService();
+ String extraPattern = extra == null ? "" : "," + extra;
+ Pattern logLineRegex = Pattern.compile("^.+" + callback + ": ClientInfo\\[uid=\\d+\\],Id=" +
+ id + extraPattern + "$", Pattern.MULTILINE);
+ assertTrue("dump did not contain callback log with callback=" + callback + ", id=" + id +
+ ", extra=" + extra + ": " + serviceDump + "\n",
logLineRegex.matcher(serviceDump).find());
}
@@ -372,7 +382,8 @@ public class WifiScanningServiceTest {
verifySingleScanCompletedRecieved(order, handler, requestId);
verifyNoMoreInteractions(handler);
assertDumpContainsRequestLog("addSingleScanRequest", requestId);
- assertDumpContainsRequestLog("singleScanResults", requestId);
+ assertDumpContainsCallbackLog("singleScanResults", requestId,
+ "results=" + results.getRawScanResults().length);
}
/**
@@ -702,6 +713,16 @@ public class WifiScanningServiceTest {
}
assertEquals(mWifiMetrics.getOneshotScanCount(), 3);
assertEquals(mWifiMetrics.getScanReturnEntry(WifiMetricsProto.WifiLog.SCAN_SUCCESS), 3);
+
+ assertDumpContainsRequestLog("addSingleScanRequest", requestId1);
+ assertDumpContainsRequestLog("addSingleScanRequest", requestId2);
+ assertDumpContainsRequestLog("addSingleScanRequest", requestId3);
+ assertDumpContainsCallbackLog("singleScanResults", requestId1,
+ "results=" + results1.getRawScanResults().length);
+ assertDumpContainsCallbackLog("singleScanResults", requestId2,
+ "results=" + results2.getRawScanResults().length);
+ assertDumpContainsCallbackLog("singleScanResults", requestId3,
+ "results=" + results3.getRawScanResults().length);
}
private void doSuccessfulBackgroundScan(WifiScanner.ScanSettings requestSettings,
@@ -720,6 +741,7 @@ public class WifiScanningServiceTest {
verifyStartBackgroundScan(order, nativeSettings);
verifySuccessfulResponse(order, handler, 12);
verifyNoMoreInteractions(handler);
+ assertDumpContainsRequestLog("addBackgroundScanRequest", 12);
}
/**