summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKai Shi <kaishi@google.com>2020-09-09 23:32:21 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-09-09 23:32:21 +0000
commit59d3999893e4f2bade6c81bd2a7187a63a433c16 (patch)
treec1c284cd43cddfaa5028cd95c492e6558f6e77f1 /tests
parent2a2fc39e77bf780fbb2e98255738c818c5927392 (diff)
parent42317137d8c9bda389c7bd6cf7d5378d60b3bdc0 (diff)
Merge changes from topic "mainlineVersion" into rvc-qpr-dev
* changes: wifi: get the correct mainline version when wifi is disabled wifi:get wifi stack version from com.android.wifi
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java
index 21a00f9a1..c679954b1 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java
@@ -28,6 +28,7 @@ import static org.mockito.Mockito.when;
import android.app.test.MockAnswerUtil.AnswerWithArguments;
import android.app.test.TestAlarmManager;
import android.content.Context;
+import android.content.pm.ModuleInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.net.MacAddress;
@@ -98,6 +99,8 @@ public class WifiHealthMonitorTest extends WifiBaseTest {
PackageManager mPackageManager;
@Mock
PackageInfo mPackageInfo;
+ @Mock
+ ModuleInfo mModuleInfo;
private final ArrayList<String> mKeys = new ArrayList<>();
private final ArrayList<WifiScoreCard.BlobListener> mBlobListeners = new ArrayList<>();
@@ -154,8 +157,9 @@ public class WifiHealthMonitorTest extends WifiBaseTest {
mDriverVersion = "build 1.1";
mFirmwareVersion = "HW 1.1";
when(mPackageInfo.getLongVersionCode()).thenReturn(MODULE_VERSION);
- when(mContext.getPackageName()).thenReturn("WifiAPK");
when(mPackageManager.getPackageInfo(anyString(), anyInt())).thenReturn(mPackageInfo);
+ when(mPackageManager.getModuleInfo(anyString(), anyInt())).thenReturn(mModuleInfo);
+ when(mModuleInfo.getPackageName()).thenReturn("WifiAPK");
when(mContext.getPackageManager()).thenReturn(mPackageManager);
mWifiConfigManager = mockConfigManager();
@@ -323,7 +327,7 @@ public class WifiHealthMonitorTest extends WifiBaseTest {
// trigger extractCurrentSoftwareBuildInfo() call to update currSoftwareBuildInfo
mWifiHealthMonitor.installMemoryStoreSetUpDetectionAlarm(mMemoryStore);
mWifiHealthMonitor.setWifiEnabled(true);
- assertEquals(0, mWifiHealthMonitor.getWifiStackVersion());
+ assertEquals(MODULE_VERSION, mWifiHealthMonitor.getWifiStackVersion());
millisecondsPass(5000);
mWifiScanner.startScan(mScanSettings, mScanListener);
mAlarmManager.dispatch(WifiHealthMonitor.POST_BOOT_DETECTION_TIMER_TAG);