/tools/tradefederation/core/javatests/com/android/tradefed/targetprep/ |
D | DeviceSetupTest.java | 67 private ITestDevice mMockDevice; field in DeviceSetupTest 77 mMockDevice = mock(TestDevice.class); in setUp() 79 when(mMockDevice.getSerialNumber()).thenReturn("foo"); in setUp() 80 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in setUp() 81 when(mMockDevice.getIDevice()).thenReturn(mMockIDevice); in setUp() 82 when(mMockDevice.getDeviceState()).thenReturn(TestDeviceState.ONLINE); in setUp() 90 context.addAllocatedDevice("device", mMockDevice); in setUp() 109 verify(mMockDevice, atLeastOnce()).enableAdbRoot(); in testSetup() 132 verify(mMockDevice).setSetting("global", "airplane_mode_on", "1"); in testSetup_airplane_mode_on() 133 verify(mMockDevice) in testSetup_airplane_mode_on() [all …]
|
D | DisableSELinuxTargetPreparerTest.java | 42 @Mock ITestDevice mMockDevice; field in DisableSELinuxTargetPreparerTest 57 context.addAllocatedDevice("device", mMockDevice); in setUp() 67 when(mMockDevice.executeShellV2Command(GETENFORCE)).thenReturn(result); in testSetUpSuccess_permissive() 71 verify(mMockDevice, times(1)).executeShellV2Command(GETENFORCE); in testSetUpSuccess_permissive() 79 when(mMockDevice.executeShellV2Command(GETENFORCE)).thenReturn(result); in testSetUpSuccess_enforced_rootBefore() 80 when(mMockDevice.isAdbRoot()).thenReturn(true); in testSetUpSuccess_enforced_rootBefore() 81 when(mMockDevice.executeShellV2Command(SETENFORCE + "0")).thenReturn(result); in testSetUpSuccess_enforced_rootBefore() 82 when(mMockDevice.executeShellV2Command(SETENFORCE + "1")).thenReturn(result); in testSetUpSuccess_enforced_rootBefore() 86 verify(mMockDevice, times(1)).executeShellV2Command(GETENFORCE); in testSetUpSuccess_enforced_rootBefore() 87 verify(mMockDevice, times(1)).isAdbRoot(); in testSetUpSuccess_enforced_rootBefore() [all …]
|
D | GsiDeviceFlashPreparerTest.java | 61 @Mock ITestDevice mMockDevice; field in GsiDeviceFlashPreparerTest 85 when(mMockDevice.getSerialNumber()).thenReturn("serial_1"); in setUp() 86 when(mMockDevice.getDeviceDescriptor()).thenReturn(mDeviceDescriptor); in setUp() 87 when(mMockDevice.getOptions()).thenReturn(new TestDeviceOptions()); in setUp() 106 context.addAllocatedDevice("device", mMockDevice); in setUp() 124 when(mMockDevice.enableAdbRoot()).thenReturn(Boolean.TRUE); in doSetupExpectations() 129 verify(mMockDevice).rebootUntilOnline(); in verifyExpectations() 130 verify(mMockDevice).setDate(null); in verifyExpectations() 131 verify(mMockDevice).waitForDeviceAvailable(Mockito.anyLong()); in verifyExpectations() 132 verify(mMockDevice).setRecoveryMode(RecoveryMode.AVAILABLE); in verifyExpectations() [all …]
|
D | RootTargetPreparerTest.java | 42 @Mock ITestDevice mMockDevice; field in RootTargetPreparerTest 53 when(mMockDevice.getIDevice()).thenReturn(mMockIDevice); in setUp() 56 context.addAllocatedDevice("device", mMockDevice); in setUp() 63 when(mMockDevice.isAdbRoot()).thenReturn(true); in testSetUpSuccess_rootBefore() 67 verify(mMockDevice, times(1)).isAdbRoot(); in testSetUpSuccess_rootBefore() 72 when(mMockDevice.isAdbRoot()).thenReturn(false); in testSetUpSuccess_notRootBefore() 73 when(mMockDevice.enableAdbRoot()).thenReturn(true); in testSetUpSuccess_notRootBefore() 74 when(mMockDevice.disableAdbRoot()).thenReturn(true); in testSetUpSuccess_notRootBefore() 78 verify(mMockDevice, times(1)).isAdbRoot(); in testSetUpSuccess_notRootBefore() 79 verify(mMockDevice, times(1)).enableAdbRoot(); in testSetUpSuccess_notRootBefore() [all …]
|
D | SwitchUserTargetPreparerTest.java | 50 @Mock private ITestDevice mMockDevice; field in SwitchUserTargetPreparerTest 60 context.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in setUp() 71 when(mMockDevice.getCurrentUser()).thenReturn(11); in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 73 mMockDevice, in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 81 verify(mMockDevice, never()).switchUser(anyInt()); in testSetUpRunAsPrimary_ifAlreadyInPrimary_noSwitch() 89 when(mMockDevice.getCurrentUser()).thenReturn(0); in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 91 mMockDevice, in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 99 verify(mMockDevice, never()).switchUser(0); in testSetUpRunAsSystem_ifAlreadyInSystem_noSwitch() 107 when(mMockDevice.getCurrentUser()).thenReturn(11); in testSetUpRunAsSystem_ifSystemSwitchIsNotAllowed_switchToMain() 109 mMockDevice, in testSetUpRunAsSystem_ifSystemSwitchIsNotAllowed_switchToMain() [all …]
|
D | DefaultTestsZipInstallerTest.java | 61 @Mock ITestDevice mMockDevice; field in DefaultTestsZipInstallerTest 91 when(mMockDevice.getSerialNumber()).thenReturn(TEST_STRING); in setUp() 92 when(mMockDevice.getProductType()).thenReturn(TEST_STRING); in setUp() 93 when(mMockDevice.getBuildId()).thenReturn("1"); in setUp() 95 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in setUp() 121 when(mMockDevice.getSerialNumber()).thenReturn("serial_number_stub"); in testCantTouchFilesystem() 122 when(mMockDevice.getRecoveryMode()).thenReturn(RecoveryMode.AVAILABLE); in testCantTouchFilesystem() 123 when(mMockDevice.executeShellCommand("stop")).thenReturn(""); in testCantTouchFilesystem() 124 when(mMockDevice.executeShellCommand("stop installd")).thenReturn(""); in testCantTouchFilesystem() 127 when(mMockDevice.pushString((String) Mockito.any(), (String) Mockito.any())) in testCantTouchFilesystem() [all …]
|
D | InstallApexModuleTargetPreparerTest.java | 76 ITestDevice mMockDevice; field in InstallApexModuleTargetPreparerTest 133 when(mMockDevice.getSerialNumber()).thenReturn(SERIAL); in setUp() 134 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in setUp() 135 when(mMockDevice.checkApiLevelAgainstNextRelease(30)).thenReturn(true); in setUp() 136 when(mMockDevice.getApiLevel()).thenReturn(100); in setUp() 138 context.addAllocatedDevice("device", mMockDevice); in setUp() 289 when(mMockDevice.getMainlineModuleInfo()).thenReturn(mainlineModuleInfo); in testGetApkModuleInData() 290 when(mMockDevice.executeShellCommand(String.format("pm path %s", fakeName))) in testGetApkModuleInData() 292 when(mMockDevice.executeShellCommand(String.format("pm path %s", fakeName2))) in testGetApkModuleInData() 294 when(mMockDevice.executeShellCommand(String.format("pm path %s", fakeName3))) in testGetApkModuleInData() [all …]
|
D | StopServicesSetupTest.java | 50 @Mock ITestDevice mMockDevice; field in StopServicesSetupTest 59 context.addAllocatedDevice("device", mMockDevice); in setUp() 66 when(mMockDevice.executeShellCommand("stop")).thenReturn(null); in testNoop() 69 verify(mMockDevice).executeShellCommand("stop"); in testNoop() 70 verifyNoMoreInteractions(mMockDevice); in testNoop() 79 verifyNoMoreInteractions(mMockDevice); in testNoStopFramework() 88 when(mMockDevice.executeShellCommand("stop")).thenReturn(null); in testStopServices() 89 when(mMockDevice.executeShellCommand("stop service1")).thenReturn(null); in testStopServices() 90 when(mMockDevice.executeShellCommand("stop service2")).thenReturn(null); in testStopServices() 94 InOrder inOrder = inOrder(mMockDevice); in testStopServices() [all …]
|
D | ModulePusherTest.java | 85 @Mock ITestDevice mMockDevice; field in ModulePusherTest 102 when(mMockDevice.executeAdbCommand("disable-verity")).thenReturn("disabled"); in setUp() 103 when(mMockDevice.executeAdbCommand("remount")).thenReturn("remount succeeded"); in setUp() 104 when(mMockDevice.getApiLevel()).thenReturn(API); in setUp() 105 when(mMockDevice.getSerialNumber()).thenReturn(SERIAL); in setUp() 106 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in setUp() 108 when(mMockDevice.executeShellV2Command("ls /system/apex/")).thenReturn(apexCr); in setUp() 110 when(mMockDevice.executeShellV2Command("pm get-moduleinfo | grep 'com.google'")) in setUp() 112 when(mMockDevice.executeShellV2Command("cmd testharness enable")).thenReturn(cr); in setUp() 115 when(mMockDevice.executeShellV2Command("pm path " + APEX_PACKAGE_NAME)).thenReturn(cr1); in setUp() [all …]
|
D | DeviceStringPusherTest.java | 43 @Mock ITestDevice mMockDevice; field in DeviceStringPusherTest 54 context.addAllocatedDevice("device", mMockDevice); in setUp() 64 when(mMockDevice.doesFileExist("file")).thenReturn(false); in testFail() 65 when(mMockDevice.pushString("hi", "file")).thenReturn(false); in testFail() 66 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in testFail() 70 verify(mMockDevice, times(1)).doesFileExist("file"); in testFail() 71 verify(mMockDevice, times(1)).pushString("hi", "file"); in testFail() 72 verify(mMockDevice, times(1)).getDeviceDescriptor(); in testFail() 80 when(mMockDevice.doesFileExist("file")).thenReturn(false); in testDoesntExist() 81 when(mMockDevice.pushString("hi", "file")).thenReturn(true); in testDoesntExist() [all …]
|
D | FastbootDeviceFlasherTest.java | 76 @Mock ITestDevice mMockDevice; field in FastbootDeviceFlasherTest 88 when(mMockDevice.getSerialNumber()).thenReturn(TEST_STRING); in setUp() 89 when(mMockDevice.getProductType()).thenReturn(TEST_STRING); in setUp() 90 when(mMockDevice.getBuildId()).thenReturn("1"); in setUp() 91 when(mMockDevice.getBuildFlavor()).thenReturn("test-debug"); in setUp() 92 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in setUp() 131 mMockDevice.rebootIntoBootloader(); in testFlash_deviceNotAvailable() 134 .when(mMockDevice) in testFlash_deviceNotAvailable() 137 mFlasher.preFlashOperations(mMockDevice, mMockBuildInfo); in testFlash_deviceNotAvailable() 154 mFlasher.preFlashOperations(mMockDevice, mMockBuildInfo); in testFlash_missingBoard() [all …]
|
D | SystemUpdaterDeviceFlasherTest.java | 51 @Mock ITestDevice mMockDevice; field in SystemUpdaterDeviceFlasherTest 59 mInOrder = inOrder(mMockDevice, mMockDeviceBuild); in setUp() 64 when(mMockDevice.getSerialNumber()).thenReturn(TEST_STRING); in setUp() 65 when(mMockDevice.getProductType()).thenReturn(TEST_STRING); in setUp() 66 when(mMockDevice.getDeviceDescriptor()).thenReturn(null); in setUp() 74 when(mMockDevice.pushFile(fakeImage, "/cache/update.zip", true)).thenReturn(true); in testFlash() 78 when(mMockDevice.executeShellCommand(Mockito.matches(commandsRegex))).thenReturn("foo"); in testFlash() 80 mFlasher.flash(mMockDevice, mMockDeviceBuild); in testFlash() 83 mInOrder.verify(mMockDevice) in testFlash() 85 mInOrder.verify(mMockDevice).executeShellCommand(Mockito.matches(commandsRegex)); in testFlash() [all …]
|
D | RestartSystemServerTargetPreparerTest.java | 45 @Mock ITestDevice mMockDevice; field in RestartSystemServerTargetPreparerTest 53 context.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in setUp() 61 when(mMockDevice.enableAdbRoot()).thenReturn(true); in testSetUp_bootComplete() 62 when(mMockDevice.executeShellCommand("setprop dev.bootcomplete 0")).thenReturn(null); in testSetUp_bootComplete() 63 when(mMockDevice.executeShellCommand(RestartSystemServerTargetPreparer.KILL_SERVER_COMMAND)) in testSetUp_bootComplete() 67 verify(mMockDevice, times(1)).waitForDeviceAvailable(); in testSetUp_bootComplete() 68 verify(mMockDevice, times(1)).enableAdbRoot(); in testSetUp_bootComplete() 69 verify(mMockDevice, times(1)) in testSetUp_bootComplete() 75 when(mMockDevice.enableAdbRoot()).thenReturn(true); in testSetUp_bootNotComplete() 76 when(mMockDevice.executeShellCommand("setprop dev.bootcomplete 0")).thenReturn(null); in testSetUp_bootNotComplete() [all …]
|
/tools/tradefederation/core/javatests/com/android/tradefed/util/ |
D | JavaCodeCoverageFlusherTest.java | 56 @Mock ITestDevice mMockDevice; field in JavaCodeCoverageFlusherTest 68 mFlusher = new JavaCodeCoverageFlusher(mMockDevice, ImmutableList.of()); in testResetAll_calledForAllProcesses() 71 doReturn(PS_OUTPUT).when(mMockDevice).executeShellCommand("ps -e"); in testResetAll_calledForAllProcesses() 73 .when(mMockDevice) in testResetAll_calledForAllProcesses() 75 doReturn("123").when(mMockDevice).getProcessPid("com.android.bluetooth"); in testResetAll_calledForAllProcesses() 76 doReturn("4567").when(mMockDevice).getProcessPid("com.google.android.gms.persistent"); in testResetAll_calledForAllProcesses() 77 doReturn("890").when(mMockDevice).getProcessPid("com.android.phone"); in testResetAll_calledForAllProcesses() 81 verify(mMockDevice) in testResetAll_calledForAllProcesses() 85 verify(mMockDevice) in testResetAll_calledForAllProcesses() 89 verify(mMockDevice) in testResetAll_calledForAllProcesses() [all …]
|
D | AdbRootElevatorTest.java | 38 @Mock INativeDevice mMockDevice; field in AdbRootElevatorTest 48 when(mMockDevice.isAdbRoot()).thenReturn(false); in testEnablesAndDisablesRoot() 49 when(mMockDevice.enableAdbRoot()).thenReturn(true); in testEnablesAndDisablesRoot() 51 try (AdbRootElevator adbRoot = new AdbRootElevator(mMockDevice)) { in testEnablesAndDisablesRoot() 52 mMockDevice.waitForDeviceAvailable(); in testEnablesAndDisablesRoot() 55 InOrder inOrder = Mockito.inOrder(mMockDevice); in testEnablesAndDisablesRoot() 56 inOrder.verify(mMockDevice).isAdbRoot(); in testEnablesAndDisablesRoot() 57 inOrder.verify(mMockDevice).enableAdbRoot(); in testEnablesAndDisablesRoot() 58 inOrder.verify(mMockDevice).waitForDeviceAvailable(); in testEnablesAndDisablesRoot() 59 inOrder.verify(mMockDevice).disableAdbRoot(); in testEnablesAndDisablesRoot() [all …]
|
D | NativeCodeCoverageFlusherTest.java | 51 @Mock ITestDevice mMockDevice; field in NativeCodeCoverageFlusherTest 63 doReturn(PS_OUTPUT).when(mMockDevice).executeShellCommand("ps -e"); in setUp() 71 doReturn(true).when(mMockDevice).isAdbRoot(); in testClearCoverageMeasurements_rmCommandCalled() 77 when(mMockDevice.executeShellV2Command(anyString())).thenReturn(result); in testClearCoverageMeasurements_rmCommandCalled() 79 mFlusher = new NativeCodeCoverageFlusher(mMockDevice, mCoverageOptions); in testClearCoverageMeasurements_rmCommandCalled() 84 verify(mMockDevice).executeShellCommand("find /data/misc/trace -name '*.profraw' -delete"); in testClearCoverageMeasurements_rmCommandCalled() 85 verify(mMockDevice).executeShellCommand("find /data/local/tmp -name '*.profraw' -delete"); in testClearCoverageMeasurements_rmCommandCalled() 86 verify(mMockDevice).executeShellCommand("find /data/misc/trace -name '*.gcda' -delete"); in testClearCoverageMeasurements_rmCommandCalled() 87 verify(mMockDevice).executeShellCommand("find /data/local/tmp -name '*.gcda' -delete"); in testClearCoverageMeasurements_rmCommandCalled() 92 doReturn(false).when(mMockDevice).isAdbRoot(); in testNoAdbRootClearCoverageMeasurements_noOp() [all …]
|
D | ITestDeviceMockHelper.java | 35 private final ITestDevice mMockDevice; field in ITestDeviceMockHelper 38 mMockDevice = Objects.requireNonNull(mockDevice); in ITestDeviceMockHelper() 42 when(mMockDevice.getCurrentUser()).thenReturn(userId); in mockGetCurrentUser() 46 when(mMockDevice.getUserInfos()).thenReturn(existingUsers); in mockGetUserInfos() 50 when(mMockDevice.getMaxNumberOfUsersSupported()).thenReturn(max); in mockGetMaxNumberOfUsersSupported() 54 when(mMockDevice.switchUser(userId)).thenReturn(true); in mockSwitchUser() 58 when(mMockDevice.startUser(userId, /* waitFlag= */ true)).thenReturn(true); in mockStartUser() 67 when(mMockDevice.startVisibleBackgroundUser(userId, displayId, /* waitFlag= */ true)) in mockStartUserVisibleOnBackground() 72 when(mMockDevice.createUser(any())).thenReturn(userId); in mockCreateUser() 77 when(mMockDevice.createUser(any())).thenThrow(e); in mockCreateUserFailure() [all …]
|
/tools/tradefederation/core/javatests/com/android/tradefed/build/ |
D | BootstrapBuildProviderTest.java | 47 @Mock ITestDevice mMockDevice; field in BootstrapBuildProviderTest 64 when(mMockDevice.getBuildId()).thenReturn("5"); in testGetBuild() 65 when(mMockDevice.getIDevice()).thenReturn(mock(IDevice.class)); in testGetBuild() 66 when(mMockDevice.waitForDeviceShell(Mockito.anyLong())).thenReturn(true); in testGetBuild() 67 when(mMockDevice.getProperty(Mockito.any())).thenReturn("property"); in testGetBuild() 68 when(mMockDevice.getProductVariant()).thenReturn("variant"); in testGetBuild() 69 when(mMockDevice.getBuildFlavor()).thenReturn("flavor"); in testGetBuild() 70 when(mMockDevice.getBuildAlias()).thenReturn("alias"); in testGetBuild() 72 IBuildInfo res = mProvider.getBuild(mMockDevice); in testGetBuild() 85 when(mMockDevice.getBuildId()).thenReturn("5"); in testGetBuild_add_extra_file() [all …]
|
/tools/tradefederation/core/javatests/com/android/tradefed/suite/checker/ |
D | DeviceSettingCheckerTest.java | 43 private ITestDevice mMockDevice; field in DeviceSettingCheckerTest 48 mMockDevice = mock(ITestDevice.class); in setup() 63 when(mMockDevice.getAllSettings(Mockito.eq("global"))).thenReturn(mapGlobal); in testSettingsUnchanged() 64 when(mMockDevice.getAllSettings(Mockito.eq("secure"))).thenReturn(mapSecure); in testSettingsUnchanged() 65 when(mMockDevice.getAllSettings(Mockito.eq("system"))).thenReturn(mapSystem); in testSettingsUnchanged() 67 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testSettingsUnchanged() 68 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testSettingsUnchanged() 69 verify(mMockDevice, times(2)).getAllSettings(Mockito.eq("global")); in testSettingsUnchanged() 70 verify(mMockDevice, times(2)).getAllSettings(Mockito.eq("secure")); in testSettingsUnchanged() 71 verify(mMockDevice, times(2)).getAllSettings(Mockito.eq("system")); in testSettingsUnchanged() [all …]
|
D | SystemServerFileDescriptorCheckerTest.java | 40 @Mock ITestDevice mMockDevice; field in SystemServerFileDescriptorCheckerTest 51 when(mMockDevice.getProperty(Mockito.eq("ro.build.type"))).thenReturn("userdebug"); in testFailToGetPid() 52 when(mMockDevice.executeShellCommand(Mockito.eq("pidof system_server"))) in testFailToGetPid() 55 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testFailToGetPid() 56 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testFailToGetPid() 61 when(mMockDevice.getProperty(Mockito.eq("ro.build.type"))).thenReturn("userdebug"); in testFailToGetFdCount() 62 when(mMockDevice.executeShellCommand(Mockito.eq("pidof system_server"))) in testFailToGetFdCount() 64 when(mMockDevice.executeShellCommand(Mockito.eq("su root ls /proc/1024/fd | wc -w"))) in testFailToGetFdCount() 67 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testFailToGetFdCount() 68 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testFailToGetFdCount() [all …]
|
D | SystemServerStatusCheckerTest.java | 41 @Mock ITestDevice mMockDevice; field in SystemServerStatusCheckerTest 47 when(mMockDevice.getSerialNumber()).thenReturn("SERIAL"); in setUp() 48 when(mMockDevice.getApiLevel()).thenReturn(29); in setUp() 61 when(mMockDevice.getProcessByName(Mockito.eq("system_server"))) in testSystemServerProcessNotRestarted() 63 when(mMockDevice.deviceSoftRestarted(Mockito.any())).thenReturn(false); in testSystemServerProcessNotRestarted() 65 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testSystemServerProcessNotRestarted() 66 assertEquals(CheckStatus.SUCCESS, mChecker.postExecutionCheck(mMockDevice).getStatus()); in testSystemServerProcessNotRestarted() 72 when(mMockDevice.getProcessByName(Mockito.eq("system_server"))) in testSystemServerProcessRestartedWithoutDeviceReboot() 74 when(mMockDevice.deviceSoftRestarted(Mockito.any())).thenReturn(true); in testSystemServerProcessRestartedWithoutDeviceReboot() 76 assertEquals(CheckStatus.SUCCESS, mChecker.preExecutionCheck(mMockDevice).getStatus()); in testSystemServerProcessRestartedWithoutDeviceReboot() [all …]
|
/tools/tradefederation/core/javatests/com/android/tradefed/device/ |
D | DeviceSelectionOptionsTest.java | 50 @Mock IDevice mMockDevice; field in DeviceSelectionOptionsTest 89 when(mMockDevice.getSerialNumber()).thenReturn(DEVICE_SERIAL); in setUp() 90 when(mMockDevice.isEmulator()).thenReturn(Boolean.FALSE); in setUp() 101 assertEquals(1, options.getSerials(mMockDevice).size()); in testGetSerials() 102 assertTrue(options.getSerials(mMockDevice).contains(DEVICE_ENV_SERIAL)); in testGetSerials() 103 assertFalse(options.getSerials(mMockDevice).contains(DEVICE_SERIAL)); in testGetSerials() 146 assertEquals(1, options.getSerials(mMockDevice).size()); in testGetSerialsDoesNotOverride() 147 assertFalse(options.getSerials(mMockDevice).contains(DEVICE_ENV_SERIAL)); in testGetSerialsDoesNotOverride() 148 assertTrue(options.getSerials(mMockDevice).contains(DEVICE_SERIAL)); in testGetSerialsDoesNotOverride() 159 assertTrue(options.getSerials(mMockDevice).isEmpty()); in testGetSerialsWithNoEnvValue() [all …]
|
D | DeviceStateMonitorTest.java | 67 @Mock IDevice mMockDevice; field in DeviceStateMonitorTest 83 when(mMockDevice.getState()).thenReturn(DeviceState.ONLINE); in setUp() 84 when(mMockDevice.getSerialNumber()).thenReturn(SERIAL_NUMBER); in setUp() 86 mMonitor = new DeviceStateMonitor(mMockMgr, mMockDevice, true); in setUp() 92 assertEquals(mMockDevice, mMonitor.waitForDeviceOnline()); in testWaitForDeviceOnline_alreadyOnline() 99 new DeviceStateMonitor(mMockMgr, mMockDevice, true) { in testWaitForDeviceOnline() 110 assertEquals(mMockDevice, mMonitor.waitForDeviceOnline(50)); in testWaitForDeviceOnline() 162 new DeviceStateMonitor(mMockMgr, mMockDevice, true) { in testWaitForDeviceOffline() 191 when(mMockDevice.getState()).thenReturn(DeviceState.ONLINE); in testWaitForShellAvailable() 192 when(mMockDevice.getSerialNumber()).thenReturn(SERIAL_NUMBER); in testWaitForShellAvailable() [all …]
|
D | WifiHelperTest.java | 46 @Mock ITestDevice mMockDevice; field in WifiHelperTest 52 when(mMockDevice.executeShellCommand(WifiHelper.CHECK_PACKAGE_CMD)) in setUp() 104 MockTestDeviceHelper.injectShellResponse(mMockDevice, null, 2, TimeUnit.MINUTES, 0, ""); in testWaitForIp_failThenPass() 106 mMockDevice, in testWaitForIp_failThenPass() 114 new WifiHelper(mMockDevice) { in testWaitForIp_failThenPass() 122 verify(mMockDevice, times(1)).executeShellCommand(WifiHelper.CHECK_PACKAGE_CMD); in testWaitForIp_failThenPass() 132 mMockDevice, in testStartMonitor() 139 WifiHelper wifiHelper = new WifiHelper(mMockDevice); in testStartMonitor() 142 verify(mMockDevice, times(1)).executeShellCommand(WifiHelper.CHECK_PACKAGE_CMD); in testStartMonitor() 148 mMockDevice, in testStopMonitor() [all …]
|
/tools/tradefederation/core/javatests/com/android/tradefed/testtype/suite/module/ |
D | ShippingApiLevelModuleControllerTest.java | 45 @Mock ITestDevice mMockDevice; field in ShippingApiLevelModuleControllerTest 62 mContext.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mMockDevice); in setUp() 74 when(mMockDevice.getIDevice()).thenReturn(mMockIDevice); in testMinApiLevelHigherThanProductFirstApiLevel() 75 when(mMockDevice.getIntProperty(SYSTEM_SHIPPING_API_LEVEL_PROP, VALUE_NOT_FOUND)) in testMinApiLevelHigherThanProductFirstApiLevel() 90 when(mMockDevice.getIDevice()).thenReturn(mMockIDevice); in testMinApiLevelHigherThanBoardFirstApiLevel() 91 when(mMockDevice.getIntProperty(SYSTEM_SHIPPING_API_LEVEL_PROP, VALUE_NOT_FOUND)) in testMinApiLevelHigherThanBoardFirstApiLevel() 103 when(mMockDevice.getIDevice()).thenReturn(mMockIDevice); in testBoardApiLevelsNotFound() 104 when(mMockDevice.getIntProperty(SYSTEM_SHIPPING_API_LEVEL_PROP, VALUE_NOT_FOUND)) in testBoardApiLevelsNotFound() 118 when(mMockDevice.getIDevice()).thenReturn(mMockIDevice); in testApiLevelsNotFound() 119 when(mMockDevice.getIntProperty(SYSTEM_SHIPPING_API_LEVEL_PROP, VALUE_NOT_FOUND)) in testApiLevelsNotFound() [all …]
|