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

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

Issue 15580002: Make use of InvalidationService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 6 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
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/location.h" 13 #include "base/location.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "base/time.h" 18 #include "base/time.h"
19 #include "chrome/browser/invalidation/invalidation_service_factory.h"
19 #include "chrome/browser/signin/signin_manager.h" 20 #include "chrome/browser/signin/signin_manager.h"
20 #include "chrome/browser/signin/signin_manager_factory.h" 21 #include "chrome/browser/signin/signin_manager_factory.h"
21 #include "chrome/browser/signin/token_service_factory.h" 22 #include "chrome/browser/signin/token_service_factory.h"
22 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" 23 #include "chrome/browser/sync/abstract_profile_sync_service_test.h"
23 #include "chrome/browser/sync/glue/device_info.h" 24 #include "chrome/browser/sync/glue/device_info.h"
24 #include "chrome/browser/sync/glue/session_change_processor.h" 25 #include "chrome/browser/sync/glue/session_change_processor.h"
25 #include "chrome/browser/sync/glue/session_data_type_controller.h" 26 #include "chrome/browser/sync/glue/session_data_type_controller.h"
26 #include "chrome/browser/sync/glue/session_model_associator.h" 27 #include "chrome/browser/sync/glue/session_model_associator.h"
27 #include "chrome/browser/sync/glue/sync_backend_host.h" 28 #include "chrome/browser/sync/glue/sync_backend_host.h"
28 #include "chrome/browser/sync/glue/synced_device_tracker.h" 29 #include "chrome/browser/sync/glue/synced_device_tracker.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 notified_of_update_(false), 199 notified_of_update_(false),
199 notified_of_refresh_(false) {} 200 notified_of_refresh_(false) {}
200 ProfileSyncService* sync_service() { return sync_service_.get(); } 201 ProfileSyncService* sync_service() { return sync_service_.get(); }
201 202
202 protected: 203 protected:
203 virtual TestingProfile* CreateProfile() OVERRIDE { 204 virtual TestingProfile* CreateProfile() OVERRIDE {
204 TestingProfile* profile = new TestingProfile(); 205 TestingProfile* profile = new TestingProfile();
205 // Don't want the profile to create a real ProfileSyncService. 206 // Don't want the profile to create a real ProfileSyncService.
206 ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(profile, 207 ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(profile,
207 NULL); 208 NULL);
209 invalidation::InvalidationServiceFactory::GetInstance()->
210 SetBuildOnlyFakeInvalidatorsForTest(profile);
208 return profile; 211 return profile;
209 } 212 }
210 213
211 virtual void SetUp() { 214 virtual void SetUp() {
212 // BrowserWithTestWindowTest implementation. 215 // BrowserWithTestWindowTest implementation.
213 BrowserWithTestWindowTest::SetUp(); 216 BrowserWithTestWindowTest::SetUp();
214 io_thread_.StartIOThread(); 217 io_thread_.StartIOThread();
215 profile()->CreateRequestContext(); 218 profile()->CreateRequestContext();
216 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 219 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
217 registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, 220 registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED,
(...skipping 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 sync_pb::SessionSpecifics specifics; 1258 sync_pb::SessionSpecifics specifics;
1256 header.SetSessionSpecifics(specifics); 1259 header.SetSessionSpecifics(specifics);
1257 } 1260 }
1258 // Ensure we associate properly despite the pre-existing node with our local 1261 // Ensure we associate properly despite the pre-existing node with our local
1259 // tag. 1262 // tag.
1260 error = model_associator_->AssociateModels(NULL, NULL); 1263 error = model_associator_->AssociateModels(NULL, NULL);
1261 ASSERT_FALSE(error.IsSet()); 1264 ASSERT_FALSE(error.IsSet());
1262 } 1265 }
1263 1266
1264 } // namespace browser_sync 1267 } // namespace browser_sync
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698