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

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

Issue 1493953002: [Android] Add support for timeouts scaling for OnDevice instrumentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added wrong GN dependency. Created 5 years 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
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 26 matching lines...) Expand all
37 'org.chromium.chrome.test.ChromeInstrumentationTestRunner.' 37 'org.chromium.chrome.test.ChromeInstrumentationTestRunner.'
38 + 'EnableTestHttpServer') 38 + 'EnableTestHttpServer')
39 _EXTRA_DRIVER_TEST_LIST = ( 39 _EXTRA_DRIVER_TEST_LIST = (
40 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList') 40 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList')
41 _EXTRA_DRIVER_TEST_LIST_FILE = ( 41 _EXTRA_DRIVER_TEST_LIST_FILE = (
42 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile') 42 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile')
43 _EXTRA_DRIVER_TARGET_PACKAGE = ( 43 _EXTRA_DRIVER_TARGET_PACKAGE = (
44 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage') 44 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage')
45 _EXTRA_DRIVER_TARGET_CLASS = ( 45 _EXTRA_DRIVER_TARGET_CLASS = (
46 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass') 46 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass')
47 _EXTRA_TIMEOUT_SCALE = (
48 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TimeoutScale')
49
47 _PARAMETERIZED_TEST_ANNOTATION = 'ParameterizedTest' 50 _PARAMETERIZED_TEST_ANNOTATION = 'ParameterizedTest'
48 _PARAMETERIZED_TEST_SET_ANNOTATION = 'ParameterizedTest$Set' 51 _PARAMETERIZED_TEST_SET_ANNOTATION = 'ParameterizedTest$Set'
49 _NATIVE_CRASH_RE = re.compile('native crash', re.IGNORECASE) 52 _NATIVE_CRASH_RE = re.compile('native crash', re.IGNORECASE)
50 _PICKLE_FORMAT_VERSION = 10 53 _PICKLE_FORMAT_VERSION = 10
51 54
52 55
53 # TODO(jbudorick): Make these private class methods of 56 # TODO(jbudorick): Make these private class methods of
54 # InstrumentationTestInstance once the instrumentation test_runner is 57 # InstrumentationTestInstance once the instrumentation test_runner is
55 # deprecated. 58 # deprecated.
56 def ParseAmInstrumentRawOutput(raw_output): 59 def ParseAmInstrumentRawOutput(raw_output):
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 def GetHttpServerEnvironmentVars(): 602 def GetHttpServerEnvironmentVars():
600 return { 603 return {
601 _EXTRA_ENABLE_HTTP_SERVER: None, 604 _EXTRA_ENABLE_HTTP_SERVER: None,
602 } 605 }
603 606
604 def GetDriverEnvironmentVars( 607 def GetDriverEnvironmentVars(
605 self, test_list=None, test_list_file_path=None): 608 self, test_list=None, test_list_file_path=None):
606 env = { 609 env = {
607 _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package, 610 _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package,
608 _EXTRA_DRIVER_TARGET_CLASS: self.test_runner, 611 _EXTRA_DRIVER_TARGET_CLASS: self.test_runner,
612 _EXTRA_TIMEOUT_SCALE: self._timeout_scale,
609 } 613 }
610 614
611 if test_list: 615 if test_list:
612 env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list) 616 env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list)
613 617
614 if test_list_file_path: 618 if test_list_file_path:
615 env[_EXTRA_DRIVER_TEST_LIST_FILE] = ( 619 env[_EXTRA_DRIVER_TEST_LIST_FILE] = (
616 os.path.basename(test_list_file_path)) 620 os.path.basename(test_list_file_path))
617 621
618 return env 622 return env
619 623
620 @staticmethod 624 @staticmethod
621 def ParseAmInstrumentRawOutput(raw_output): 625 def ParseAmInstrumentRawOutput(raw_output):
622 return ParseAmInstrumentRawOutput(raw_output) 626 return ParseAmInstrumentRawOutput(raw_output)
623 627
624 @staticmethod 628 @staticmethod
625 def GenerateTestResults( 629 def GenerateTestResults(
626 result_code, result_bundle, statuses, start_ms, duration_ms): 630 result_code, result_bundle, statuses, start_ms, duration_ms):
627 return GenerateTestResults(result_code, result_bundle, statuses, 631 return GenerateTestResults(result_code, result_bundle, statuses,
628 start_ms, duration_ms) 632 start_ms, duration_ms)
629 633
630 #override 634 #override
631 def TearDown(self): 635 def TearDown(self):
632 if self._isolate_delegate: 636 if self._isolate_delegate:
633 self._isolate_delegate.Clear() 637 self._isolate_delegate.Clear()
634 638
OLDNEW
« no previous file with comments | « base/test/android/javatests/src/org/chromium/base/test/util/ScalableTimeout.java ('k') | testing/android/driver/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698