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

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

Issue 1335673004: [Android] grant READ_EXTERNAL_STORAGE permission when adding WRITE_EXTERNAL_STORAGE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/devil/android/device_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/android/device_utils_test.py
diff --git a/build/android/devil/android/device_utils_test.py b/build/android/devil/android/device_utils_test.py
index 471ef21edc2b2f7ad2a7b443ca37ebf30a931c7b..6276ff2b138613a55a9f15e34615d90d393bebff 100755
--- a/build/android/devil/android/device_utils_test.py
+++ b/build/android/devil/android/device_utils_test.py
@@ -2064,7 +2064,7 @@ class DeviceUtilsGrantPermissionsTest(DeviceUtilsTest):
self.device.GrantPermissions('package', ['p1'])
def testGrantPermissions_one(self):
- permissions_cmd = 'pm grant package p1;'
+ permissions_cmd = 'pm grant package p1'
with self.patch_call(self.call.device.build_version_sdk,
return_value=23):
with self.assertCalls(
@@ -2072,13 +2072,30 @@ class DeviceUtilsGrantPermissionsTest(DeviceUtilsTest):
self.device.GrantPermissions('package', ['p1'])
def testGrantPermissions_multiple(self):
- permissions_cmd = 'pm grant package p1;pm grant package p2;'
+ permissions_cmd = 'pm grant package p1;pm grant package p2'
with self.patch_call(self.call.device.build_version_sdk,
return_value=23):
with self.assertCalls(
(self.call.device.RunShellCommand(permissions_cmd), [])):
self.device.GrantPermissions('package', ['p1', 'p2'])
+ def testGrantPermissions_WriteExtrnalStorage(self):
+ permissions_cmd = (
+ 'pm grant package android.permission.WRITE_EXTERNAL_STORAGE;'
+ 'pm grant package android.permission.READ_EXTERNAL_STORAGE')
+ with self.patch_call(self.call.device.build_version_sdk,
+ return_value=23):
+ with self.assertCalls(
+ (self.call.device.RunShellCommand(permissions_cmd), [])):
+ self.device.GrantPermissions(
+ 'package', ['android.permission.WRITE_EXTERNAL_STORAGE'])
+
+ def testGrantPermissions_BlackList(self):
+ with self.patch_call(
+ self.call.device.build_version_sdk, return_value=23):
+ self.device.GrantPermissions(
+ 'package', ['android.permission.ACCESS_MOCK_LOCATION'])
+
if __name__ == '__main__':
logging.getLogger().setLevel(logging.DEBUG)
« no previous file with comments | « build/android/devil/android/device_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698