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

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

Issue 2294843002: [Android] Fix a few more symlink issues in test_runner.py. (Closed)
Patch Set: prereview: remove leftover pdb tracepoint Created 4 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 unified diff | Download patch
« no previous file with comments | « build/android/pylib/gtest/gtest_test_instance.py ('k') | build/android/test_runner.py » ('j') | 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 self._initializeTombstonesAttributes(args) 399 self._initializeTombstonesAttributes(args)
400 400
401 def _initializeApkAttributes(self, args, error_func): 401 def _initializeApkAttributes(self, args, error_func):
402 if args.apk_under_test: 402 if args.apk_under_test:
403 apk_under_test_path = args.apk_under_test 403 apk_under_test_path = args.apk_under_test
404 if not args.apk_under_test.endswith('.apk'): 404 if not args.apk_under_test.endswith('.apk'):
405 apk_under_test_path = os.path.join( 405 apk_under_test_path = os.path.join(
406 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, 406 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
407 '%s.apk' % args.apk_under_test) 407 '%s.apk' % args.apk_under_test)
408 408
409 # TODO(jbudorick): Move the realpath up to the argument parser once
410 # APK-by-name is no longer supported.
411 apk_under_test_path = os.path.realpath(apk_under_test_path)
412
409 if not os.path.exists(apk_under_test_path): 413 if not os.path.exists(apk_under_test_path):
410 error_func('Unable to find APK under test: %s' % apk_under_test_path) 414 error_func('Unable to find APK under test: %s' % apk_under_test_path)
411 415
412 self._apk_under_test = apk_helper.ToHelper(apk_under_test_path) 416 self._apk_under_test = apk_helper.ToHelper(apk_under_test_path)
413 417
414 if args.test_apk.endswith('.apk'): 418 if args.test_apk.endswith('.apk'):
415 self._suite = os.path.splitext(os.path.basename(args.test_apk))[0] 419 self._suite = os.path.splitext(os.path.basename(args.test_apk))[0]
420 test_apk_path = args.test_apk
416 self._test_apk = apk_helper.ToHelper(args.test_apk) 421 self._test_apk = apk_helper.ToHelper(args.test_apk)
417 else: 422 else:
418 self._suite = args.test_apk 423 self._suite = args.test_apk
419 self._test_apk = apk_helper.ToHelper(os.path.join( 424 test_apk_path = os.path.join(
420 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR, 425 constants.GetOutDirectory(), constants.SDK_BUILD_APKS_DIR,
421 '%s.apk' % args.test_apk)) 426 '%s.apk' % args.test_apk)
427
428 # TODO(jbudorick): Move the realpath up to the argument parser once
429 # APK-by-name is no longer supported.
430 test_apk_path = os.path.realpath(test_apk_path)
431
432 if not os.path.exists(test_apk_path):
433 error_func('Unable to find test APK: %s' % test_apk_path)
434
435 self._test_apk = apk_helper.ToHelper(test_apk_path)
422 436
423 self._apk_under_test_incremental_install_script = ( 437 self._apk_under_test_incremental_install_script = (
424 args.apk_under_test_incremental_install_script) 438 args.apk_under_test_incremental_install_script)
425 self._test_apk_incremental_install_script = ( 439 self._test_apk_incremental_install_script = (
426 args.test_apk_incremental_install_script) 440 args.test_apk_incremental_install_script)
427 441
428 if self._test_apk_incremental_install_script: 442 if self._test_apk_incremental_install_script:
429 assert self._suite.endswith('_incremental') 443 assert self._suite.endswith('_incremental')
430 self._suite = self._suite[:-len('_incremental')] 444 self._suite = self._suite[:-len('_incremental')]
431 445
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 @staticmethod 706 @staticmethod
693 def GenerateTestResults( 707 def GenerateTestResults(
694 result_code, result_bundle, statuses, start_ms, duration_ms): 708 result_code, result_bundle, statuses, start_ms, duration_ms):
695 return GenerateTestResults(result_code, result_bundle, statuses, 709 return GenerateTestResults(result_code, result_bundle, statuses,
696 start_ms, duration_ms) 710 start_ms, duration_ms)
697 711
698 #override 712 #override
699 def TearDown(self): 713 def TearDown(self):
700 if self._isolate_delegate: 714 if self._isolate_delegate:
701 self._isolate_delegate.Clear() 715 self._isolate_delegate.Clear()
OLDNEW
« no previous file with comments | « build/android/pylib/gtest/gtest_test_instance.py ('k') | build/android/test_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698