| 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "base/file_util.h" |
| 6 | |
| 7 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/signin/fake_signin_manager.h" | 9 #include "chrome/browser/signin/fake_signin_manager.h" |
| 11 #include "chrome/browser/signin/profile_oauth2_token_service.h" | 10 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
| 12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 11 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 13 #include "chrome/browser/signin/signin_manager.h" | 12 #include "chrome/browser/signin/signin_manager.h" |
| 14 #include "chrome/browser/signin/signin_manager_factory.h" | 13 #include "chrome/browser/signin/signin_manager_factory.h" |
| 15 #include "chrome/browser/signin/token_service.h" | 14 #include "chrome/browser/signin/token_service.h" |
| 16 #include "chrome/browser/signin/token_service_factory.h" | 15 #include "chrome/browser/signin/token_service_factory.h" |
| 17 #include "chrome/browser/sync/fake_oauth2_token_service.h" | 16 #include "chrome/browser/sync/fake_oauth2_token_service.h" |
| 18 #include "chrome/browser/sync/glue/data_type_manager.h" | 17 #include "chrome/browser/sync/glue/data_type_manager.h" |
| 19 #include "chrome/browser/sync/glue/data_type_manager_mock.h" | 18 #include "chrome/browser/sync/glue/data_type_manager_mock.h" |
| 20 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" | 19 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" |
| 21 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" | 20 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" |
| 22 #include "chrome/browser/sync/profile_sync_service_factory.h" | 21 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 23 #include "chrome/browser/sync/profile_sync_test_util.h" | 22 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 24 #include "chrome/browser/sync/sync_prefs.h" | 23 #include "chrome/browser/sync/sync_prefs.h" |
| 25 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
| 26 #include "chrome/test/base/testing_profile.h" | 25 #include "chrome/test/base/testing_profile.h" |
| 27 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 28 #include "content/public/browser/notification_source.h" | 27 #include "content/public/browser/notification_source.h" |
| 29 #include "content/public/test/test_browser_thread_bundle.h" | 28 #include "content/public/test/test_browser_thread_bundle.h" |
| 30 #include "content/public/test/test_utils.h" | 29 #include "content/public/test/test_utils.h" |
| 31 #include "google_apis/gaia/gaia_auth_consumer.h" | 30 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 32 #include "google_apis/gaia/gaia_constants.h" | 31 #include "google_apis/gaia/gaia_constants.h" |
| 33 #include "google_apis/gaia/oauth2_token_service.h" | 32 #include "google_apis/gaia/oauth2_token_service.h" |
| 34 #include "testing/gmock/include/gmock/gmock.h" | 33 #include "testing/gmock/include/gmock/gmock.h" |
| 34 #include "testing/gtest/include/gtest/gtest.h" |
| 35 | 35 |
| 36 using browser_sync::DataTypeManager; | 36 using browser_sync::DataTypeManager; |
| 37 using browser_sync::DataTypeManagerMock; | 37 using browser_sync::DataTypeManagerMock; |
| 38 using browser_sync::SyncBackendHostMock; | 38 using browser_sync::SyncBackendHostMock; |
| 39 using content::BrowserThread; | 39 using content::BrowserThread; |
| 40 using testing::_; | 40 using testing::_; |
| 41 using testing::AnyNumber; | 41 using testing::AnyNumber; |
| 42 using testing::DoAll; | 42 using testing::DoAll; |
| 43 using testing::InvokeArgument; | 43 using testing::InvokeArgument; |
| 44 using testing::Mock; | 44 using testing::Mock; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 profile_->GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted); | 553 profile_->GetPrefs()->ClearPref(prefs::kSyncHasSetupCompleted); |
| 554 | 554 |
| 555 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); | 555 EXPECT_CALL(observer_, OnStateChanged()).Times(AnyNumber()); |
| 556 IssueTestTokens(); | 556 IssueTestTokens(); |
| 557 | 557 |
| 558 sync_->SetSetupInProgress(true); | 558 sync_->SetSetupInProgress(true); |
| 559 sync_->Initialize(); | 559 sync_->Initialize(); |
| 560 sync_->SetSetupInProgress(false); | 560 sync_->SetSetupInProgress(false); |
| 561 EXPECT_FALSE(sync_->sync_initialized()); | 561 EXPECT_FALSE(sync_->sync_initialized()); |
| 562 } | 562 } |
| OLD | NEW |