diff options
author | Michael Plass <mplass@google.com> | 2017-02-15 15:59:11 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-02-22 18:24:36 -0800 |
commit | 135be5a123dd70bb4663396a28dda9d6c26956fc (patch) | |
tree | ff76b55ff9717d4d35508654cf096fffbe5e2ec4 /tests | |
parent | 5a801ea1dd4da217cb2ea03ecfcfc02985e4f1df (diff) |
[WifiVendorHal] Neighbor Discovery Offload
Test: Added unit tests
Bug: 34903058
Change-Id: I52393ef7f4a70ed58f9803f3350441ae01682653
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java | 31 |
1 files changed, 31 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 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)); + } } |