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 glob | 5 import glob |
6 import logging | 6 import logging |
7 import os | 7 import os |
8 import sys | 8 import sys |
9 | 9 |
10 from base_test_runner import BaseTestRunner | 10 from base_test_runner import BaseTestRunner |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 self._gtest_filter = ('-' + ':'.join(self.GetDisabledTests()) + ':' + | 309 self._gtest_filter = ('-' + ':'.join(self.GetDisabledTests()) + ':' + |
310 ':'.join(['*.' + x + '*' for x in | 310 ':'.join(['*.' + x + '*' for x in |
311 self.test_package.GetDisabledPrefixes()])) | 311 self.test_package.GetDisabledPrefixes()])) |
312 self.RunTestsWithFilter() | 312 self.RunTestsWithFilter() |
313 return self.test_results | 313 return self.test_results |
314 | 314 |
315 def SetUp(self): | 315 def SetUp(self): |
316 """Sets up necessary test enviroment for the test suite.""" | 316 """Sets up necessary test enviroment for the test suite.""" |
317 super(SingleTestRunner, self).SetUp() | 317 super(SingleTestRunner, self).SetUp() |
318 self.adb.ClearApplicationState(constants.CHROME_PACKAGE) | 318 self.adb.ClearApplicationState(constants.CHROME_PACKAGE) |
319 if self._running_on_emulator: | |
320 # Sometimes adb server lost connection to the emulator, which will break | |
321 # the test, so restart the adb server before the test. | |
322 self.adb.RestartAdbServer() | |
323 if self.test_package.performance_test: | 319 if self.test_package.performance_test: |
324 self.adb.SetupPerformanceTest() | 320 self.adb.SetupPerformanceTest() |
325 if self.dump_debug_info: | 321 if self.dump_debug_info: |
326 self.dump_debug_info.StartRecordingLog(True) | 322 self.dump_debug_info.StartRecordingLog(True) |
327 self.StripAndCopyFiles() | 323 self.StripAndCopyFiles() |
328 self.LaunchHelperToolsForTestSuite() | 324 self.LaunchHelperToolsForTestSuite() |
329 self.tool.SetupEnvironment() | 325 self.tool.SetupEnvironment() |
330 | 326 |
331 def TearDown(self): | 327 def TearDown(self): |
332 """Cleans up the test enviroment for the test suite.""" | 328 """Cleans up the test enviroment for the test suite.""" |
333 self.tool.CleanUpEnvironment() | 329 self.tool.CleanUpEnvironment() |
334 if self.test_package.cleanup_test_files: | 330 if self.test_package.cleanup_test_files: |
335 self.adb.RemovePushedFiles() | 331 self.adb.RemovePushedFiles() |
336 if self.dump_debug_info: | 332 if self.dump_debug_info: |
337 self.dump_debug_info.StopRecordingLog() | 333 self.dump_debug_info.StopRecordingLog() |
338 if self.test_package.performance_test: | 334 if self.test_package.performance_test: |
339 self.adb.TearDownPerformanceTest() | 335 self.adb.TearDownPerformanceTest() |
340 super(SingleTestRunner, self).TearDown() | 336 super(SingleTestRunner, self).TearDown() |
OLD | NEW |