Home
last modified time | relevance | path

Searched refs:mDevice (Results 1 – 25 of 82) sorted by relevance

1234

/tools/tradefederation/core/tests/src/com/android/tradefed/targetprep/
DAoaTargetPreparerTest.java61 @Mock private AoaDevice mDevice; field in AoaTargetPreparerTest
67 when(mUsb.getAoaDevice(any(), any())).thenReturn(mDevice); in setUp()
70 when(mDevice.getSerialNumber()).thenReturn("SERIAL"); in setUp()
87 verify(mPreparer).execute(eq(mDevice), eq("wake")); in testSetUp()
96 verify(mPreparer, never()).execute(eq(mDevice), any()); in testSetUp_noActions()
114 verify(mPreparer).execute(eq(mDevice), eq("wake")); in testSetUp_skipDeviceCheck()
120 mPreparer.execute(mDevice, "click 1 23"); in testClick()
122 verify(mDevice).click(eq(new Point(1, 23))); in testClick()
123 verifyNoMoreInteractions(ignoreStubs(mDevice)); in testClick()
128 mPreparer.execute(mDevice, "longClick 23 4"); in testLongClick()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/device/helper/
DTelephonyHelperTest.java43 private ITestDevice mDevice; field in TelephonyHelperTest
48 mDevice = EasyMock.createMock(ITestDevice.class); in setUp()
51 EasyMock.expect(mDevice.getIDevice()).andStubReturn(mMockIDevice); in setUp()
56 EasyMock.expect(mDevice.installPackage(EasyMock.anyObject(), EasyMock.eq(true))) in testGetSimInfo()
58 EasyMock.expect(mDevice.uninstallPackage(TelephonyHelper.PACKAGE_NAME)).andReturn(null); in testGetSimInfo()
61 mDevice.runInstrumentationTests( in testGetSimInfo()
83 EasyMock.replay(mDevice, mMockIDevice); in testGetSimInfo()
84 SimCardInformation info = TelephonyHelper.getSimInfo(mDevice); in testGetSimInfo()
90 EasyMock.verify(mDevice, mMockIDevice); in testGetSimInfo()
95 EasyMock.expect(mDevice.installPackage(EasyMock.anyObject(), EasyMock.eq(true))) in testGetSimInfo_installFail()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/result/
DDeviceFileReporterTest.java38 ITestDevice mDevice = null; field in DeviceFileReporterTest
66 mDevice = EasyMock.createMock(ITestDevice.class); in setUp()
67 EasyMock.expect(mDevice.getSerialNumber()).andStubReturn("serial"); in setUp()
71 new DeviceFileReporter(mDevice, mListener) { in setUp()
86 EasyMock.expect(mDevice.executeShellCommand(EasyMock.eq("ls /data/tombstones/*"))) in testSimple()
89 EasyMock.expect(mDevice.pullFile(EasyMock.eq(filename))) in testSimple()
112 EasyMock.expect(mDevice.executeShellCommand(EasyMock.eq("ls /data/tombstones/*"))) in testTrim()
115 EasyMock.expect(mDevice.pullFile(EasyMock.eq(filename))) in testTrim()
138 EasyMock.expect(mDevice.executeShellCommand(EasyMock.eq("ls /data/tombstones/*"))) in testLine_containingSpace()
141 EasyMock.expect(mDevice.pullFile(EasyMock.eq(filename))) in testLine_containingSpace()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/device/recovery/
DUsbResetMultiDeviceRecoveryTest.java55 private IManagedTestDevice mDevice; field in UsbResetMultiDeviceRecoveryTest
61 mDevice = mock(IManagedTestDevice.class); in setUp()
62 when(mDevice.getSerialNumber()).thenReturn(SERIAL); in setUp()
87 when(mDevice.getIDevice()).thenReturn(new StubDevice(SERIAL)); in testRecover_stub()
88 mRecoverer.recoverDevices(Arrays.asList(mDevice)); in testRecover_stub()
98 when(mDevice.getAllocationState()).thenReturn(DeviceAllocationState.Available); in testRecover_available()
100 mRecoverer.recoverDevices(Arrays.asList(mDevice)); in testRecover_available()
104 verify(mDevice, never()).reboot(); in testRecover_available()
111 when(mDevice.getAllocationState()).thenReturn(DeviceAllocationState.Unavailable); in testRecover_unavailable()
113 mRecoverer.recoverDevices(Arrays.asList(mDevice)); in testRecover_unavailable()
[all …]
/tools/tradefederation/contrib/src/com/android/fastboot/tests/
DFastbootTest.java92 private ITestDevice mDevice; field in FastbootTest
103 mDevice = device; in setDevice()
109 return mDevice; in getDevice()
118 String originalFastbootpath = ((IManagedTestDevice) mDevice).getFastbootPath(); in run()
123 ((IManagedTestDevice) mDevice).setFastbootPath(originalFastbootpath); in run()
178 ((IManagedTestDevice) mDevice).setFastbootPath(fastboot.getAbsolutePath()); in testFastboot()
181 CLog.v("Flashing device %s", mDevice.getSerialNumber()); in testFastboot()
195 CLog.v("Waiting for device %s online", mDevice.getSerialNumber()); in testFastboot()
196 mDevice.setRecoveryMode(RecoveryMode.ONLINE); in testFastboot()
198 mDevice.waitForDeviceOnline(); in testFastboot()
[all …]
/tools/tradefederation/core/test_framework/com/android/tradefed/testtype/
DInstrumentationTest.java332 private ITestDevice mDevice = null; field in InstrumentationTest
368 mDevice = device; in setDevice()
584 return mDevice; in getDevice()
731 abiName = AbiFormatter.getDefaultAbi(mDevice, mForceAbi); in resolveAbiName()
792 checkArgument(mDevice != null, "Device has not been set."); in run()
797 mDevice.installPackage( in run()
813 mRunner = createRemoteAndroidTestRunner(mPackageName, mRunnerName, mDevice.getIDevice()); in run()
818 mDevice.uninstallPackage(mPackageName); in run()
926 verify(mDevice.enableAdbRoot(), "Failed to enable adb root."); in doTestRun()
929 new NativeCodeCoverageFlusher(mDevice, options.getCoverageProcesses()); in doTestRun()
[all …]
DGTest.java56 private ITestDevice mDevice = null; field in GTest
109 mDevice = device; in setDevice()
117 return mDevice; in getDevice()
239 if (!mDevice.isExecutable(fullPath)) { in shouldSkipFile()
304 if (!mDevice.pushFile(flagFile, devicePath)) { in createFlagFile()
417 if (mDevice == null) { in run()
422 if (!mDevice.doesFileExist(testPath)) { in run()
424 mDevice.getSerialNumber()); in run()
428 mDevice.executeShellCommand("stop"); in run()
435 new NativeCodeCoverageFlusher(mDevice, getCoverageOptions().getCoverageProcesses()); in run()
[all …]
DNativeCodeCoverageListener.java64 private final ITestDevice mDevice; field in NativeCodeCoverageListener
72 mDevice = device; in NativeCodeCoverageListener()
74 mFlusher = new NativeCodeCoverageFlusher(mDevice, ImmutableList.of()); in NativeCodeCoverageListener()
82 mDevice = device; in NativeCodeCoverageListener()
84 mFlusher = new NativeCodeCoverageFlusher(mDevice, coverageOptions.getCoverageProcesses()); in NativeCodeCoverageListener()
120 verify(mDevice.enableAdbRoot(), "Failed to enable adb root."); in logCoverageMeasurements()
128 mDevice.executeShellCommand(ZIP_COVERAGE_FILES_COMMAND); in logCoverageMeasurements()
129 coverageTar = mDevice.pullFile(COVERAGE_TAR_PATH); in logCoverageMeasurements()
134 mDevice.deleteFile(COVERAGE_TAR_PATH); in logCoverageMeasurements()
143 mDevice.executeShellCommand(DELETE_COVERAGE_FILES_COMMAND); in logCoverageMeasurements()
DNativeBenchmarkTest.java54 private ITestDevice mDevice = null; field in NativeBenchmarkTest
104 mDevice = device; in setDevice()
112 return mDevice; in getDevice()
207 mDevice.getSerialNumber(), cmd)); in doRunAllTestsInSubdirectory()
250 if (mDevice == null) { in run()
255 IFileEntry nativeTestDirectory = mDevice.getFileEntry(testPath); in run()
258 testPath, mDevice.getSerialNumber())); in run()
262 mDevice.executeShellCommand( in run()
266 doRunAllTestsInSubdirectory(nativeTestDirectory, mDevice, listener); in run()
269 mDevice.executeShellCommand( in run()
DClangCodeCoverageListener.java77 private final ITestDevice mDevice; field in ClangCodeCoverageListener
90 mDevice = device; in ClangCodeCoverageListener()
117 verify(mDevice.enableAdbRoot(), "Failed to enable adb root."); in testRunEnded()
125 mDevice.executeShellCommand(DELETE_COVERAGE_FILES_COMMAND); in testRunEnded()
156 mDevice.executeShellCommand(ZIP_CLANG_FILES_COMMAND); in logCoverageMeasurement()
157 coverageTarGz = mDevice.pullFile(COVERAGE_TAR_PATH); in logCoverageMeasurement()
162 mDevice.deleteFile(COVERAGE_TAR_PATH); in logCoverageMeasurement()
223 verifyNotNull(mDevice); in getCoverageFlusher()
226 mDevice, mConfiguration.getCoverageOptions().getCoverageProcesses()); in getCoverageFlusher()
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/junit4/
DDeviceParameterizedRunnerTest.java91 private ITestDevice mDevice; field in DeviceParameterizedRunnerTest
98 mDevice = EasyMock.createMock(ITestDevice.class); in setUp()
102 mTest.setDevice(mDevice); in setUp()
108 context.addAllocatedDevice("device", mDevice); in setUp()
137 EasyMock.replay(mDevice, mBuild, mListener); in testRun()
139 EasyMock.verify(mDevice, mBuild, mListener); in testRun()
167 EasyMock.replay(mDevice, mBuild, mListener); in testRun_collectOnly()
169 EasyMock.verify(mDevice, mBuild, mListener); in testRun_collectOnly()
188 EasyMock.replay(mDevice, mBuild, mListener); in testRun_method()
190 EasyMock.verify(mDevice, mBuild, mListener); in testRun_method()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/testtype/
DNativeBenchmarkTestTest.java45 private ITestDevice mDevice; field in NativeBenchmarkTestTest
52 mDevice = EasyMock.createMock(ITestDevice.class); in setUp()
53 EasyMock.expect(mDevice.getSerialNumber()).andStubReturn("SERIAL"); in setUp()
58 EasyMock.replay(mListener, mDevice); in replayMocks()
63 EasyMock.verify(mListener, mDevice); in verifyMocks()
97 mBenchmark.setDevice(mDevice); in testRun_noFileEntry()
98 EasyMock.expect(mDevice.getFileEntry((String) EasyMock.anyObject())).andReturn(null); in testRun_noFileEntry()
117 mBenchmark.setDevice(mDevice); in testRun_setMaxFrequency()
121 EasyMock.expect(mDevice.getFileEntry((String) EasyMock.anyObject())).andReturn(fakeEntry); in testRun_setMaxFrequency()
122 EasyMock.expect(mDevice.executeShellCommand(EasyMock.eq("cat " in testRun_setMaxFrequency()
[all …]
DUsbResetTestTest.java47 private ITestDevice mDevice; field in UsbResetTestTest
53 mDevice = Mockito.mock(ITestDevice.class); in setUp()
55 context.addAllocatedDevice(ConfigurationDef.DEFAULT_DEVICE_NAME, mDevice); in setUp()
74 doReturn("serial").when(mDevice).getSerialNumber(); in testReset()
79 verify(mDevice).waitForDeviceOnline(); in testReset()
80 verify(mDevice).reboot(); in testReset()
86 doReturn("serial").when(mDevice).getSerialNumber(); in testReset_recovery()
87 doReturn(TestDeviceState.RECOVERY).when(mDevice).getDeviceState(); in testReset_recovery()
92 verify(mDevice, times(0)).waitForDeviceOnline(); in testReset_recovery()
93 verify(mDevice).reboot(); in testReset_recovery()
[all …]
/tools/tradefederation/core/device_build_interfaces/com/android/tradefed/device/contentprovider/
DContentProviderHandler.java79 private ITestDevice mDevice; field in ContentProviderHandler
85 mDevice = device; in ContentProviderHandler()
102 if (mDevice.isPackageInstalled(PACKAGE_NAME, Integer.toString(mDevice.getCurrentUser()))) { in setUp()
116 mDevice.installPackage( in setUp()
129 mDevice.executeShellV2Command( in setUp()
141 mDevice.executeShellV2Command(String.format("cmd appops get %s", PACKAGE_NAME)); in setUp()
157 mDevice.uninstallPackage(PACKAGE_NAME); in tearDown()
172 "content delete --user %d --uri %s", mDevice.getCurrentUser(), contentUri); in deleteFile()
173 CommandResult deleteResult = mDevice.executeShellV2Command(deleteCommand); in deleteFile()
234 "content write --user %d --uri %s", mDevice.getCurrentUser(), contentUri); in pushFile()
[all …]
/tools/tradefederation/core/src/com/android/tradefed/util/sl4a/
DSl4aClient.java56 private ITestDevice mDevice; field in Sl4aClient
73 mDevice = device; in Sl4aClient()
96 mDevice = device; in Sl4aClient()
156 mDevice.executeShellCommand(String.format(SL4A_LAUNCH_CMD, mDeviceSidePort)); in startSl4A()
172 String out1 = mDevice.executeShellCommand(IS_SL4A_RUNNING_CMD_OLD); in isSl4ARunning()
173 String out2 = mDevice.executeShellCommand(IS_SL4A_RUNNING_CMD); in isSl4ARunning()
188 mDevice.executeAdbCommand("forward", "tcp:" + mHostPort, "tcp:" + mDeviceSidePort); in open()
189 String res = mDevice.executeAdbCommand("forward", "--list"); in open()
194 CLog.i("response sl4a INIT: '%s', from device %s", rep, mDevice.getSerialNumber()); in open()
243 CLog.v("preparing sending: '%s' to device %s", message, mDevice.getSerialNumber()); in sendThroughSocket()
[all …]
/tools/tradefederation/contrib/src/com/android/performance/tests/
DAppInstallTest.java97 private ITestDevice mDevice; field in AppInstallTest
104 mDevice = device; in setDevice()
112 return mDevice; in getDevice()
176 if (!mDevice.pushFile(packageFile, remotePath)) { in installAndTime()
185 if (!mDevice.pushFile(dexMetadataFile, dmRemotePath)) { in installAndTime()
194 String output = mDevice.executeShellCommand("pm install-create -r -d -g"); in installAndTime()
202 mDevice.executeShellCommand( in installAndTime()
211 mDevice.executeShellCommand( in installAndTime()
220 output = mDevice.executeShellCommand(String.format("pm install-commit %s", session)); in installAndTime()
228 mDevice.executeShellCommand(String.format("rm \"%s\"", remotePath)); in installAndTime()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/device/metric/
DDumpHeapCollectorTest.java56 @Mock private ITestDevice mDevice; field in DumpHeapCollectorTest
66 when(mDevice.executeShellCommand("dumpsys meminfo -c | grep camera")) in setup()
69 when(mDevice.executeShellCommand("dumpsys meminfo -c | grep maps")) in setup()
72 when(mDevice.executeShellCommand("am dumpheap camera /data/local/tmp/camera_trigger.hprof")) in setup()
87 when(mDevice.dumpHeap("maps", "/data/local/tmp/maps_trigger_1.hprof")) in testTakeDumpheap_success()
95 mDumpheapCollector.takeDumpheap(mDevice, fakeDumpheapOutput, "maps", 850L); in testTakeDumpheap_success()
104 when(mDevice.dumpHeap(anyString(), anyString())) in testCollect_success()
115 mDumpheapCollector.collect(mDevice, null); in testCollect_success()
141 when(mDevice.pullFile(anyString())).thenReturn(tempFile1).thenReturn(tempFile2); in testCollectSuccess_thresholdTooHigh()
150 mDumpheapCollector.collect(mDevice, null); in testCollectSuccess_thresholdTooHigh()
[all …]
DTemperatureCollectorTest.java46 private ITestDevice mDevice; field in TemperatureCollectorTest
53 mDevice = mock(ITestDevice.class); in setup()
54 when(mDevice.isAdbRoot()).thenReturn(true); in setup()
55 when(mContext.getDevices()).thenReturn(Collections.singletonList(mDevice)); in setup()
65 when(mDevice.executeShellCommand(eq("cat /sys/class/hwmon/hwmon1/device/msm_therm"))) in testCollector()
70 mCollector.collect(mDevice, data); in testCollector()
71 mCollector.collect(mDevice, data); in testCollector()
74 verify(mDevice, times(2)) in testCollector()
85 when(mDevice.executeShellCommand(eq("cat /sys/class/hwmon/hwmon1/device/msm_therm"))) in testCollectorNoData()
91 mCollector.collect(mDevice, data); in testCollectorNoData()
[all …]
DProcessMaxMemoryCollectorTest.java45 private ITestDevice mDevice; field in ProcessMaxMemoryCollectorTest
66 mDevice = mock(ITestDevice.class); in setup()
67 when(mContext.getDevices()).thenReturn(Collections.singletonList(mDevice)); in setup()
76 when(mDevice.executeShellCommand(Mockito.eq("dumpsys meminfo --checkin system_server"))) in testCollector()
81 mCollector.collect(mDevice, data); in testCollector()
84 verify(mDevice).executeShellCommand(Mockito.eq("dumpsys meminfo --checkin system_server")); in testCollector()
94 when(mDevice.executeShellCommand(Mockito.eq("dumpsys meminfo --checkin system_server"))) in testCollectorNoProcess()
99 mCollector.collect(mDevice, data); in testCollectorNoProcess()
102 verify(mDevice).executeShellCommand(Mockito.eq("dumpsys meminfo --checkin system_server")); in testCollectorNoProcess()
/tools/test/graphicsbenchmark/performance_tests/hostside/src/com/android/game/qualification/test/
DPerformanceTest.java67 private ITestDevice mDevice; field in PerformanceTest
115 mDevice = device; in PerformanceTest()
134 pb.environment().put("ANDROID_SERIAL", mDevice.getSerialNumber()); in setUp()
159 CLog.i("Installing %s on %s.", apkFile.getName(), mDevice.getSerialNumber()); in setUp()
160 mDevice.installPackage(apkFile, true); in setUp()
167 "Unable to unlock device: " + mDevice.getDeviceDescriptor(), in run()
168 mDevice.getKeyguardState().isKeyguardShowing()); in run()
194 try (InputStreamSource screenSource = mDevice.getScreenshot()) { in testScreenshot()
211 mDevice.uninstallPackage(mApk.getPackageName()); in tearDown()
249 File resultFile = mDevice.pullFileFromExternal(ResultData.RESULT_FILE_LOCATION); in retrieveResultData()
[all …]
/tools/tradefederation/core/tests/src/com/android/tradefed/invoker/shard/token/
DTelephonyTokenProviderTest.java36 private ITestDevice mDevice; field in TelephonyTokenProviderTest
49 mDevice = Mockito.mock(ITestDevice.class); in setUp()
57 assertTrue(provider.hasToken(mDevice, TokenProperty.SIM_CARD)); in testSimCard()
64 assertFalse(provider.hasToken(mDevice, TokenProperty.SIM_CARD)); in testSimCard_noSupport()
72 assertTrue(provider.hasToken(mDevice, TokenProperty.UICC_SIM_CARD)); in testSimCard_carrier()
82 .when(mDevice) in testSimCard_securedElementOrange()
84 assertTrue(provider.hasToken(mDevice, TokenProperty.SECURE_ELEMENT_SIM_CARD)); in testSimCard_securedElementOrange()
94 .when(mDevice) in testSimCard_securedElementOrange_dualSim()
96 assertTrue(provider.hasToken(mDevice, TokenProperty.SECURE_ELEMENT_SIM_CARD)); in testSimCard_securedElementOrange_dualSim()
106 .when(mDevice) in testSimCard_securedElement_anySim()
[all …]
/tools/tradefederation/core/test_framework/com/android/tradefed/testtype/rust/
DRustBinaryTest.java65 private ITestDevice mDevice = null; field in RustBinaryTest
76 mDevice = device; in setDevice()
82 return mDevice; in getDevice()
110 return fullPath == null || fullPath.isEmpty() || !mDevice.isExecutable(fullPath); in shouldSkipFile()
218 if (mDevice == null) { in run()
223 if (!mDevice.doesFileExist(testPath)) { in run()
231 new NativeCodeCoverageFlusher(mDevice, getCoverageOptions().getCoverageProcesses()); in run()
236 verify(mDevice.enableAdbRoot(), "Failed to enable adb root."); in run()
243 mDevice.executeShellCommand("mkdir /data/misc/trace/testcoverage"); in run()
248 if (!doRunAllTestsInSubdirectory(testPath, mDevice, listener)) { in run()
[all …]
/tools/tradefederation/core/src/com/android/tradefed/util/
DJavaCodeCoverageFlusher.java43 private final ITestDevice mDevice; field in JavaCodeCoverageFlusher
47 mDevice = device; in JavaCodeCoverageFlusher()
53 List<ProcessInfo> processes = PsParser.getProcesses(mDevice.executeShellCommand("ps -e")); in getAllProcessNames()
66 String pmListPackages = mDevice.executeShellCommand("pm list packages -a"); in getAllPackages()
100 String pid = mDevice.getProcessPid(processName); in resetCoverage()
103 mDevice.executeShellCommand(String.format(COVERAGE_RESET_FORMAT, processName)); in resetCoverage()
108 mDevice.executeShellCommand("cmd coverage reset"); in resetCoverage()
130 String pid = mDevice.getProcessPid(processName); in forceCoverageFlush()
134 mDevice.executeShellCommand( in forceCoverageFlush()
141 mDevice.executeShellCommand("cmd coverage dump /data/misc/trace/system_server.ec"); in forceCoverageFlush()
DNativeCodeCoverageFlusher.java37 private final ITestDevice mDevice; field in NativeCodeCoverageFlusher
41 mDevice = device; in NativeCodeCoverageFlusher()
53 mDevice.executeShellCommand(CLEAR_NATIVE_COVERAGE_FILES); in resetCoverage()
63 checkState(mDevice.isAdbRoot(), "adb root is required to flush native coverage data."); in forceCoverageFlush()
67 mDevice.executeShellCommand(String.format(COVERAGE_FLUSH_COMMAND_FORMAT, "-1")); in forceCoverageFlush()
72 String pid = mDevice.getProcessPid(processName); in forceCoverageFlush()
81 mDevice.executeShellCommand( in forceCoverageFlush()
87 mDevice.waitForDeviceAvailable(5 * 60 * 1000); in forceCoverageFlush()
/tools/tradefederation/core/src/com/android/tradefed/device/cloud/
DGceSshTunnelMonitor.java71 private ITestDevice mDevice; field in GceSshTunnelMonitor
104 mDevice = device; in GceSshTunnelMonitor()
157 if (!((RemoteAndroidDevice) mDevice) in closeConnection()
276 if (mDevice instanceof RemoteAndroidDevice) { in run()
277 ((RemoteAndroidDevice) mDevice).setAdbLogFile(mAdbConnectionLogs); in run()
283 mDevice, in run()
294 mLocalHostAndPort = HostAndPort.fromString(mDevice.getSerialNumber()); in run()
295 if (!((RemoteAndroidDevice) mDevice) in run()
394 if (mDevice instanceof RemoteAndroidDevice) { in logSshTunnelLogs()
395 ((RemoteAndroidDevice) mDevice).setAdbLogFile(null); in logSshTunnelLogs()

1234