summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2020-02-18 19:23:44 -0800
committerDan Stoza <stoza@google.com>2020-02-18 19:32:24 -0800
commitdc8f66221b3190572d850eca0785170b580e7e63 (patch)
tree0ba9ca9ad561f41c418681f1426cbf6566afc968 /tests
parente9fdc94a6fe004d26413ed0a6a07c1dbaa91d193 (diff)
wifitests: Update to pass IThermalService into PM
Updates tests to reflect the fact that constructing a PowerManager now requires passing in an IThermalService reference. Test: atest ClientModeImplTest Test: atest WifiServiceImplTest Test: atest RttServiceImplTest Bug: 136285293 Change-Id: I171957e493ce4d2a675462b8199eef6705168b59
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java5
-rw-r--r--tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java3
3 files changed, 9 insertions, 3 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index 185811cfe..e10600972 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -94,6 +94,7 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.IPowerManager;
+import android.os.IThermalService;
import android.os.Looper;
import android.os.Message;
import android.os.Messenger;
@@ -236,7 +237,8 @@ public class ClientModeImplTest extends WifiBaseTest {
when(context.getContentResolver()).thenReturn(mockContentResolver);
when(context.getSystemService(Context.POWER_SERVICE)).thenReturn(
- new PowerManager(context, mock(IPowerManager.class), new Handler()));
+ new PowerManager(context, mock(IPowerManager.class), mock(IThermalService.class),
+ new Handler()));
mAlarmManager = new TestAlarmManager();
when(context.getSystemService(Context.ALARM_SERVICE)).thenReturn(
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index a289171b4..0cd19277e 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -130,6 +130,7 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.IPowerManager;
+import android.os.IThermalService;
import android.os.Message;
import android.os.PowerManager;
import android.os.Process;
@@ -340,7 +341,9 @@ public class WifiServiceImplTest extends WifiBaseTest {
when(mContext.getSystemService(Context.ACTIVITY_SERVICE)).thenReturn(mActivityManager);
when(mContext.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManager);
IPowerManager powerManagerService = mock(IPowerManager.class);
- mPowerManager = new PowerManager(mContext, powerManagerService, new Handler());
+ IThermalService thermalService = mock(IThermalService.class);
+ mPowerManager =
+ new PowerManager(mContext, powerManagerService, thermalService, new Handler());
when(mContext.getSystemServiceName(PowerManager.class)).thenReturn(Context.POWER_SERVICE);
when(mContext.getSystemService(PowerManager.class)).thenReturn(mPowerManager);
WifiAsyncChannel wifiAsyncChannel = new WifiAsyncChannel("WifiServiceImplTest");
diff --git a/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java
index e5c922d5a..bfc14c7f5 100644
--- a/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/rtt/RttServiceImplTest.java
@@ -62,6 +62,7 @@ import android.net.wifi.rtt.WifiRttManager;
import android.os.Handler;
import android.os.IBinder;
import android.os.IPowerManager;
+import android.os.IThermalService;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.UserHandle;
@@ -215,7 +216,7 @@ public class RttServiceImplTest extends WifiBaseTest {
true);
mMockPowerManager = new PowerManager(mockContext, mock(IPowerManager.class),
- new Handler(mMockLooper.getLooper()));
+ mock(IThermalService.class), new Handler(mMockLooper.getLooper()));
when(mMockPowerManager.isDeviceIdleMode()).thenReturn(false);
when(mockContext.getSystemServiceName(PowerManager.class)).thenReturn(
Context.POWER_SERVICE);