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

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

Issue 1465383003: [Android] Add ChromiumNetTestSupport.apk for the java EmbeddedTestServer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +landmine for GN 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 15 matching lines...) Expand all
26 # Ref: http://developer.android.com/reference/android/app/Activity.html 26 # Ref: http://developer.android.com/reference/android/app/Activity.html
27 _ACTIVITY_RESULT_CANCELED = 0 27 _ACTIVITY_RESULT_CANCELED = 0
28 _ACTIVITY_RESULT_OK = -1 28 _ACTIVITY_RESULT_OK = -1
29 29
30 _COMMAND_LINE_PARAMETER = 'cmdlinearg-parameter' 30 _COMMAND_LINE_PARAMETER = 'cmdlinearg-parameter'
31 _DEFAULT_ANNOTATIONS = [ 31 _DEFAULT_ANNOTATIONS = [
32 'Smoke', 'SmallTest', 'MediumTest', 'LargeTest', 32 'Smoke', 'SmallTest', 'MediumTest', 'LargeTest',
33 'EnormousTest', 'IntegrationTest'] 33 'EnormousTest', 'IntegrationTest']
34 _EXCLUDE_UNLESS_REQUESTED_ANNOTATIONS = [ 34 _EXCLUDE_UNLESS_REQUESTED_ANNOTATIONS = [
35 'DisabledTest', 'FlakyTest'] 35 'DisabledTest', 'FlakyTest']
36 _EXTRA_ENABLE_HTTP_SERVER = (
37 'org.chromium.chrome.test.ChromeInstrumentationTestRunner.'
38 + 'EnableTestHttpServer')
39 _EXTRA_DRIVER_TEST_LIST = ( 36 _EXTRA_DRIVER_TEST_LIST = (
40 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList') 37 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestList')
41 _EXTRA_DRIVER_TEST_LIST_FILE = ( 38 _EXTRA_DRIVER_TEST_LIST_FILE = (
42 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile') 39 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TestListFile')
43 _EXTRA_DRIVER_TARGET_PACKAGE = ( 40 _EXTRA_DRIVER_TARGET_PACKAGE = (
44 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage') 41 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage')
45 _EXTRA_DRIVER_TARGET_CLASS = ( 42 _EXTRA_DRIVER_TARGET_CLASS = (
46 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass') 43 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass')
47 _EXTRA_TIMEOUT_SCALE = ( 44 _EXTRA_TIMEOUT_SCALE = (
48 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TimeoutScale') 45 'org.chromium.test.driver.OnDeviceInstrumentationDriver.TimeoutScale')
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 for t in tests: 588 for t in tests:
592 parameters = ParseCommandLineFlagParameters(t['annotations']) 589 parameters = ParseCommandLineFlagParameters(t['annotations'])
593 if parameters: 590 if parameters:
594 t['flags'] = parameters[0] 591 t['flags'] = parameters[0]
595 for p in parameters[1:]: 592 for p in parameters[1:]:
596 parameterized_t = copy.copy(t) 593 parameterized_t = copy.copy(t)
597 parameterized_t['flags'] = p 594 parameterized_t['flags'] = p
598 new_tests.append(parameterized_t) 595 new_tests.append(parameterized_t)
599 return tests + new_tests 596 return tests + new_tests
600 597
601 @staticmethod
602 def GetHttpServerEnvironmentVars():
603 return {
604 _EXTRA_ENABLE_HTTP_SERVER: None,
605 }
606
607 def GetDriverEnvironmentVars( 598 def GetDriverEnvironmentVars(
608 self, test_list=None, test_list_file_path=None): 599 self, test_list=None, test_list_file_path=None):
609 env = { 600 env = {
610 _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package, 601 _EXTRA_DRIVER_TARGET_PACKAGE: self.test_package,
611 _EXTRA_DRIVER_TARGET_CLASS: self.test_runner, 602 _EXTRA_DRIVER_TARGET_CLASS: self.test_runner,
612 _EXTRA_TIMEOUT_SCALE: self._timeout_scale, 603 _EXTRA_TIMEOUT_SCALE: self._timeout_scale,
613 } 604 }
614 605
615 if test_list: 606 if test_list:
616 env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list) 607 env[_EXTRA_DRIVER_TEST_LIST] = ','.join(test_list)
(...skipping 12 matching lines...) Expand all
629 def GenerateTestResults( 620 def GenerateTestResults(
630 result_code, result_bundle, statuses, start_ms, duration_ms): 621 result_code, result_bundle, statuses, start_ms, duration_ms):
631 return GenerateTestResults(result_code, result_bundle, statuses, 622 return GenerateTestResults(result_code, result_bundle, statuses,
632 start_ms, duration_ms) 623 start_ms, duration_ms)
633 624
634 #override 625 #override
635 def TearDown(self): 626 def TearDown(self):
636 if self._isolate_delegate: 627 if self._isolate_delegate:
637 self._isolate_delegate.Clear() 628 self._isolate_delegate.Clear()
638 629
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698