| 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 6699673431d3f4150e5ecdd60b762333e2c17993..abf1152c201a8fd39d5abf32ccf1a6fc83e1d801 100755
|
| --- a/build/android/pylib/device/device_utils_test.py
|
| +++ b/build/android/pylib/device/device_utils_test.py
|
| @@ -366,7 +366,7 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
|
| (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
|
| (self.call.adb.Shell('test -d /fake/storage/path'), ''),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| ['package:/some/fake/path']),
|
| # boot_completed
|
| (self.call.device.GetProp('sys.boot_completed'), '1')):
|
| @@ -379,7 +379,7 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
|
| (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
|
| (self.call.adb.Shell('test -d /fake/storage/path'), ''),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| ['package:/some/fake/path']),
|
| # boot_completed
|
| (self.call.device.GetProp('sys.boot_completed'), '1'),
|
| @@ -403,7 +403,7 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
|
| (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
|
| (self.call.adb.Shell('test -d /fake/storage/path'), ''),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| ['package:/some/fake/path']),
|
| # boot_completed
|
| (self.call.device.GetProp('sys.boot_completed'), '1')):
|
| @@ -440,11 +440,14 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
|
| (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
|
| (self.call.adb.Shell('test -d /fake/storage/path'), ''),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'), self.CommandError()),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| + self.CommandError()),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'), self.CommandError()),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| + self.CommandError()),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'), self.TimeoutError())):
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| + self.TimeoutError())):
|
| with self.assertRaises(device_errors.CommandTimeoutError):
|
| self.device.WaitUntilFullyBooted(wifi=False)
|
|
|
| @@ -455,7 +458,7 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
|
| (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
|
| (self.call.adb.Shell('test -d /fake/storage/path'), ''),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| ['package:/some/fake/path']),
|
| # boot_completed
|
| (self.call.device.GetProp('sys.boot_completed'), '0'),
|
| @@ -473,7 +476,7 @@ class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
|
| (self.call.device.GetExternalStoragePath(), '/fake/storage/path'),
|
| (self.call.adb.Shell('test -d /fake/storage/path'), ''),
|
| # pm_ready
|
| - (self.call.device.GetApplicationPaths('android'),
|
| + (self.call.device.GetApplicationPaths('android', skip_cache=True),
|
| ['package:/some/fake/path']),
|
| # boot_completed
|
| (self.call.device.GetProp('sys.boot_completed'), '1'),
|
| @@ -530,10 +533,9 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
|
| 'this.is.a.test.package'),
|
| (self.call.device.GetApplicationPaths('this.is.a.test.package'),
|
| ['/fake/data/app/this.is.a.test.package.apk']),
|
| - (self.call.device._GetChangedAndStaleFiles(
|
| - '/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')],
|
| - [])),
|
| + (self.call.device._ComputeStaleApks('this.is.a.test.package',
|
| + ['/fake/test/app.apk']),
|
| + (['/fake/test/app.apk'], None)),
|
| self.call.adb.Uninstall('this.is.a.test.package'),
|
| self.call.adb.Install('/fake/test/app.apk', reinstall=False)):
|
| self.device.Install('/fake/test/app.apk', retries=0)
|
| @@ -544,10 +546,9 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
|
| 'this.is.a.test.package'),
|
| (self.call.device.GetApplicationPaths('this.is.a.test.package'),
|
| ['/fake/data/app/this.is.a.test.package.apk']),
|
| - (self.call.device._GetChangedAndStaleFiles(
|
| - '/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')],
|
| - [])),
|
| + (self.call.device._ComputeStaleApks('this.is.a.test.package',
|
| + ['/fake/test/app.apk']),
|
| + (['/fake/test/app.apk'], None)),
|
| self.call.adb.Install('/fake/test/app.apk', reinstall=True)):
|
| self.device.Install('/fake/test/app.apk', reinstall=True, retries=0)
|
|
|
| @@ -557,9 +558,9 @@ class DeviceUtilsInstallTest(DeviceUtilsTest):
|
| 'this.is.a.test.package'),
|
| (self.call.device.GetApplicationPaths('this.is.a.test.package'),
|
| ['/fake/data/app/this.is.a.test.package.apk']),
|
| - (self.call.device._GetChangedAndStaleFiles(
|
| - '/fake/test/app.apk', '/fake/data/app/this.is.a.test.package.apk'),
|
| - ([], []))):
|
| + (self.call.device._ComputeStaleApks('this.is.a.test.package',
|
| + ['/fake/test/app.apk']),
|
| + ([], None))):
|
| self.device.Install('/fake/test/app.apk', retries=0)
|
|
|
| def testInstall_fails(self):
|
| @@ -600,12 +601,9 @@ class DeviceUtilsInstallSplitApkTest(DeviceUtilsTest):
|
| 'test.package'),
|
| (self.call.device.GetApplicationPaths('test.package'),
|
| ['base-on-device.apk', 'split2-on-device.apk']),
|
| - (mock.call.pylib.utils.md5sum.CalculateDeviceMd5Sums(
|
| - ['base-on-device.apk', 'split2-on-device.apk'], self.device),
|
| - {'base-on-device.apk': 'AAA', 'split2-on-device.apk': 'BBB'}),
|
| - (mock.call.pylib.utils.md5sum.CalculateHostMd5Sums(
|
| - ['base.apk', 'split2.apk']),
|
| - {'base.apk': 'AAA', 'split2.apk': 'CCC'}),
|
| + (self.call.device._ComputeStaleApks('test.package',
|
| + ['base.apk', 'split2.apk']),
|
| + (['split2.apk'], None)),
|
| (self.call.adb.InstallMultiple(
|
| ['split2.apk'], partial='test.package', reinstall=True))):
|
| self.device.InstallSplitApk('base.apk',
|
|
|