| 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 #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/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "chrome/browser/sync/engine/model_safe_worker.h" | 11 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 12 #include "chrome/browser/sync/syncable/model_type.h" | 12 #include "chrome/browser/sync/syncable/model_type.h" |
| 13 #include "chrome/test/base/testing_browser_process_test.h" | |
| 14 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
| 15 #include "chrome/test/base/test_url_request_context_getter.h" | 14 #include "chrome/test/base/test_url_request_context_getter.h" |
| 16 #include "content/browser/browser_thread.h" | 15 #include "content/browser/browser_thread.h" |
| 17 #include "content/common/url_fetcher.h" | 16 #include "content/common/url_fetcher.h" |
| 18 #include "content/test/test_url_fetcher_factory.h" | 17 #include "content/test/test_url_fetcher_factory.h" |
| 19 #include "googleurl/src/gurl.h" | 18 #include "googleurl/src/gurl.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 21 |
| 23 // TODO(akalin): Remove this once we fix the TODO below. | 22 // TODO(akalin): Remove this once we fix the TODO below. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 40 MOCK_METHOD0(OnClearServerDataFailed, void()); | 39 MOCK_METHOD0(OnClearServerDataFailed, void()); |
| 41 MOCK_METHOD1(OnPassphraseRequired, void(sync_api::PassphraseRequiredReason)); | 40 MOCK_METHOD1(OnPassphraseRequired, void(sync_api::PassphraseRequiredReason)); |
| 42 MOCK_METHOD0(OnPassphraseAccepted, void()); | 41 MOCK_METHOD0(OnPassphraseAccepted, void()); |
| 43 MOCK_METHOD1(OnEncryptionComplete, void(const syncable::ModelTypeSet&)); | 42 MOCK_METHOD1(OnEncryptionComplete, void(const syncable::ModelTypeSet&)); |
| 44 MOCK_METHOD1(OnMigrationNeededForTypes, void(const syncable::ModelTypeSet&)); | 43 MOCK_METHOD1(OnMigrationNeededForTypes, void(const syncable::ModelTypeSet&)); |
| 45 MOCK_METHOD1(OnDataTypesChanged, void(const syncable::ModelTypeSet&)); | 44 MOCK_METHOD1(OnDataTypesChanged, void(const syncable::ModelTypeSet&)); |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 } // namespace | 47 } // namespace |
| 49 | 48 |
| 50 class SyncBackendHostTest : public TestingBrowserProcessTest { | 49 class SyncBackendHostTest : public testing::Test { |
| 51 protected: | 50 protected: |
| 52 SyncBackendHostTest() | 51 SyncBackendHostTest() |
| 53 : ui_thread_(BrowserThread::UI, &ui_loop_), | 52 : ui_thread_(BrowserThread::UI, &ui_loop_), |
| 54 io_thread_(BrowserThread::IO) {} | 53 io_thread_(BrowserThread::IO) {} |
| 55 | 54 |
| 56 virtual ~SyncBackendHostTest() {} | 55 virtual ~SyncBackendHostTest() {} |
| 57 | 56 |
| 58 virtual void SetUp() { | 57 virtual void SetUp() { |
| 59 base::Thread::Options options; | 58 base::Thread::Options options; |
| 60 options.message_loop_type = MessageLoop::TYPE_IO; | 59 options.message_loop_type = MessageLoop::TYPE_IO; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 GURL(k_mock_url), | 104 GURL(k_mock_url), |
| 106 syncable::ModelTypeSet(), | 105 syncable::ModelTypeSet(), |
| 107 credentials, | 106 credentials, |
| 108 true); | 107 true); |
| 109 backend.Shutdown(false); | 108 backend.Shutdown(false); |
| 110 } | 109 } |
| 111 | 110 |
| 112 // TODO(akalin): Write more SyncBackendHost unit tests. | 111 // TODO(akalin): Write more SyncBackendHost unit tests. |
| 113 | 112 |
| 114 } // namespace browser_sync | 113 } // namespace browser_sync |
| OLD | NEW |