| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ |
| 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/sync/base/model_type.h" | 13 #include "components/sync/base/model_type.h" |
| 14 #include "components/sync/sessions/sync_session_snapshot.h" | 14 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 class ProfileSyncService; | 17 class ProfileSyncService; |
| 18 | 18 |
| 19 namespace sync_driver { | 19 namespace sync_driver { |
| 20 class SyncSetupInProgressHandle; | 20 class SyncSetupInProgressHandle; |
| 21 } | 21 } |
| 22 | 22 |
| 23 // An instance of this class is basically our notion of a "sync client" for | 23 // An instance of this class is basically our notion of a "sync client" for |
| 24 // automation purposes. It harnesses the ProfileSyncService member of the | 24 // automation purposes. It harnesses the ProfileSyncService member of the |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Disables sync for a particular sync datatype. Returns true on success. | 101 // Disables sync for a particular sync datatype. Returns true on success. |
| 102 bool DisableSyncForDatatype(syncer::ModelType datatype); | 102 bool DisableSyncForDatatype(syncer::ModelType datatype); |
| 103 | 103 |
| 104 // Enables sync for all sync datatypes. Returns true on success. | 104 // Enables sync for all sync datatypes. Returns true on success. |
| 105 bool EnableSyncForAllDatatypes(); | 105 bool EnableSyncForAllDatatypes(); |
| 106 | 106 |
| 107 // Disables sync for all sync datatypes. Returns true on success. | 107 // Disables sync for all sync datatypes. Returns true on success. |
| 108 bool DisableSyncForAllDatatypes(); | 108 bool DisableSyncForAllDatatypes(); |
| 109 | 109 |
| 110 // Returns a snapshot of the current sync session. | 110 // Returns a snapshot of the current sync session. |
| 111 syncer::sessions::SyncSessionSnapshot GetLastSessionSnapshot() const; | 111 syncer::SyncCycleSnapshot GetLastCycleSnapshot() const; |
| 112 | 112 |
| 113 // Check if |type| is being synced. | 113 // Check if |type| is being synced. |
| 114 bool IsTypePreferred(syncer::ModelType type); | 114 bool IsTypePreferred(syncer::ModelType type); |
| 115 | 115 |
| 116 // Returns a string that can be used as the value of an oauth2 refresh token. | 116 // Returns a string that can be used as the value of an oauth2 refresh token. |
| 117 // This function guarantees that a different string is returned each time | 117 // This function guarantees that a different string is returned each time |
| 118 // it is called. | 118 // it is called. |
| 119 std::string GenerateFakeOAuth2RefreshTokenString(); | 119 std::string GenerateFakeOAuth2RefreshTokenString(); |
| 120 | 120 |
| 121 // Returns a string with relevant info about client's sync state (if | 121 // Returns a string with relevant info about client's sync state (if |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // all refresh tokens used in the tests are different. | 158 // all refresh tokens used in the tests are different. |
| 159 int oauth2_refesh_token_number_; | 159 int oauth2_refesh_token_number_; |
| 160 | 160 |
| 161 // Used for logging. | 161 // Used for logging. |
| 162 const std::string profile_debug_name_; | 162 const std::string profile_debug_name_; |
| 163 | 163 |
| 164 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); | 164 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceHarness); |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ | 167 #endif // CHROME_BROWSER_SYNC_TEST_INTEGRATION_PROFILE_SYNC_SERVICE_HARNESS_H_ |
| OLD | NEW |