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

Side by Side Diff: chrome/browser/sync/profile_sync_service_session_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 <map> 5 #include <map>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/files/scoped_temp_dir.h" 12 #include "base/files/scoped_temp_dir.h"
13 #include "base/guid.h" 13 #include "base/guid.h"
14 #include "base/location.h" 14 #include "base/location.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/run_loop.h" 16 #include "base/run_loop.h"
17 #include "base/stl_util.h" 17 #include "base/stl_util.h"
18 #include "base/time/time.h" 18 #include "base/time/time.h"
19 #include "chrome/browser/chrome_notification_types.h" 19 #include "chrome/browser/chrome_notification_types.h"
20 #include "chrome/browser/invalidation/invalidation_service_factory.h" 20 #include "chrome/browser/invalidation/invalidation_service_factory.h"
21 #include "chrome/browser/sessions/session_tab_helper.h" 21 #include "chrome/browser/sessions/session_tab_helper.h"
22 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h" 22 #include "chrome/browser/signin/fake_profile_oauth2_token_service.h"
23 #include "chrome/browser/signin/fake_profile_oauth2_token_service_wrapper.h"
23 #include "chrome/browser/signin/profile_oauth2_token_service.h" 24 #include "chrome/browser/signin/profile_oauth2_token_service.h"
24 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" 25 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
25 #include "chrome/browser/signin/signin_manager.h" 26 #include "chrome/browser/signin/signin_manager.h"
26 #include "chrome/browser/signin/signin_manager_factory.h" 27 #include "chrome/browser/signin/signin_manager_factory.h"
27 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 28 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
28 #include "chrome/browser/sync/glue/device_info.h" 29 #include "chrome/browser/sync/glue/device_info.h"
29 #include "chrome/browser/sync/glue/session_change_processor.h" 30 #include "chrome/browser/sync/glue/session_change_processor.h"
30 #include "chrome/browser/sync/glue/session_data_type_controller.h" 31 #include "chrome/browser/sync/glue/session_data_type_controller.h"
31 #include "chrome/browser/sync/glue/session_model_associator.h" 32 #include "chrome/browser/sync/glue/session_model_associator.h"
32 #include "chrome/browser/sync/glue/session_sync_test_helper.h" 33 #include "chrome/browser/sync/glue/session_sync_test_helper.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 : window_bounds_(0, 1, 2, 3), 131 : window_bounds_(0, 1, 2, 3),
131 notified_of_refresh_(false), 132 notified_of_refresh_(false),
132 notified_of_update_(false) {} 133 notified_of_update_(false) {}
133 ProfileSyncService* sync_service() { return sync_service_.get(); } 134 ProfileSyncService* sync_service() { return sync_service_.get(); }
134 135
135 protected: 136 protected:
136 virtual TestingProfile* CreateProfile() OVERRIDE { 137 virtual TestingProfile* CreateProfile() OVERRIDE {
137 TestingProfile::Builder builder; 138 TestingProfile::Builder builder;
138 builder.AddTestingFactory( 139 builder.AddTestingFactory(
139 ProfileOAuth2TokenServiceFactory::GetInstance(), 140 ProfileOAuth2TokenServiceFactory::GetInstance(),
140 FakeProfileOAuth2TokenService::BuildAutoIssuingTokenService); 141 FakeProfileOAuth2TokenServiceWrapper::BuildAutoIssuingTokenService);
141 // Don't want the profile to create a real ProfileSyncService. 142 // Don't want the profile to create a real ProfileSyncService.
142 builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(), NULL); 143 builder.AddTestingFactory(ProfileSyncServiceFactory::GetInstance(), NULL);
143 scoped_ptr<TestingProfile> profile(builder.Build()); 144 scoped_ptr<TestingProfile> profile(builder.Build());
144 invalidation::InvalidationServiceFactory::GetInstance()-> 145 invalidation::InvalidationServiceFactory::GetInstance()->
145 SetBuildOnlyFakeInvalidatorsForTest(true); 146 SetBuildOnlyFakeInvalidatorsForTest(true);
146 return profile.release(); 147 return profile.release();
147 } 148 }
148 149
149 virtual void SetUp() { 150 virtual void SetUp() {
150 // BrowserWithTestWindowTest implementation. 151 // BrowserWithTestWindowTest implementation.
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 tab_node.SetSessionSpecifics(specifics); 1286 tab_node.SetSessionSpecifics(specifics);
1286 } 1287 }
1287 1288
1288 error = model_associator_->DisassociateModels(); 1289 error = model_associator_->DisassociateModels();
1289 ASSERT_FALSE(error.IsSet()); 1290 ASSERT_FALSE(error.IsSet());
1290 error = model_associator_->AssociateModels(NULL, NULL); 1291 error = model_associator_->AssociateModels(NULL, NULL);
1291 ASSERT_FALSE(error.IsSet()); 1292 ASSERT_FALSE(error.IsSet());
1292 } 1293 }
1293 1294
1294 } // namespace browser_sync 1295 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698