OLD | NEW |
(Empty) | |
| 1 #!/usr/bin/python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. |
| 5 |
| 6 from pylib import constants |
| 7 from pylib.host_driven import test_case |
| 8 from pylib.host_driven import tests_annotations |
| 9 from pylib.host_driven import TestServer |
| 10 |
| 11 class SyncTest(test_case.HostDrivenTestCase): |
| 12 """Python-driven java_tests which exercise sync functionality.""" |
| 13 |
| 14 def __init__(self, *args, **kwargs): |
| 15 super(SyncTest, self).__init__(*args, **kwargs) |
| 16 self.test_server_params = None |
| 17 |
| 18 def SetUp(self, device, shard_index, push_deps, cleanup_test_files): |
| 19 super(SyncTest, self).SetUp(device, shard_index, push_deps, |
| 20 cleanup_test_files) |
| 21 server_port, flags, test_server = \ |
| 22 TestServer.setUpTestSyncServer( |
| 23 self.adb, shard_index, |
| 24 constants.CHROME_TEST_SHELL_COMMAND_LINE_FILE) |
| 25 # These ought not to change in the middle of a test for obvious reasons. |
| 26 self.test_server_params = (flags, test_server) |
| 27 self.ports_to_forward = [server_port] |
| 28 |
| 29 def TearDown(self): |
| 30 TestServer.tearDown(self.test_server_params) |
| 31 super(SyncTest, self).TearDown() |
| 32 |
| 33 def _RunSyncTests(self, test_names): |
| 34 full_names = [] |
| 35 for test_name in test_names: |
| 36 full_names.append('SyncTest.' + test_name) |
| 37 return self._RunJavaTestFilters(full_names) |
| 38 |
| 39 @tests_annotations.Feature(['Sync']) |
| 40 @tests_annotations.EnormousTest |
| 41 def testGetAboutSyncInfoYieldsValidData(self): |
| 42 java_tests = ['testGetAboutSyncInfoYieldsValidData'] |
| 43 return self._RunSyncTests(java_tests) |
| 44 |
| 45 @tests_annotations.Feature(['Sync']) |
| 46 @tests_annotations.EnormousTest |
| 47 def testAboutSyncPageDisplaysCurrentSyncStatus(self): |
| 48 java_tests = ['testAboutSyncPageDisplaysCurrentSyncStatus'] |
| 49 return self._RunSyncTests(java_tests) |
OLD | NEW |