summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOscar Shu <xshu@google.com>2018-07-30 17:08:53 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-07-30 17:08:53 +0000
commit886469d39b1cc3d709d655ef8905884dd4544069 (patch)
treeacf92927c49ab102a1dfaa3c2792686a08be819c /tests
parent6833b1111538cd2751a590399d078dcf6ea3ec29 (diff)
parentad4d342474ae1e54e4667d9f6a054d0c764a1c28 (diff)
Merge "Packet fate: create new event for timeout"
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java8
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java16
2 files changed, 20 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java b/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java
index bb26d01f1..769d67e34 100644
--- a/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/LastMileLoggerTest.java
@@ -168,24 +168,24 @@ public class LastMileLoggerTest {
}
@Test
- public void connectionEventFailedDoesNotDisableTracingOnFailureOfStaleConnection()
+ public void connectionEventTimeoutDoesNotDisableTracingOnFailureOfStaleConnection()
throws Exception {
mLastMileLogger.reportConnectionEvent(
FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_STARTED);
mLastMileLogger.reportConnectionEvent(
FAKE_CONNECTION_ID + 1, BaseWifiDiagnostics.CONNECTION_EVENT_STARTED);
mLastMileLogger.reportConnectionEvent(
- FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_FAILED);
+ FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
assertEquals("1", IoUtils.readFileAsString(mTraceEnableFile.getPath()));
}
@Test
- public void connectionEventFailedDisablesTracingOnFailureOfFutureConnection()
+ public void connectionEventTimeoutDisablesTracingOnFailureOfFutureConnection()
throws Exception {
mLastMileLogger.reportConnectionEvent(
FAKE_CONNECTION_ID, BaseWifiDiagnostics.CONNECTION_EVENT_STARTED);
mLastMileLogger.reportConnectionEvent(
- FAKE_CONNECTION_ID + 1, BaseWifiDiagnostics.CONNECTION_EVENT_FAILED);
+ FAKE_CONNECTION_ID + 1, BaseWifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
assertEquals("0", IoUtils.readFileAsString(mTraceEnableFile.getPath()));
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
index 52cf65e93..7d0f2f196 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiDiagnosticsTest.java
@@ -391,6 +391,22 @@ public class WifiDiagnosticsTest {
verify(mWifiNative).getRxPktFates(any(), anyObject());
}
+ /**
+ * Verifies that we are not fetching packet fates for a CONNECTION_EVENT_TIMEOUT event
+ * and propagating it to LastMileLogger instead.
+ */
+ @Test
+ public void loggerSimplyPropagateEventTimeoutToLastMileLogger() {
+ final boolean verbosityToggle = true;
+ mWifiDiagnostics.startLogging(verbosityToggle);
+ mWifiDiagnostics.reportConnectionEvent(
+ FAKE_CONNECTION_ID, WifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
+ verify(mLastMileLogger).reportConnectionEvent(
+ FAKE_CONNECTION_ID, WifiDiagnostics.CONNECTION_EVENT_TIMEOUT);
+ verify(mWifiNative, never()).getTxPktFates(any(), anyObject());
+ verify(mWifiNative, never()).getRxPktFates(any(), anyObject());
+ }
+
/** Verifies that dump() fetches the latest fates. */
@Test
public void dumpFetchesFates() {