Home | History | Annotate | Download | only in sync
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_
      6 #define CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_
      7 #pragma once
      8 
      9 #include <string>
     10 
     11 #include "base/string16.h"
     12 #include "chrome/browser/sync/glue/change_processor.h"
     13 #include "chrome/browser/sync/glue/data_type_controller.h"
     14 #include "chrome/browser/sync/profile_sync_service.h"
     15 #include "chrome/browser/sync/syncable/model_type.h"
     16 #include "testing/gmock/include/gmock/gmock.h"
     17 
     18 class ProfileSyncServiceMock : public ProfileSyncService {
     19  public:
     20   ProfileSyncServiceMock();
     21   virtual ~ProfileSyncServiceMock();
     22 
     23   MOCK_METHOD0(DisableForUser, void());
     24   MOCK_METHOD0(OnBackendInitialized, void());
     25   MOCK_METHOD0(OnSyncCycleCompleted, void());
     26   MOCK_METHOD0(OnAuthError, void());
     27   MOCK_METHOD4(OnUserSubmittedAuth,
     28                void(const std::string& username,
     29                     const std::string& password,
     30                     const std::string& captcha,
     31                     const std::string& access_code));
     32   MOCK_METHOD0(OnUserCancelledDialog, void());
     33   MOCK_CONST_METHOD0(GetAuthenticatedUsername, string16());
     34   MOCK_METHOD2(OnUnrecoverableError,
     35                void(const tracked_objects::Location& location,
     36                const std::string& message));
     37   MOCK_METHOD2(ActivateDataType,
     38                void(browser_sync::DataTypeController* data_type_controller,
     39                     browser_sync::ChangeProcessor* change_processor));
     40   MOCK_METHOD2(DeactivateDataType,
     41                void(browser_sync::DataTypeController* data_type_controller,
     42                     browser_sync::ChangeProcessor* change_processor));
     43 
     44   MOCK_METHOD0(InitializeBackend, void());
     45   MOCK_METHOD1(AddObserver, void(Observer*));
     46   MOCK_METHOD1(RemoveObserver, void(Observer*));
     47   MOCK_METHOD0(GetJsFrontend, browser_sync::JsFrontend*());
     48   MOCK_CONST_METHOD0(HasSyncSetupCompleted, bool());
     49 
     50   MOCK_METHOD1(ChangePreferredDataTypes,
     51                void(const syncable::ModelTypeSet& preferred_types));
     52   MOCK_CONST_METHOD1(GetPreferredDataTypes,
     53                      void(syncable::ModelTypeSet* preferred_types));
     54   MOCK_CONST_METHOD1(GetRegisteredDataTypes,
     55                      void(syncable::ModelTypeSet* registered_types));
     56   MOCK_CONST_METHOD0(GetLastSessionSnapshot,
     57                      const browser_sync::sessions::SyncSessionSnapshot*());
     58 
     59   MOCK_METHOD0(QueryDetailedSyncStatus,
     60                browser_sync::SyncBackendHost::Status());
     61   MOCK_CONST_METHOD0(GetLastSyncedTimeString, string16());
     62   MOCK_CONST_METHOD0(unrecoverable_error_detected, bool());
     63 };
     64 
     65 #endif  // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_MOCK_H_
     66