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

Side by Side Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 1894233002: (Reland) [Android] Get package_info by using apk_under_test package. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add check to see if _apk_under_test is not None Created 4 years, 8 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/constants/__init__.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 # 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 logging 7 import logging
8 import os 8 import os
9 import pickle 9 import pickle
10 import re 10 import re
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 if not os.path.exists(self._test_apk.path): 270 if not os.path.exists(self._test_apk.path):
271 error_func('Unable to find test APK: %s' % self._test_apk.path) 271 error_func('Unable to find test APK: %s' % self._test_apk.path)
272 if not os.path.exists(self._test_jar): 272 if not os.path.exists(self._test_jar):
273 error_func('Unable to find test JAR: %s' % self._test_jar) 273 error_func('Unable to find test JAR: %s' % self._test_jar)
274 274
275 self._test_package = self._test_apk.GetPackageName() 275 self._test_package = self._test_apk.GetPackageName()
276 self._test_runner = self._test_apk.GetInstrumentationName() 276 self._test_runner = self._test_apk.GetInstrumentationName()
277 277
278 self._package_info = None 278 self._package_info = None
279 for package_info in constants.PACKAGE_INFO.itervalues(): 279 if self._apk_under_test:
280 if self._test_package == package_info.test_package: 280 package_under_test = self._apk_under_test.GetPackageName()
281 self._package_info = package_info 281 for package_info in constants.PACKAGE_INFO.itervalues():
282 if package_under_test == package_info.package:
283 self._package_info = package_info
282 if not self._package_info: 284 if not self._package_info:
283 logging.warning('Unable to find package info for %s', self._test_package) 285 logging.warning('Unable to find package info for %s', self._test_package)
284 286
285 for apk in args.additional_apks: 287 for apk in args.additional_apks:
286 if not os.path.exists(apk): 288 if not os.path.exists(apk):
287 error_func('Unable to find additional APK: %s' % apk) 289 error_func('Unable to find additional APK: %s' % apk)
288 self._additional_apks = ( 290 self._additional_apks = (
289 [apk_helper.ToHelper(x) for x in args.additional_apks]) 291 [apk_helper.ToHelper(x) for x in args.additional_apks])
290 292
291 def _initializeDataDependencyAttributes(self, args, isolate_delegate): 293 def _initializeDataDependencyAttributes(self, args, isolate_delegate):
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 def GenerateTestResults( 637 def GenerateTestResults(
636 result_code, result_bundle, statuses, start_ms, duration_ms): 638 result_code, result_bundle, statuses, start_ms, duration_ms):
637 return GenerateTestResults(result_code, result_bundle, statuses, 639 return GenerateTestResults(result_code, result_bundle, statuses,
638 start_ms, duration_ms) 640 start_ms, duration_ms)
639 641
640 #override 642 #override
641 def TearDown(self): 643 def TearDown(self):
642 if self._isolate_delegate: 644 if self._isolate_delegate:
643 self._isolate_delegate.Clear() 645 self._isolate_delegate.Clear()
644 646
OLDNEW
« no previous file with comments | « build/android/pylib/constants/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698