OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 logging | 5 import logging |
6 import os | 6 import os |
7 import re | 7 import re |
8 | 8 |
9 from pylib import pexpect | 9 from pylib import pexpect |
10 from pylib import ports | 10 from pylib import ports |
(...skipping 16 matching lines...) Expand all Loading... |
27 RE_CRASH = re.compile('\\[ CRASHED \\](.*)\r\n') | 27 RE_CRASH = re.compile('\\[ CRASHED \\](.*)\r\n') |
28 | 28 |
29 # Bots that don't output anything for 20 minutes get timed out, so that's our | 29 # Bots that don't output anything for 20 minutes get timed out, so that's our |
30 # hard cap. | 30 # hard cap. |
31 _INFRA_STDOUT_TIMEOUT = 20 * 60 | 31 _INFRA_STDOUT_TIMEOUT = 20 * 60 |
32 | 32 |
33 | 33 |
34 def _TestSuiteRequiresMockTestServer(suite_name): | 34 def _TestSuiteRequiresMockTestServer(suite_name): |
35 """Returns True if the test suite requires mock test server.""" | 35 """Returns True if the test suite requires mock test server.""" |
36 tests_require_net_test_server = ['unit_tests', 'net_unittests', | 36 tests_require_net_test_server = ['unit_tests', 'net_unittests', |
| 37 'components_browsertests', |
37 'content_unittests', | 38 'content_unittests', |
38 'content_browsertests'] | 39 'content_browsertests'] |
39 return (suite_name in | 40 return (suite_name in |
40 tests_require_net_test_server) | 41 tests_require_net_test_server) |
41 | 42 |
42 def _TestSuiteRequiresHighPerfMode(suite_name): | 43 def _TestSuiteRequiresHighPerfMode(suite_name): |
43 """Returns True if the test suite requires high performance mode.""" | 44 """Returns True if the test suite requires high performance mode.""" |
44 return 'perftests' in suite_name | 45 return 'perftests' in suite_name |
45 | 46 |
46 class TestRunner(base_test_runner.BaseTestRunner): | 47 class TestRunner(base_test_runner.BaseTestRunner): |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 #override | 192 #override |
192 def TearDown(self): | 193 def TearDown(self): |
193 """Cleans up the test enviroment for the test suite.""" | 194 """Cleans up the test enviroment for the test suite.""" |
194 for s in self._servers: | 195 for s in self._servers: |
195 s.TearDown() | 196 s.TearDown() |
196 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): | 197 if _TestSuiteRequiresHighPerfMode(self.test_package.suite_name): |
197 self._perf_controller.SetDefaultPerfMode() | 198 self._perf_controller.SetDefaultPerfMode() |
198 self.test_package.ClearApplicationState(self.device) | 199 self.test_package.ClearApplicationState(self.device) |
199 self.tool.CleanUpEnvironment() | 200 self.tool.CleanUpEnvironment() |
200 super(TestRunner, self).TearDown() | 201 super(TestRunner, self).TearDown() |
OLD | NEW |