Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(183)

Side by Side Diff: chrome/browser/sync/profile_sync_service_unittest.cc

Issue 148513010: Eliminate ProfileOAuth2TokenService being a BCKS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/compiler_specific.h" 6 #include "base/compiler_specific.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/invalidation/invalidation_service_factory.h" 10 #include "chrome/browser/invalidation/invalidation_service_factory.h"
11 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 11 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
12 #include "chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h"
12 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 13 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
13 #include "chrome/browser/signin/signin_manager.h" 14 #include "chrome/browser/signin/signin_manager.h"
14 #include "chrome/browser/signin/signin_manager_factory.h" 15 #include "chrome/browser/signin/signin_manager_factory.h"
15 #include "chrome/browser/sync/glue/data_type_manager_impl.h" 16 #include "chrome/browser/sync/glue/data_type_manager_impl.h"
16 #include "chrome/browser/sync/glue/sync_backend_host_mock.h" 17 #include "chrome/browser/sync/glue/sync_backend_host_mock.h"
17 #include "chrome/browser/sync/profile_sync_components_factory_mock.h" 18 #include "chrome/browser/sync/profile_sync_components_factory_mock.h"
18 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
19 #include "chrome/test/base/testing_pref_service_syncable.h" 20 #include "chrome/test/base/testing_pref_service_syncable.h"
20 #include "chrome/test/base/testing_profile.h" 21 #include "chrome/test/base/testing_profile.h"
21 #include "content/public/test/test_browser_thread_bundle.h" 22 #include "content/public/test/test_browser_thread_bundle.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 protected: 88 protected:
88 ProfileSyncServiceTest() 89 ProfileSyncServiceTest()
89 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {} 90 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP) {}
90 virtual ~ProfileSyncServiceTest() {} 91 virtual ~ProfileSyncServiceTest() {}
91 92
92 virtual void SetUp() OVERRIDE { 93 virtual void SetUp() OVERRIDE {
93 TestingProfile::Builder builder; 94 TestingProfile::Builder builder;
94 95
95 builder.AddTestingFactory( 96 builder.AddTestingFactory(
96 ProfileOAuth2TokenServiceFactory::GetInstance(), 97 ProfileOAuth2TokenServiceFactory::GetInstance(),
97 FakeProfileOAuth2TokenService::BuildAutoIssuingTokenService); 98 FakeProfileOAuth2TokenServiceWrapper::BuildAutoIssuingTokenService);
98 invalidation::InvalidationServiceFactory::GetInstance()-> 99 invalidation::InvalidationServiceFactory::GetInstance()->
99 SetBuildOnlyFakeInvalidatorsForTest(true); 100 SetBuildOnlyFakeInvalidatorsForTest(true);
100 101
101 profile_ = builder.Build().Pass(); 102 profile_ = builder.Build().Pass();
102 } 103 }
103 104
104 virtual void TearDown() OVERRIDE { 105 virtual void TearDown() OVERRIDE {
105 // Kill the service before the profile. 106 // Kill the service before the profile.
106 if (service_) 107 if (service_)
107 service_->Shutdown(); 108 service_->Shutdown();
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 EXPECT_TRUE(token_status.next_token_request_time.is_null()); 363 EXPECT_TRUE(token_status.next_token_request_time.is_null());
363 364
364 // Simulate successful connection. 365 // Simulate successful connection.
365 service()->OnConnectionStatusChange(syncer::CONNECTION_OK); 366 service()->OnConnectionStatusChange(syncer::CONNECTION_OK);
366 token_status = service()->GetSyncTokenStatus(); 367 token_status = service()->GetSyncTokenStatus();
367 EXPECT_EQ(syncer::CONNECTION_OK, token_status.connection_status); 368 EXPECT_EQ(syncer::CONNECTION_OK, token_status.connection_status);
368 } 369 }
369 370
370 } // namespace 371 } // namespace
371 } // namespace browser_sync 372 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698