| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/sync/glue/sync_backend_host.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "content/public/test/test_browser_thread_bundle.h" | 23 #include "content/public/test/test_browser_thread_bundle.h" |
| 24 #include "content/public/test/test_utils.h" | 24 #include "content/public/test/test_utils.h" |
| 25 #include "google/cacheinvalidation/include/types.h" | 25 #include "google/cacheinvalidation/include/types.h" |
| 26 #include "net/url_request/test_url_fetcher_factory.h" | 26 #include "net/url_request/test_url_fetcher_factory.h" |
| 27 #include "sync/internal_api/public/base/model_type.h" | 27 #include "sync/internal_api/public/base/model_type.h" |
| 28 #include "sync/internal_api/public/engine/model_safe_worker.h" | 28 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 29 #include "sync/internal_api/public/sync_manager_factory.h" | 29 #include "sync/internal_api/public/sync_manager_factory.h" |
| 30 #include "sync/internal_api/public/test/fake_sync_manager.h" | 30 #include "sync/internal_api/public/test/fake_sync_manager.h" |
| 31 #include "sync/internal_api/public/util/experiments.h" | 31 #include "sync/internal_api/public/util/experiments.h" |
| 32 #include "sync/notifier/invalidator_state.h" | 32 #include "sync/notifier/invalidator_state.h" |
| 33 #include "sync/notifier/object_id_invalidation_map_test_util.h" | |
| 34 #include "sync/protocol/encryption.pb.h" | 33 #include "sync/protocol/encryption.pb.h" |
| 35 #include "sync/protocol/sync_protocol_error.h" | 34 #include "sync/protocol/sync_protocol_error.h" |
| 36 #include "sync/util/test_unrecoverable_error_handler.h" | 35 #include "sync/util/test_unrecoverable_error_handler.h" |
| 37 #include "testing/gmock/include/gmock/gmock.h" | 36 #include "testing/gmock/include/gmock/gmock.h" |
| 38 #include "testing/gtest/include/gtest/gtest.h" | 37 #include "testing/gtest/include/gtest/gtest.h" |
| 39 #include "url/gurl.h" | 38 #include "url/gurl.h" |
| 40 | 39 |
| 41 using content::BrowserThread; | 40 using content::BrowserThread; |
| 42 using syncer::FakeSyncManager; | 41 using syncer::FakeSyncManager; |
| 43 using syncer::SyncManager; | 42 using syncer::SyncManager; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 } | 53 } |
| 55 | 54 |
| 56 void QuitMessageLoop() { | 55 void QuitMessageLoop() { |
| 57 base::MessageLoop::current()->Quit(); | 56 base::MessageLoop::current()->Quit(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 class MockSyncFrontend : public SyncFrontend { | 59 class MockSyncFrontend : public SyncFrontend { |
| 61 public: | 60 public: |
| 62 virtual ~MockSyncFrontend() {} | 61 virtual ~MockSyncFrontend() {} |
| 63 | 62 |
| 64 MOCK_METHOD1(OnInvalidatorStateChange, | |
| 65 void(syncer::InvalidatorState)); | |
| 66 MOCK_METHOD1(OnIncomingInvalidation, | |
| 67 void(const syncer::ObjectIdInvalidationMap&)); | |
| 68 MOCK_METHOD3( | 63 MOCK_METHOD3( |
| 69 OnBackendInitialized, | 64 OnBackendInitialized, |
| 70 void(const syncer::WeakHandle<syncer::JsBackend>&, | 65 void(const syncer::WeakHandle<syncer::JsBackend>&, |
| 71 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, | 66 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>&, |
| 72 bool)); | 67 bool)); |
| 73 MOCK_METHOD0(OnSyncCycleCompleted, void()); | 68 MOCK_METHOD0(OnSyncCycleCompleted, void()); |
| 74 MOCK_METHOD1(OnConnectionStatusChange, | 69 MOCK_METHOD1(OnConnectionStatusChange, |
| 75 void(syncer::ConnectionStatus status)); | 70 void(syncer::ConnectionStatus status)); |
| 76 MOCK_METHOD0(OnStopSyncingPermanently, void()); | 71 MOCK_METHOD0(OnStopSyncingPermanently, void()); |
| 77 MOCK_METHOD0(OnClearServerDataSucceeded, void()); | 72 MOCK_METHOD0(OnClearServerDataSucceeded, void()); |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) { | 676 TEST_F(SyncBackendHostTest, DownloadControlTypesRestart) { |
| 682 sync_prefs_->SetSyncSetupCompleted(); | 677 sync_prefs_->SetSyncSetupCompleted(); |
| 683 InitializeBackend(true); | 678 InitializeBackend(true); |
| 684 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, | 679 EXPECT_EQ(syncer::CONFIGURE_REASON_NEWLY_ENABLED_DATA_TYPE, |
| 685 fake_manager_->GetAndResetConfigureReason()); | 680 fake_manager_->GetAndResetConfigureReason()); |
| 686 } | 681 } |
| 687 | 682 |
| 688 } // namespace | 683 } // namespace |
| 689 | 684 |
| 690 } // namespace browser_sync | 685 } // namespace browser_sync |
| OLD | NEW |