diff options
author | Oscar Shu <xshu@google.com> | 2020-05-13 20:37:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-13 20:37:09 +0000 |
commit | a108568938c7581430b682ec3a027435f42e76ca (patch) | |
tree | 8fb88f5d485d46a013878640a0c9ed7cbea8510e /tests | |
parent | 0c0798c622c6e92120212ca31605155fe39f0b66 (diff) | |
parent | a9af37006b20d012ab7dcd329c088cb8d0795289 (diff) |
Merge "BssidBlocklistMonitor history" into rvc-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java index 2567faa91..4369a831b 100644 --- a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java @@ -582,6 +582,24 @@ public class BssidBlocklistMonitorTest { verifyAddTestBssidToBlocklist(); mBssidBlocklistMonitor.clearBssidBlocklist(); assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size()); + + } + + /** + * Verify that the BssidStatusHistoryLoggerSize is capped. + */ + @Test + public void testBssidStatusHistoryLoggerSize() { + int bssidStatusHistoryLoggerSize = 30; + for (int i = 0; i < bssidStatusHistoryLoggerSize; i++) { + verifyAddTestBssidToBlocklist(); + mBssidBlocklistMonitor.clearBssidBlocklist(); + assertEquals(i + 1, mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); + } + verifyAddTestBssidToBlocklist(); + mBssidBlocklistMonitor.clearBssidBlocklist(); + assertEquals(bssidStatusHistoryLoggerSize, + mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); } /** @@ -633,6 +651,7 @@ public class BssidBlocklistMonitorTest { // Verify that the BSSID is removed from blocklist by clearBssidBlocklistForSsid mBssidBlocklistMonitor.clearBssidBlocklistForSsid(TEST_SSID_1); assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size()); + assertEquals(1, mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); // Add the BSSID to blocklist again. mBssidBlocklistMonitor.blockBssidForDurationMs(TEST_BSSID_1, TEST_SSID_1, testDuration); @@ -641,5 +660,6 @@ public class BssidBlocklistMonitorTest { // Verify that the BSSID is removed from blocklist once the specified duration is over. when(mClock.getWallClockMillis()).thenReturn(testDuration + 1); assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size()); + assertEquals(2, mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); } } |