| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 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 """Dispatches content_browsertests.""" | 5 """Dispatches content_browsertests.""" |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 # to dispatch any tests. | 39 # to dispatch any tests. |
| 40 if not ports.ResetTestServerPortAllocation(): | 40 if not ports.ResetTestServerPortAllocation(): |
| 41 raise Exception('Failed to reset test server port.') | 41 raise Exception('Failed to reset test server port.') |
| 42 | 42 |
| 43 test_suite_dir = os.path.join(cmd_helper.OutDirectory.get(), | 43 test_suite_dir = os.path.join(cmd_helper.OutDirectory.get(), |
| 44 options.build_type) | 44 options.build_type) |
| 45 options.test_suite = os.path.join(test_suite_dir, | 45 options.test_suite = os.path.join(test_suite_dir, |
| 46 'apks', | 46 'apks', |
| 47 constants.BROWSERTEST_SUITE_NAME + '.apk') | 47 constants.BROWSERTEST_SUITE_NAME + '.apk') |
| 48 | 48 |
| 49 deps_dir = gtest_dispatch._GenerateDepsDirUsingIsolate( |
| 50 constants.BROWSERTEST_SUITE_NAME, options.build_type) |
| 51 |
| 49 # Constructs a new TestRunner with the current options. | 52 # Constructs a new TestRunner with the current options. |
| 50 def RunnerFactory(device, shard_index): | 53 def RunnerFactory(device, shard_index): |
| 51 return test_runner.TestRunner( | 54 return test_runner.TestRunner( |
| 52 device, | 55 device, |
| 53 options.test_suite, | 56 options.test_suite, |
| 54 options.test_arguments, | 57 options.test_arguments, |
| 55 options.timeout, | 58 options.timeout, |
| 56 options.cleanup_test_files, | 59 options.cleanup_test_files, |
| 57 options.tool, | 60 options.tool, |
| 58 options.build_type, | 61 options.build_type, |
| 59 options.webkit, | 62 options.webkit, |
| 60 options.push_deps, | 63 options.push_deps, |
| 61 constants.BROWSERTEST_TEST_PACKAGE_NAME, | 64 constants.BROWSERTEST_TEST_PACKAGE_NAME, |
| 62 constants.BROWSERTEST_TEST_ACTIVITY_NAME, | 65 constants.BROWSERTEST_TEST_ACTIVITY_NAME, |
| 63 constants.BROWSERTEST_COMMAND_LINE_FILE) | 66 constants.BROWSERTEST_COMMAND_LINE_FILE, |
| 67 deps_dir=deps_dir) |
| 64 | 68 |
| 65 # Get tests and split them up based on the number of devices. | 69 # Get tests and split them up based on the number of devices. |
| 66 all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory, | 70 all_enabled = gtest_dispatch.GetAllEnabledTests(RunnerFactory, |
| 67 attached_devices) | 71 attached_devices) |
| 68 if options.test_filter: | 72 if options.test_filter: |
| 69 all_tests = unittest_util.FilterTestNames(all_enabled, | 73 all_tests = unittest_util.FilterTestNames(all_enabled, |
| 70 options.test_filter) | 74 options.test_filter) |
| 71 else: | 75 else: |
| 72 all_tests = _FilterTests(all_enabled) | 76 all_tests = _FilterTests(all_enabled) |
| 73 | 77 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 100 fixture, case = test.split('.', 1) | 104 fixture, case = test.split('.', 1) |
| 101 if _StartsWith(fixture, case, 'PRE_'): | 105 if _StartsWith(fixture, case, 'PRE_'): |
| 102 return False | 106 return False |
| 103 if _StartsWith(fixture, case, 'MANUAL_'): | 107 if _StartsWith(fixture, case, 'MANUAL_'): |
| 104 return False | 108 return False |
| 105 return True | 109 return True |
| 106 | 110 |
| 107 | 111 |
| 108 def _StartsWith(a, b, prefix): | 112 def _StartsWith(a, b, prefix): |
| 109 return a.startswith(prefix) or b.startswith(prefix) | 113 return a.startswith(prefix) or b.startswith(prefix) |
| OLD | NEW |