summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Plass <mplass@google.com>2017-02-15 17:46:20 -0800
committerMichael Plass <mplass@google.com>2017-02-22 23:27:53 -0800
commit2f0db656f678c8cf1ab6643739c6d0059721e6e2 (patch)
tree408d56e0f11f81d464f266ec463ae90fe4439936 /tests
parentd53f9a8246a98a43f44983b1286ddf4a944d6571 (diff)
[WifiVendorHal] Request vendor debug info
Add two calls to get vendor debug info, one for the driver and one for the firmare. Test: Two new unit tests Bug: 34901966 Change-Id: I83e9cf8000b7e7094e31847ac1724c4aec196008
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java
index 164ac2561..e0c970445 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java
@@ -952,4 +952,46 @@ public class WifiVendorHalTest {
verify(mIWifiChip).getDebugHostWakeReasonStats(
any(IWifiChip.getDebugHostWakeReasonStatsCallback.class));
}
+
+ /**
+ * Test that getFwMemoryDump is properly plumbed
+ */
+ @Test
+ public void testGetFwMemoryDump() throws Exception {
+ byte [] sample = NativeUtil.hexStringToByteArray("268c7a3fbfa4661c0bdd6a36");
+ ArrayList<Byte> halBlob = NativeUtil.byteArrayToArrayList(sample);
+
+ doAnswer(new AnswerWithArguments() {
+ public void answer(IWifiChip.requestFirmwareDebugDumpCallback cb)
+ throws RemoteException {
+ cb.onValues(mWifiStatusSuccess, halBlob);
+ }
+ }).when(mIWifiChip).requestFirmwareDebugDump(any(
+ IWifiChip.requestFirmwareDebugDumpCallback.class));
+
+ assertTrue(mWifiVendorHal.startVendorHalSta());
+ assertArrayEquals(sample, mWifiVendorHal.getFwMemoryDump());
+ }
+
+ /**
+ * Test that getDriverStateDump is properly plumbed
+ *
+ * Just for variety, use AP mode here.
+ */
+ @Test
+ public void testGetDriverStateDump() throws Exception {
+ byte [] sample = NativeUtil.hexStringToByteArray("e83ff543cf80083e6459d20f");
+ ArrayList<Byte> halBlob = NativeUtil.byteArrayToArrayList(sample);
+
+ doAnswer(new AnswerWithArguments() {
+ public void answer(IWifiChip.requestDriverDebugDumpCallback cb)
+ throws RemoteException {
+ cb.onValues(mWifiStatusSuccess, halBlob);
+ }
+ }).when(mIWifiChip).requestDriverDebugDump(any(
+ IWifiChip.requestDriverDebugDumpCallback.class));
+
+ assertTrue(mWifiVendorHal.startVendorHalAp());
+ assertArrayEquals(sample, mWifiVendorHal.getDriverStateDump());
+ }
}