| 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 <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 "base/utf_string_conversions.h" |
| 20 #include "chrome/browser/invalidation/invalidation_service_factory.h" |
| 19 #include "chrome/browser/signin/signin_manager.h" | 21 #include "chrome/browser/signin/signin_manager.h" |
| 20 #include "chrome/browser/signin/signin_manager_factory.h" | 22 #include "chrome/browser/signin/signin_manager_factory.h" |
| 21 #include "chrome/browser/signin/token_service_factory.h" | 23 #include "chrome/browser/signin/token_service_factory.h" |
| 22 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 24 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 23 #include "chrome/browser/sync/glue/device_info.h" | 25 #include "chrome/browser/sync/glue/device_info.h" |
| 24 #include "chrome/browser/sync/glue/session_change_processor.h" | 26 #include "chrome/browser/sync/glue/session_change_processor.h" |
| 25 #include "chrome/browser/sync/glue/session_data_type_controller.h" | 27 #include "chrome/browser/sync/glue/session_data_type_controller.h" |
| 26 #include "chrome/browser/sync/glue/session_model_associator.h" | 28 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 27 #include "chrome/browser/sync/glue/sync_backend_host.h" | 29 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 28 #include "chrome/browser/sync/glue/synced_device_tracker.h" | 30 #include "chrome/browser/sync/glue/synced_device_tracker.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 notified_of_update_(false), | 200 notified_of_update_(false), |
| 199 notified_of_refresh_(false) {} | 201 notified_of_refresh_(false) {} |
| 200 ProfileSyncService* sync_service() { return sync_service_.get(); } | 202 ProfileSyncService* sync_service() { return sync_service_.get(); } |
| 201 | 203 |
| 202 protected: | 204 protected: |
| 203 virtual TestingProfile* CreateProfile() OVERRIDE { | 205 virtual TestingProfile* CreateProfile() OVERRIDE { |
| 204 TestingProfile* profile = new TestingProfile(); | 206 TestingProfile* profile = new TestingProfile(); |
| 205 // Don't want the profile to create a real ProfileSyncService. | 207 // Don't want the profile to create a real ProfileSyncService. |
| 206 ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(profile, | 208 ProfileSyncServiceFactory::GetInstance()->SetTestingFactory(profile, |
| 207 NULL); | 209 NULL); |
| 210 invalidation::InvalidationServiceFactory::GetInstance()-> |
| 211 SetBuildOnlyFakeInvalidatorsForTest(profile); |
| 208 return profile; | 212 return profile; |
| 209 } | 213 } |
| 210 | 214 |
| 211 virtual void SetUp() { | 215 virtual void SetUp() { |
| 212 // BrowserWithTestWindowTest implementation. | 216 // BrowserWithTestWindowTest implementation. |
| 213 BrowserWithTestWindowTest::SetUp(); | 217 BrowserWithTestWindowTest::SetUp(); |
| 214 io_thread_.StartIOThread(); | 218 io_thread_.StartIOThread(); |
| 215 profile()->CreateRequestContext(); | 219 profile()->CreateRequestContext(); |
| 216 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 220 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 217 registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, | 221 registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, |
| (...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1248 sync_pb::SessionSpecifics specifics; | 1252 sync_pb::SessionSpecifics specifics; |
| 1249 header.SetSessionSpecifics(specifics); | 1253 header.SetSessionSpecifics(specifics); |
| 1250 } | 1254 } |
| 1251 // Ensure we associate properly despite the pre-existing node with our local | 1255 // Ensure we associate properly despite the pre-existing node with our local |
| 1252 // tag. | 1256 // tag. |
| 1253 error = model_associator_->AssociateModels(NULL, NULL); | 1257 error = model_associator_->AssociateModels(NULL, NULL); |
| 1254 ASSERT_FALSE(error.IsSet()); | 1258 ASSERT_FALSE(error.IsSet()); |
| 1255 } | 1259 } |
| 1256 | 1260 |
| 1257 } // namespace browser_sync | 1261 } // namespace browser_sync |
| OLD | NEW |