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 """Python-driven Java tests which exercise sync functionality.""" |
| 7 |
| 8 from pylib import constants |
| 9 from pylib.host_driven import test_case |
| 10 from pylib.host_driven import test_server |
| 11 from pylib.host_driven import tests_annotations |
| 12 |
| 13 |
| 14 class SyncTest(test_case.HostDrivenTestCase): |
| 15 """Python-driven Java tests which exercise sync functionality.""" |
| 16 |
| 17 def __init__(self, *args, **kwargs): |
| 18 super(SyncTest, self).__init__(*args, **kwargs) |
| 19 self.test_server = None |
| 20 self.additional_flags = [] |
| 21 |
| 22 def SetUp(self, device, shard_index, push_deps, cleanup_test_files): |
| 23 super(SyncTest, self).SetUp(device, shard_index, push_deps, |
| 24 cleanup_test_files) |
| 25 self.test_server = test_server.TestServer( |
| 26 shard_index, |
| 27 constants.TEST_SYNC_SERVER_PORT, |
| 28 constants.TEST_SYNC_SERVER_PATH) |
| 29 # These ought not to change in the middle of a test for obvious reasons. |
| 30 self.additional_flags = [ |
| 31 '--sync-url=http://%s:%d/chromiumsync' % |
| 32 (constants.TEST_SERVER_HOST, self.test_server.port)] |
| 33 self.ports_to_forward = [self.test_server.port] |
| 34 |
| 35 def TearDown(self): |
| 36 self.test_server.TearDown() |
| 37 super(SyncTest, self).TearDown() |
| 38 |
| 39 def _RunSyncTests(self, test_names): |
| 40 full_names = [] |
| 41 for test_name in test_names: |
| 42 full_names.append('SyncTest.' + test_name) |
| 43 return self._RunJavaTestFilters(full_names, self.additional_flags) |
| 44 |
| 45 @tests_annotations.Feature(['Sync']) |
| 46 @tests_annotations.EnormousTest |
| 47 def testGetAboutSyncInfoYieldsValidData(self): |
| 48 java_tests = ['testGetAboutSyncInfoYieldsValidData'] |
| 49 return self._RunSyncTests(java_tests) |
| 50 |
| 51 @tests_annotations.Feature(['Sync']) |
| 52 @tests_annotations.EnormousTest |
| 53 def testAboutSyncPageDisplaysCurrentSyncStatus(self): |
| 54 java_tests = ['testAboutSyncPageDisplaysCurrentSyncStatus'] |
| 55 return self._RunSyncTests(java_tests) |
OLD | NEW |