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

Side by Side Diff: build/android/pylib/device/device_utils_test.py

Issue 926643003: [Android] DeviceUtils: Prefer our unzip implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """ 6 """
7 Unit tests for the contents of device_utils.py (mostly DeviceUtils). 7 Unit tests for the contents of device_utils.py (mostly DeviceUtils).
8 """ 8 """
9 9
10 # pylint: disable=C0321 10 # pylint: disable=C0321
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 (mock.call.multiprocessing.Process( 1038 (mock.call.multiprocessing.Process(
1039 target=device_utils.DeviceUtils._CreateDeviceZip, 1039 target=device_utils.DeviceUtils._CreateDeviceZip,
1040 args=('/test/temp/file/tmp.zip', test_files)), mock.Mock()), 1040 args=('/test/temp/file/tmp.zip', test_files)), mock.Mock()),
1041 (self.call.device.GetExternalStoragePath(), 1041 (self.call.device.GetExternalStoragePath(),
1042 '/test/device/external_dir'), 1042 '/test/device/external_dir'),
1043 self.call.adb.Push( 1043 self.call.adb.Push(
1044 '/test/temp/file/tmp.zip', '/test/device/external_dir/tmp.zip'), 1044 '/test/temp/file/tmp.zip', '/test/device/external_dir/tmp.zip'),
1045 self.call.device.RunShellCommand( 1045 self.call.device.RunShellCommand(
1046 ['unzip', '/test/device/external_dir/tmp.zip'], 1046 ['unzip', '/test/device/external_dir/tmp.zip'],
1047 as_root=True, 1047 as_root=True,
1048 env={'PATH': '$PATH:/data/local/tmp/bin'}, 1048 env={'PATH': '/data/local/tmp/bin:$PATH'},
1049 check_return=True), 1049 check_return=True),
1050 (self.call.device.IsOnline(), True), 1050 (self.call.device.IsOnline(), True),
1051 self.call.device.RunShellCommand( 1051 self.call.device.RunShellCommand(
1052 ['rm', '/test/device/external_dir/tmp.zip'], check_return=True)): 1052 ['rm', '/test/device/external_dir/tmp.zip'], check_return=True)):
1053 self.device._PushChangedFilesZipped(test_files) 1053 self.device._PushChangedFilesZipped(test_files)
1054 1054
1055 def testPushChangedFilesZipped_single(self): 1055 def testPushChangedFilesZipped_single(self):
1056 self._testPushChangedFilesZipped_spec( 1056 self._testPushChangedFilesZipped_spec(
1057 [('/test/host/path/file1', '/test/device/path/file1')]) 1057 [('/test/host/path/file1', '/test/device/path/file1')])
1058 1058
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 self.assertTrue( 1455 self.assertTrue(
1456 isinstance(device, device_utils.DeviceUtils) 1456 isinstance(device, device_utils.DeviceUtils)
1457 and serial == str(device), 1457 and serial == str(device),
1458 'Expected a DeviceUtils object with serial %s' % serial) 1458 'Expected a DeviceUtils object with serial %s' % serial)
1459 1459
1460 1460
1461 if __name__ == '__main__': 1461 if __name__ == '__main__':
1462 logging.getLogger().setLevel(logging.DEBUG) 1462 logging.getLogger().setLevel(logging.DEBUG)
1463 unittest.main(verbosity=2) 1463 unittest.main(verbosity=2)
1464 1464
OLDNEW
« no previous file with comments | « 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