summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-03-06 03:10:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-03-06 03:10:30 +0000
commitec6f56e58897cac4d1093c9cacbccb545d3113ed (patch)
tree02d3dbb05ff51e9cdfe1aefdf07ca66ce3d5b44c /tests
parentb8cdd8b9c4399281a81e18abe93246081dffc97f (diff)
parentb073c41572f8763239f27677c03a2225fa38dc3b (diff)
Merge "Bug fix WifiChannelUtilization and WifiDataStall." into rvc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java13
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java8
2 files changed, 18 insertions, 3 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java b/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java
index 0e96ceef6..c9ba95d41 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiChannelUtilizationTest.java
@@ -93,6 +93,19 @@ public class WifiChannelUtilizationTest extends WifiBaseTest {
}
@Test
+ public void verifyOneReadChanStatsWithLargeCcaBusyTime() throws Exception {
+ WifiLinkLayerStats llstats = new WifiLinkLayerStats();
+ int freq = 5180;
+ ChannelStats cs = new ChannelStats();
+ cs.frequency = freq;
+ cs.radioOnTimeMs = RADIO_ON_TIME_DIFF_MIN_MS * 2;
+ cs.ccaBusyTimeMs = RADIO_ON_TIME_DIFF_MIN_MS * 20;
+ llstats.channelStatsMap.put(freq, cs);
+ mWifiChannelUtilization.refreshChannelStatsAndChannelUtilization(llstats, UNKNOWN_FREQ);
+ assertEquals(INVALID, mWifiChannelUtilization.getUtilizationRatio(freq));
+ }
+
+ @Test
public void verifyOneReadChanStatsWithLongRadioOnTime() throws Exception {
WifiLinkLayerStats llstats = new WifiLinkLayerStats();
int freq = 5180;
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java
index 8eee0017d..922e0cef3 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiDataStallTest.java
@@ -145,6 +145,7 @@ public class WifiDataStallTest extends WifiBaseTest {
.thenReturn(50);
when(mThroughputPredictor.predictRxThroughput(any(), anyInt(), anyInt(), anyInt()))
.thenReturn(150);
+ mWifiDataStall.init();
mWifiDataStall.setConnectionCapabilities(mCapabilities);
setUpWifiBytes(1, 1);
}
@@ -372,7 +373,8 @@ public class WifiDataStallTest extends WifiBaseTest {
assertEquals(960, mWifiDataStall.getTxThroughputKbps());
assertEquals(960, mWifiDataStall.getRxThroughputKbps());
- // 4th poll with low tx/rx traffic but high throughput
+ // 4th poll with low tx/rx traffic, high throughput and unknown channel utilization
+ when(mWifiChannelUtilization.getUtilizationRatio(anyInt())).thenReturn(-1);
when(mWifiInfo.getLinkSpeed()).thenReturn(10);
when(mWifiInfo.getRxLinkSpeedMbps()).thenReturn(10);
when(mClock.getElapsedSinceBootMillis()).thenReturn(
@@ -381,8 +383,8 @@ public class WifiDataStallTest extends WifiBaseTest {
assertEquals(WifiIsUnusableEvent.TYPE_UNKNOWN, mWifiDataStall
.checkDataStallAndThroughputSufficiency(mOldLlStats, mNewLlStats, mWifiInfo));
assertEquals(true, mWifiDataStall.isThroughputSufficient());
- assertEquals(4804, mWifiDataStall.getTxThroughputKbps());
- assertEquals(9609, mWifiDataStall.getRxThroughputKbps());
+ assertEquals(4707, mWifiDataStall.getTxThroughputKbps());
+ assertEquals(9414, mWifiDataStall.getRxThroughputKbps());
}
/**