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