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

Unified Diff: build/android/pylib/instrumentation/test_jar.py

Issue 738413002: [Android] Extract MD5sum logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/utils/md5sum.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/test_jar.py
diff --git a/build/android/pylib/instrumentation/test_jar.py b/build/android/pylib/instrumentation/test_jar.py
index 139ede5f1c8caaa0ec389dfecf88a2f60ac28b8f..4473810e6202edddbcf384ecff2cb4dbe98a1904 100644
--- a/build/android/pylib/instrumentation/test_jar.py
+++ b/build/android/pylib/instrumentation/test_jar.py
@@ -14,6 +14,7 @@ import sys
from pylib import cmd_helper
from pylib import constants
from pylib.device import device_utils
+from pylib.utils import md5sum
from pylib.utils import proguard
sys.path.insert(0,
@@ -55,16 +56,6 @@ class TestJar(object):
if not self._GetCachedProguardData():
self._GetProguardData()
- @staticmethod
- def _CalculateMd5(path):
- # TODO(jbudorick): Move MD5sum calculations out of here and
- # AndroidCommands to their own module.
- out = cmd_helper.GetCmdOutput(
- [os.path.join(constants.GetOutDirectory(),
- 'md5sum_bin_host'),
- path])
- return out
-
def _GetCachedProguardData(self):
if (os.path.exists(self._pickled_proguard_name) and
(os.path.getmtime(self._pickled_proguard_name) >
@@ -74,7 +65,7 @@ class TestJar(object):
try:
with open(self._pickled_proguard_name, 'r') as r:
d = pickle.loads(r.read())
- jar_md5 = self._CalculateMd5(self._jar_path)
+ jar_md5 = md5sum.CalculateHostMd5Sums(self._jar_path)[0].hash
if (d['JAR_MD5SUM'] == jar_md5 and
d['VERSION'] == PICKLE_FORMAT_VERSION):
self._test_methods = d['TEST_METHODS']
@@ -114,7 +105,7 @@ class TestJar(object):
logging.info('Storing proguard output to %s', self._pickled_proguard_name)
d = {'VERSION': PICKLE_FORMAT_VERSION,
'TEST_METHODS': self._test_methods,
- 'JAR_MD5SUM': self._CalculateMd5(self._jar_path)}
+ 'JAR_MD5SUM': md5sum.CalculateHostMd5Sums(self._jar_path)[0].hash}
with open(self._pickled_proguard_name, 'w') as f:
f.write(pickle.dumps(d))
« no previous file with comments | « build/android/pylib/device/device_utils.py ('k') | build/android/pylib/utils/md5sum.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698