| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import collections | 5 import collections |
| 6 import copy | 6 import copy |
| 7 import json | 7 import json |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import pickle | 10 import pickle |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 return tests | 314 return tests |
| 315 | 315 |
| 316 | 316 |
| 317 def _GetTestsFromPickle(pickle_path, jar_path): | 317 def _GetTestsFromPickle(pickle_path, jar_path): |
| 318 if not os.path.exists(pickle_path): | 318 if not os.path.exists(pickle_path): |
| 319 raise TestListPickleException('%s does not exist.' % pickle_path) | 319 raise TestListPickleException('%s does not exist.' % pickle_path) |
| 320 if os.path.getmtime(pickle_path) <= os.path.getmtime(jar_path): | 320 if os.path.getmtime(pickle_path) <= os.path.getmtime(jar_path): |
| 321 raise TestListPickleException( | 321 raise TestListPickleException( |
| 322 '%s newer than %s.' % (jar_path, pickle_path)) | 322 '%s newer than %s.' % (jar_path, pickle_path)) |
| 323 | 323 |
| 324 with open(pickle_path, 'r') as pickle_file: | 324 with open(pickle_path, 'r') as f: |
| 325 pickle_data = pickle.loads(pickle_file.read()) | 325 pickle_data = pickle.load(f) |
| 326 jar_md5 = md5sum.CalculateHostMd5Sums(jar_path)[jar_path] | 326 jar_md5 = md5sum.CalculateHostMd5Sums(jar_path)[jar_path] |
| 327 | 327 |
| 328 if pickle_data['VERSION'] != _PICKLE_FORMAT_VERSION: | 328 if pickle_data['VERSION'] != _PICKLE_FORMAT_VERSION: |
| 329 raise TestListPickleException('PICKLE_FORMAT_VERSION has changed.') | 329 raise TestListPickleException('PICKLE_FORMAT_VERSION has changed.') |
| 330 if pickle_data['JAR_MD5SUM'] != jar_md5: | 330 if pickle_data['JAR_MD5SUM'] != jar_md5: |
| 331 raise TestListPickleException('JAR file MD5 sum differs.') | 331 raise TestListPickleException('JAR file MD5 sum differs.') |
| 332 return pickle_data['TEST_METHODS'] | 332 return pickle_data['TEST_METHODS'] |
| 333 | 333 |
| 334 | 334 |
| 335 def _GetTestsFromProguard(jar_path): | 335 def _GetTestsFromProguard(jar_path): |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 | 882 |
| 883 @staticmethod | 883 @staticmethod |
| 884 def GenerateTestResults( | 884 def GenerateTestResults( |
| 885 result_code, result_bundle, statuses, start_ms, duration_ms): | 885 result_code, result_bundle, statuses, start_ms, duration_ms): |
| 886 return GenerateTestResults(result_code, result_bundle, statuses, | 886 return GenerateTestResults(result_code, result_bundle, statuses, |
| 887 start_ms, duration_ms) | 887 start_ms, duration_ms) |
| 888 | 888 |
| 889 #override | 889 #override |
| 890 def TearDown(self): | 890 def TearDown(self): |
| 891 pass | 891 pass |
| OLD | NEW |