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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
11 #include "chrome/browser/sync/glue/data_type_manager.h" | 11 #include "chrome/browser/sync/glue/data_type_manager.h" |
12 #include "chrome/browser/sync/glue/data_type_manager_mock.h" | 12 #include "chrome/browser/sync/glue/data_type_manager_mock.h" |
13 #include "chrome/browser/sync/profile_sync_factory_mock.h" | 13 #include "chrome/browser/sync/profile_sync_factory_mock.h" |
14 #include "chrome/browser/sync/profile_sync_test_util.h" | 14 #include "chrome/browser/sync/profile_sync_test_util.h" |
15 #include "chrome/browser/sync/signin_manager.h" | 15 #include "chrome/browser/sync/signin_manager.h" |
16 #include "chrome/browser/sync/test_profile_sync_service.h" | 16 #include "chrome/browser/sync/test_profile_sync_service.h" |
17 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
18 #include "chrome/common/net/gaia/gaia_auth_consumer.h" | 18 #include "chrome/common/net/gaia/gaia_auth_consumer.h" |
19 #include "chrome/common/net/gaia/gaia_constants.h" | 19 #include "chrome/common/net/gaia/gaia_constants.h" |
20 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
21 #include "chrome/test/base/testing_profile.h" | 21 #include "chrome/test/base/testing_profile.h" |
22 #include "content/test/test_browser_thread.h" | 22 #include "content/test/test_browser_thread.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 | 24 |
25 using browser_sync::DataTypeManager; | 25 using browser_sync::DataTypeManager; |
26 using browser_sync::DataTypeManagerMock; | 26 using browser_sync::DataTypeManagerMock; |
| 27 using content::BrowserThread; |
27 using testing::_; | 28 using testing::_; |
28 using testing::AnyNumber; | 29 using testing::AnyNumber; |
29 using testing::DoAll; | 30 using testing::DoAll; |
30 using testing::InvokeArgument; | 31 using testing::InvokeArgument; |
31 using testing::Mock; | 32 using testing::Mock; |
32 using testing::Return; | 33 using testing::Return; |
33 | 34 |
34 // TODO(chron): Test not using cros_user flag and use signin_ | 35 // TODO(chron): Test not using cros_user flag and use signin_ |
35 class ProfileSyncServiceStartupTest : public testing::Test { | 36 class ProfileSyncServiceStartupTest : public testing::Test { |
36 public: | 37 public: |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 308 |
308 // Preload the tokens. | 309 // Preload the tokens. |
309 profile_->GetTokenService()->IssueAuthTokenForTest( | 310 profile_->GetTokenService()->IssueAuthTokenForTest( |
310 GaiaConstants::kSyncService, "sync_token"); | 311 GaiaConstants::kSyncService, "sync_token"); |
311 service_->fail_initial_download(); | 312 service_->fail_initial_download(); |
312 | 313 |
313 service_->Initialize(); | 314 service_->Initialize(); |
314 EXPECT_FALSE(service_->sync_initialized()); | 315 EXPECT_FALSE(service_->sync_initialized()); |
315 EXPECT_FALSE(service_->GetBackendForTest()); | 316 EXPECT_FALSE(service_->GetBackendForTest()); |
316 } | 317 } |
OLD | NEW |