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