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

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

Issue 2822573002: Fix android_action_runner.InputSwipe and InputText (Closed)
Patch Set: 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
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..b4dfe6223923f0945b60eb7e32ed335d78a5b7d6 100755
--- a/devil/devil/android/device_utils_test.py
+++ b/devil/devil/android/device_utils_test.py
@@ -1538,12 +1538,24 @@ class DeviceUtilsGoHomeTest(DeviceUtilsTest):
class DeviceUtilsForceStopTest(DeviceUtilsTest):
+ def testForceStop_sdkGreaterThanNougatMR1(self):
+ with self.patch_call(self.call.device.build_version_sdk,
+ return_value=(version_codes.NOUGAT_MR1 + 1)):
+ with self.patch_call(self.call.device.build_id, return_value='ZZZ99Z'):
+ with self.assertCall(
+ self.call.adb.Shell('p=test.package;if [[ "$(ps -e)" = *$p* ]]; '
+ 'then am force-stop $p; fi'),
+ ''):
+ self.device.ForceStop('test.package')
+
def testForceStop(self):
- with self.assertCall(
- self.call.adb.Shell('p=test.package;if [[ "$(ps)" = *$p* ]]; then '
- 'am force-stop $p; fi'),
- ''):
- self.device.ForceStop('test.package')
+ with self.patch_call(self.call.device.build_version_sdk,
+ return_value=(version_codes.LOLLIPOP)):
+ with self.assertCall(
+ self.call.adb.Shell('p=test.package;if [[ "$(ps)" = *$p* ]]; then '
+ 'am force-stop $p; fi'),
+ ''):
+ self.device.ForceStop('test.package')
class DeviceUtilsClearApplicationStateTest(DeviceUtilsTest):

Powered by Google App Engine
This is Rietveld 408576698