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

Unified Diff: build/android/pylib/device/device_utils_test.py

Issue 354863003: [Android] Switch to DeviceUtils versions of GoHome, ForceStop, etc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/gtest/test_package_apk.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/device_utils_test.py
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
index 5b34673f59a9386cf8f8ba77bd0e0659eabcd082..4c60514da05c2191d87874ffa025d68e0dd68da3 100644
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -682,6 +682,41 @@ class DeviceUtilsOldImplTest(unittest.TestCase):
'Broadcasting: Intent { act=test.package.with.an.INTENT } '):
self.device.BroadcastIntent(test_intent)
+ def testGoHome(self):
+ with self.assertOldImplCalls(
+ "adb -s 0123456789abcdef shell 'am start "
+ "-W "
+ "-a android.intent.action.MAIN "
+ "-c android.intent.category.HOME'",
+ 'Starting: Intent { act=android.intent.action.MAIN }\r\n'):
+ self.device.GoHome()
+
+ def testForceStop(self):
+ with self.assertOldImplCalls(
+ "adb -s 0123456789abcdef shell 'am force-stop this.is.a.test.package'",
+ ''):
+ self.device.ForceStop('this.is.a.test.package')
+
+ def testClearApplicationState_packageExists(self):
+ with self.assertOldImplCalls(
+ "adb -s 0123456789abcdef shell 'pm path this.package.does.not.exist'",
+ ''):
+ self.device.ClearApplicationState('this.package.does.not.exist')
+
+ def testClearApplicationState_packageDoesntExist(self):
+ with self.assertOldImplCallsSequence([
+ ("adb -s 0123456789abcdef shell 'pm path this.package.exists'",
+ 'package:/data/app/this.package.exists.apk'),
+ ("adb -s 0123456789abcdef shell 'pm clear this.package.exists'",
+ 'Success\r\n')]):
+ self.device.ClearApplicationState('this.package.exists')
+
+ def testSendKeyEvent(self):
+ with self.assertOldImplCalls(
+ "adb -s 0123456789abcdef shell 'input keyevent 66'",
+ ''):
+ self.device.SendKeyEvent(66)
+
if __name__ == '__main__':
unittest.main(verbosity=2)
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/gtest/test_package_apk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698