From 135be5a123dd70bb4663396a28dda9d6c26956fc Mon Sep 17 00:00:00 2001 From: Michael Plass Date: Wed, 15 Feb 2017 15:59:11 -0800 Subject: [WifiVendorHal] Neighbor Discovery Offload Test: Added unit tests Bug: 34903058 Change-Id: I52393ef7f4a70ed58f9803f3350441ae01682653 --- .../com/android/server/wifi/WifiVendorHalTest.java | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java index a6146da2d..422de5a7d 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java @@ -851,4 +851,35 @@ public class WifiVendorHalTest { verify(mIWifiStaIface, never()) .getDebugRxPacketFates(any(IWifiStaIface.getDebugRxPacketFatesCallback.class)); } + + /** + * Tests the nd offload enable/disable. + */ + @Test + public void testEnableDisableNdOffload() throws Exception { + when(mIWifiStaIface.enableNdOffload(anyBoolean())).thenReturn(mWifiStatusSuccess); + + assertFalse(mWifiVendorHal.configureNeighborDiscoveryOffload(true)); + verify(mIWifiStaIface, never()).enableNdOffload(anyBoolean()); + + assertTrue(mWifiVendorHal.startVendorHalSta()); + + assertTrue(mWifiVendorHal.configureNeighborDiscoveryOffload(true)); + verify(mIWifiStaIface).enableNdOffload(eq(true)); + assertTrue(mWifiVendorHal.configureNeighborDiscoveryOffload(false)); + verify(mIWifiStaIface).enableNdOffload(eq(false)); + } + + /** + * Tests the nd offload enable failure. + */ + @Test + public void testEnableNdOffloadFailure() throws Exception { + when(mIWifiStaIface.enableNdOffload(eq(true))).thenReturn(mWifiStatusFailure); + + assertTrue(mWifiVendorHal.startVendorHalSta()); + + assertFalse(mWifiVendorHal.configureNeighborDiscoveryOffload(true)); + verify(mIWifiStaIface).enableNdOffload(eq(true)); + } } -- cgit v1.2.3