Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Unified Diff: devil/devil/android/device_utils_test.py

Issue 2815573003: Fix force stop using wrong "ps" cmd. (Closed)
Patch Set: Fix force stop using wrong "ps" cmd. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « devil/devil/android/device_utils.py ('k') | devil/devil/android/sdk/adb_wrapper.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: devil/devil/android/device_utils_test.py
diff --git a/devil/devil/android/device_utils_test.py b/devil/devil/android/device_utils_test.py
index 2490209631075502df03c9f81c035b8da05ef2b6..975399e3ab69a6fec73b6405f7306a247e868528 100755
--- a/devil/devil/android/device_utils_test.py
+++ b/devil/devil/android/device_utils_test.py
@@ -1539,10 +1539,17 @@ class DeviceUtilsGoHomeTest(DeviceUtilsTest):
class DeviceUtilsForceStopTest(DeviceUtilsTest):
def testForceStop(self):
+ with self.assertCalls(
+ (self.call.device.GetPids('test.package'), {'test.package': [1111]}),
+ (self.call.device.RunShellCommand(
+ ['am', 'force-stop', 'test.package'],
+ check_return=True),
+ ['Success'])):
+ self.device.ForceStop('test.package')
+
+ def testForceStop_NoProcessFound(self):
with self.assertCall(
- self.call.adb.Shell('p=test.package;if [[ "$(ps)" = *$p* ]]; then '
- 'am force-stop $p; fi'),
- ''):
+ self.call.device.GetPids('test.package'), {}):
self.device.ForceStop('test.package')
« no previous file with comments | « devil/devil/android/device_utils.py ('k') | devil/devil/android/sdk/adb_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698