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

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

Issue 1165623003: [Android] Allow gtests to pull app data off the device before clearing it. (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
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/gtest/gtest_test_instance.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 317e81e83b619ea83afa8b93c9cab6767a8c1159..ca097b79c9b067253090876b4627d8c40ac11d17 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -336,6 +336,25 @@ class DeviceUtilsGetApplicationPathTest(DeviceUtilsTest):
self.device.GetApplicationPath('android')
+class DeviceUtilsGetApplicationDataDirectoryTest(DeviceUtilsTest):
+
+ def testGetApplicationDataDirectory_exists(self):
+ with self.assertCall(
+ self.call.device._RunPipedShellCommand(
+ 'pm dump foo.bar.baz | grep dataDir='),
+ ['dataDir=/data/data/foo.bar.baz']):
+ self.assertEquals(
+ '/data/data/foo.bar.baz',
+ self.device.GetApplicationDataDirectory('foo.bar.baz'))
+
+ def testGetApplicationDataDirectory_notExists(self):
+ with self.assertCall(
+ self.call.device._RunPipedShellCommand(
+ 'pm dump foo.bar.baz | grep dataDir='),
+ self.ShellError()):
+ self.assertIsNone(self.device.GetApplicationDataDirectory('foo.bar.baz'))
+
+
@mock.patch('time.sleep', mock.Mock())
class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/gtest/gtest_test_instance.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698