| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 5 #ifndef CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| 6 #define CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 6 #define CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "chrome/test/base/in_process_browser_test.h" | 9 #include "chrome/test/base/in_process_browser_test.h" |
| 10 | 10 |
| 11 #include <string> |
| 12 #include <vector> |
| 13 |
| 11 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 12 #include "base/file_util.h" | 15 #include "base/file_util.h" |
| 13 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 15 #include "base/process_util.h" | 18 #include "base/process_util.h" |
| 16 #include "chrome/browser/sync/syncable/model_type.h" | 19 #include "chrome/browser/sync/syncable/model_type.h" |
| 17 #include "net/base/mock_host_resolver.h" | 20 #include "net/base/mock_host_resolver.h" |
| 18 #include "net/test/test_server.h" | 21 #include "net/test/test_server.h" |
| 19 | 22 |
| 20 #include <string> | |
| 21 #include <vector> | |
| 22 | |
| 23 class CommandLine; | 23 class CommandLine; |
| 24 class Profile; | 24 class Profile; |
| 25 class ProfileSyncServiceHarness; | 25 class ProfileSyncServiceHarness; |
| 26 class FakeURLFetcherFactory; | 26 class FakeURLFetcherFactory; |
| 27 class URLFetcherFactory; | 27 class URLFetcherFactory; |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 class ProxyConfig; | 30 class ProxyConfig; |
| 31 class ScopedDefaultHostResolverProc; | 31 class ScopedDefaultHostResolverProc; |
| 32 class URLRequestContextGetter; | 32 class URLRequestContextGetter; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // account state is initially clean. | 70 // account state is initially clean. |
| 71 }; | 71 }; |
| 72 | 72 |
| 73 // A LiveSyncTest must be associated with a particular test type. | 73 // A LiveSyncTest must be associated with a particular test type. |
| 74 explicit LiveSyncTest(TestType test_type); | 74 explicit LiveSyncTest(TestType test_type); |
| 75 | 75 |
| 76 virtual ~LiveSyncTest(); | 76 virtual ~LiveSyncTest(); |
| 77 | 77 |
| 78 // Validates command line parameters and creates a local python test server if | 78 // Validates command line parameters and creates a local python test server if |
| 79 // specified. | 79 // specified. |
| 80 virtual void SetUp(); | 80 virtual void SetUp() OVERRIDE; |
| 81 | 81 |
| 82 // Brings down local python test server if one was created. | 82 // Brings down local python test server if one was created. |
| 83 virtual void TearDown(); | 83 virtual void TearDown() OVERRIDE; |
| 84 | 84 |
| 85 // Sets up command line flags required for sync tests. | 85 // Sets up command line flags required for sync tests. |
| 86 virtual void SetUpCommandLine(CommandLine* cl); | 86 virtual void SetUpCommandLine(CommandLine* cl) OVERRIDE; |
| 87 | 87 |
| 88 // Used to get the number of sync clients used by a test. | 88 // Used to get the number of sync clients used by a test. |
| 89 int num_clients() WARN_UNUSED_RESULT { return num_clients_; } | 89 int num_clients() WARN_UNUSED_RESULT { return num_clients_; } |
| 90 | 90 |
| 91 // Returns a pointer to a particular sync profile. Callee owns the object | 91 // Returns a pointer to a particular sync profile. Callee owns the object |
| 92 // and manages its lifetime. | 92 // and manages its lifetime. |
| 93 Profile* GetProfile(int index) WARN_UNUSED_RESULT; | 93 Profile* GetProfile(int index) WARN_UNUSED_RESULT; |
| 94 | 94 |
| 95 // Returns a pointer to a particular browser. Callee owns the object | 95 // Returns a pointer to a particular browser. Callee owns the object |
| 96 // and manages its lifetime. | 96 // and manages its lifetime. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 void TriggerMigrationDoneError(const syncable::ModelTypeSet& model_types); | 154 void TriggerMigrationDoneError(const syncable::ModelTypeSet& model_types); |
| 155 | 155 |
| 156 // Triggers the server to set its birthday to a random value thereby | 156 // Triggers the server to set its birthday to a random value thereby |
| 157 // the server would return a birthday error on next sync. | 157 // the server would return a birthday error on next sync. |
| 158 void TriggerBirthdayError(); | 158 void TriggerBirthdayError(); |
| 159 | 159 |
| 160 // Triggers a transient error on the server. Note the server will stay in | 160 // Triggers a transient error on the server. Note the server will stay in |
| 161 // this state until shut down. | 161 // this state until shut down. |
| 162 void TriggerTransientError(); | 162 void TriggerTransientError(); |
| 163 | 163 |
| 164 // Triggers setting the sync_tabs field of the nigori node. |
| 165 void TriggerSetSyncTabs(); |
| 166 |
| 164 protected: | 167 protected: |
| 168 // Add custom switches needed for running the test. |
| 169 virtual void AddTestSwitches(CommandLine* cl); |
| 170 |
| 171 // Append the command line switches to enable experimental types that aren't |
| 172 // on by default yet. |
| 173 virtual void AddOptionalTypesToCommandLine(CommandLine* cl); |
| 174 |
| 165 // InProcessBrowserTest override. Destroys all the sync clients and sync | 175 // InProcessBrowserTest override. Destroys all the sync clients and sync |
| 166 // profiles created by a test. | 176 // profiles created by a test. |
| 167 virtual void CleanUpOnMainThread(); | 177 virtual void CleanUpOnMainThread() OVERRIDE; |
| 168 | 178 |
| 169 // InProcessBrowserTest override. Changes behavior of the default host | 179 // InProcessBrowserTest override. Changes behavior of the default host |
| 170 // resolver to avoid DNS lookup errors. | 180 // resolver to avoid DNS lookup errors. |
| 171 virtual void SetUpInProcessBrowserTestFixture(); | 181 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
| 172 | 182 |
| 173 // InProcessBrowserTest override. Resets the host resolver its default | 183 // InProcessBrowserTest override. Resets the host resolver its default |
| 174 // behavior. | 184 // behavior. |
| 175 virtual void TearDownInProcessBrowserTestFixture(); | 185 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE; |
| 176 | 186 |
| 177 // GAIA account used by the test case. | 187 // GAIA account used by the test case. |
| 178 std::string username_; | 188 std::string username_; |
| 179 | 189 |
| 180 // GAIA password used by the test case. | 190 // GAIA password used by the test case. |
| 181 std::string password_; | 191 std::string password_; |
| 182 | 192 |
| 183 // Locally available plain text file in which GAIA credentials are stored. | 193 // Locally available plain text file in which GAIA credentials are stored. |
| 184 FilePath password_file_; | 194 FilePath password_file_; |
| 185 | 195 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 | 298 |
| 289 // Whether or not to use notifications for the current test. | 299 // Whether or not to use notifications for the current test. |
| 290 bool enable_notifications_; | 300 bool enable_notifications_; |
| 291 | 301 |
| 292 DISALLOW_COPY_AND_ASSIGN(LiveSyncTest); | 302 DISALLOW_COPY_AND_ASSIGN(LiveSyncTest); |
| 293 }; | 303 }; |
| 294 | 304 |
| 295 DISABLE_RUNNABLE_METHOD_REFCOUNT(LiveSyncTest); | 305 DISABLE_RUNNABLE_METHOD_REFCOUNT(LiveSyncTest); |
| 296 | 306 |
| 297 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ | 307 #endif // CHROME_TEST_LIVE_SYNC_LIVE_SYNC_TEST_H_ |
| OLD | NEW |