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

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

Issue 1166113002: Add InstallSplitApk function to device utils. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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 23a1a325e7680dda7e12d2fa8a3c8e6a084b8d3b..782d154350161e69bdd9d3a2a8ffcdbf7dcad9ce 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -304,30 +304,30 @@ class DeviceUtilsGetExternalStoragePathTest(DeviceUtilsTest):
self.device.GetExternalStoragePath()
-class DeviceUtilsGetApplicationPathTest(DeviceUtilsTest):
+class DeviceUtilsGetApplicationPathsTest(DeviceUtilsTest):
- def testGetApplicationPath_exists(self):
+ def testGetApplicationPaths_exists(self):
with self.assertCalls(
(self.call.adb.Shell('getprop ro.build.version.sdk'), '19\n'),
(self.call.adb.Shell('pm path android'),
'package:/path/to/android.apk\n')):
- self.assertEquals('/path/to/android.apk',
- self.device.GetApplicationPath('android'))
+ self.assertEquals(['/path/to/android.apk'],
+ self.device.GetApplicationPaths('android'))
- def testGetApplicationPath_notExists(self):
+ def testGetApplicationPaths_notExists(self):
with self.assertCalls(
(self.call.adb.Shell('getprop ro.build.version.sdk'), '19\n'),
(self.call.adb.Shell('pm path not.installed.app'), '')):
self.assertEquals(None,
- self.device.GetApplicationPath('not.installed.app'))
+ self.device.GetApplicationPaths('not.installed.app'))
- def testGetApplicationPath_fails(self):
+ def testGetApplicationPaths_fails(self):
with self.assertCalls(
(self.call.adb.Shell('getprop ro.build.version.sdk'), '19\n'),
(self.call.adb.Shell('pm path android'),
self.CommandError('ERROR. Is package manager running?\n'))):
with self.assertRaises(device_errors.CommandFailedError):
- self.device.GetApplicationPath('android')
+ self.device.GetApplicationPaths('android')
@mock.patch('time.sleep', mock.Mock())
@@ -340,8 +340,8 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
(self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
(self.call.adb.Shell('test -d /fake/storage/path'), ''),
# pm_ready
- (self.call.device.GetApplicationPath('android'),
- 'package:/some/fake/path'),
+ (self.call.device.GetApplicationPaths('android'),
+ ['package:/some/fake/path']),
# boot_completed
(self.call.device.GetProp('sys.boot_completed'), '1')):
self.device.WaitUntilFullyBooted(wifi=False)
@@ -353,8 +353,8 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
(self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
(self.call.adb.Shell('test -d /fake/storage/path'), ''),
# pm_ready
- (self.call.device.GetApplicationPath('android'),
- 'package:/some/fake/path'),
+ (self.call.device.GetApplicationPaths('android'),
+ ['package:/some/fake/path']),
# boot_completed
(self.call.device.GetProp('sys.boot_completed'), '1'),
# wifi_enabled
@@ -393,11 +393,11 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
(self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
(self.call.adb.Shell('test -d /fake/storage/path'), ''),
# pm_ready
- (self.call.device.GetApplicationPath('android'), self.CommandError()),
+ (self.call.device.GetApplicationPaths('android'), self.CommandError()),
# pm_ready
- (self.call.device.GetApplicationPath('android'), self.CommandError()),
+ (self.call.device.GetApplicationPaths('android'), self.CommandError()),
# pm_ready
- (self.call.device.GetApplicationPath('android'), self.TimeoutError())):
+ (self.call.device.GetApplicationPaths('android'), self.TimeoutError())):
with self.assertRaises(device_errors.CommandTimeoutError):
self.device.WaitUntilFullyBooted(wifi=False)
@@ -408,8 +408,8 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
(self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
(self.call.adb.Shell('test -d /fake/storage/path'), ''),
# pm_ready
- (self.call.device.GetApplicationPath('android'),
- 'package:/some/fake/path'),
+ (self.call.device.GetApplicationPaths('android'),
+ ['package:/some/fake/path']),
# boot_completed
(self.call.device.GetProp('sys.boot_completed'), '0'),
# boot_completed
@@ -426,8 +426,8 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
(self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
(self.call.adb.Shell('test -d /fake/storage/path'), ''),
# pm_ready
- (self.call.device.GetApplicationPath('android'),
- 'package:/some/fake/path'),
+ (self.call.device.GetApplicationPaths('android'),
+ ['package:/some/fake/path']),
# boot_completed
(self.call.device.GetProp('sys.boot_completed'), '1'),
# wifi_enabled
@@ -473,7 +473,7 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
with self.assertCalls(
(mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
'this.is.a.test.package'),
- (self.call.device.GetApplicationPath('this.is.a.test.package'), None),
+ (self.call.device.GetApplicationPaths('this.is.a.test.package'), []),
self.call.adb.Install('/fake/test/app.apk', reinstall=False)):
self.device.Install('/fake/test/app.apk', retries=0)
@@ -481,8 +481,8 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
with self.assertCalls(
(mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
'this.is.a.test.package'),
- (self.call.device.GetApplicationPath('this.is.a.test.package'),
- '/fake/data/app/this.is.a.test.package.apk'),
+ (self.call.device.GetApplicationPaths('this.is.a.test.package'),
+ ['/fake/data/app/this.is.a.test.package.apk']),
(self.call.device._GetChangedFilesImpl(
'/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
[('/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk')]),
@@ -494,8 +494,8 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
with self.assertCalls(
(mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
'this.is.a.test.package'),
- (self.call.device.GetApplicationPath('this.is.a.test.package'),
- '/fake/data/app/this.is.a.test.package.apk'),
+ (self.call.device.GetApplicationPaths('this.is.a.test.package'),
+ ['/fake/data/app/this.is.a.test.package.apk']),
(self.call.device._GetChangedFilesImpl(
'/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
[('/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk')]),
@@ -506,8 +506,8 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
with self.assertCalls(
(mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
'this.is.a.test.package'),
- (self.call.device.GetApplicationPath('this.is.a.test.package'),
- '/fake/data/app/this.is.a.test.package.apk'),
+ (self.call.device.GetApplicationPaths('this.is.a.test.package'),
+ ['/fake/data/app/this.is.a.test.package.apk']),
(self.call.device._GetChangedFilesImpl(
'/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
[])):
@@ -517,7 +517,7 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
with self.assertCalls(
(mock.call.pylib.utils.apk_helper.GetPackageName('/fake/test/app.apk'),
'this.is.a.test.package'),
- (self.call.device.GetApplicationPath('this.is.a.test.package'), None),
+ (self.call.device.GetApplicationPaths('this.is.a.test.package'), []),
(self.call.adb.Install('/fake/test/app.apk', reinstall=False),
self.CommandError('Failure\r\n'))):
with self.assertRaises(device_errors.CommandFailedError):
@@ -1033,8 +1033,8 @@ class DeviceUtilsClearApplicationStateTest(DeviceUtilsTest):
def testClearApplicationState_packageDoesntExist(self):
with self.assertCalls(
(self.call.adb.Shell('getprop ro.build.version.sdk'), '17\n'),
- (self.call.device.GetApplicationPath('this.package.does.not.exist'),
- None)):
+ (self.call.device.GetApplicationPaths('this.package.does.not.exist'),
+ [])):
self.device.ClearApplicationState('this.package.does.not.exist')
def testClearApplicationState_packageDoesntExistOnAndroidJBMR2OrAbove(self):
@@ -1047,8 +1047,8 @@ class DeviceUtilsClearApplicationStateTest(DeviceUtilsTest):
def testClearApplicationState_packageExists(self):
with self.assertCalls(
(self.call.adb.Shell('getprop ro.build.version.sdk'), '17\n'),
- (self.call.device.GetApplicationPath('this.package.exists'),
- '/data/app/this.package.exists.apk'),
+ (self.call.device.GetApplicationPaths('this.package.exists'),
+ ['/data/app/this.package.exists.apk']),
(self.call.adb.Shell('pm clear this.package.exists'),
'Success\r\n')):
self.device.ClearApplicationState('this.package.exists')
« build/android/pylib/device/device_utils.py ('K') | « build/android/pylib/device/device_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698