summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMukesh Agrawal <quiche@google.com>2017-04-07 22:57:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-04-07 22:57:20 +0000
commit124d8a17ef2853554dafb64e28fe0a8b1204d6cd (patch)
tree9edc41c65ca7a5b0e459d4376a219a28551f1123 /tests
parent5ed0a08cce018a10dce2b84f7d818e0f12c09f15 (diff)
parent9a89f4f412a0bac946ad842b437ab9e5e3b59828 (diff)
Merge "WifiStateMachine: exclude CMD_RSSI_POLL for LogRecs" into oc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index 5c3504906..d3da2e761 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -1090,6 +1090,39 @@ public class WifiStateMachineTest {
assertEquals(WifiStateMachine.NUM_LOG_RECS_NORMAL, mWsm.getLogRecMaxSize());
}
+ @Test
+ public void logRecsIncludeDisconnectCommand() {
+ // There's nothing special about the DISCONNECT command. It's just representative of
+ // "normal" commands.
+ mWsm.sendMessage(WifiStateMachine.CMD_DISCONNECT);
+ mLooper.dispatchAll();
+ assertEquals(1, mWsm.copyLogRecs()
+ .stream()
+ .filter(logRec -> logRec.getWhat() == WifiStateMachine.CMD_DISCONNECT)
+ .count());
+ }
+
+ @Test
+ public void logRecsExcludeRssiPollCommandByDefault() {
+ mWsm.sendMessage(WifiStateMachine.CMD_RSSI_POLL);
+ mLooper.dispatchAll();
+ assertEquals(0, mWsm.copyLogRecs()
+ .stream()
+ .filter(logRec -> logRec.getWhat() == WifiStateMachine.CMD_RSSI_POLL)
+ .count());
+ }
+
+ @Test
+ public void logRecsIncludeRssiPollCommandWhenVerboseLoggingIsEnabled() {
+ mWsm.enableVerboseLogging(1);
+ mWsm.sendMessage(WifiStateMachine.CMD_RSSI_POLL);
+ mLooper.dispatchAll();
+ assertEquals(1, mWsm.copyLogRecs()
+ .stream()
+ .filter(logRec -> logRec.getWhat() == WifiStateMachine.CMD_RSSI_POLL)
+ .count());
+ }
+
/** Verifies that enabling verbose logging sets the hal log property in eng builds. */
@Test
public void enablingVerboseLoggingSetsHalLogPropertyInEngBuilds() {