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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual ~FakeDataTypeManager() {}; | 51 virtual ~FakeDataTypeManager() {}; |
52 | 52 |
53 virtual void Configure(syncer::ModelTypeSet desired_types, | 53 virtual void Configure(syncer::ModelTypeSet desired_types, |
54 syncer::ConfigureReason reason) OVERRIDE { | 54 syncer::ConfigureReason reason) OVERRIDE { |
55 sync_driver::DataTypeManager::ConfigureResult result; | 55 sync_driver::DataTypeManager::ConfigureResult result; |
56 result.status = sync_driver::DataTypeManager::OK; | 56 result.status = sync_driver::DataTypeManager::OK; |
57 observer_->OnConfigureDone(result); | 57 observer_->OnConfigureDone(result); |
58 } | 58 } |
59 | 59 |
60 virtual void ReenableType(syncer::ModelType type) OVERRIDE {} | 60 virtual void ReenableType(syncer::ModelType type) OVERRIDE {} |
61 virtual void ResetDataTypeErrors() OVERRIDE {} | |
62 virtual void PurgeForMigration(syncer::ModelTypeSet undesired_types, | 61 virtual void PurgeForMigration(syncer::ModelTypeSet undesired_types, |
63 syncer::ConfigureReason reason) OVERRIDE {} | 62 syncer::ConfigureReason reason) OVERRIDE {} |
64 virtual void Stop() OVERRIDE {}; | 63 virtual void Stop() OVERRIDE {}; |
65 virtual State state() const OVERRIDE { | 64 virtual State state() const OVERRIDE { |
66 return sync_driver::DataTypeManager::CONFIGURED; | 65 return sync_driver::DataTypeManager::CONFIGURED; |
67 }; | 66 }; |
68 | 67 |
69 private: | 68 private: |
70 sync_driver::DataTypeManagerObserver* observer_; | 69 sync_driver::DataTypeManagerObserver* observer_; |
71 }; | 70 }; |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 sync_driver::SyncPrefs sync_prefs(service()->profile()->GetPrefs()); | 244 sync_driver::SyncPrefs sync_prefs(service()->profile()->GetPrefs()); |
246 sync_prefs.SetFirstSyncTime(base::Time::Now()); | 245 sync_prefs.SetFirstSyncTime(base::Time::Now()); |
247 service_->Initialize(); | 246 service_->Initialize(); |
248 } | 247 } |
249 | 248 |
250 void InitializeForFirstSync() { | 249 void InitializeForFirstSync() { |
251 service_->Initialize(); | 250 service_->Initialize(); |
252 } | 251 } |
253 | 252 |
254 void ExpectDataTypeManagerCreation(int times) { | 253 void ExpectDataTypeManagerCreation(int times) { |
255 EXPECT_CALL(*components_factory_, CreateDataTypeManager(_, _, _, _, _)) | 254 EXPECT_CALL(*components_factory_, CreateDataTypeManager(_, _, _, _, _, _)) |
256 .Times(times) | 255 .Times(times) |
257 .WillRepeatedly(ReturnNewDataTypeManager()); | 256 .WillRepeatedly(ReturnNewDataTypeManager()); |
258 } | 257 } |
259 | 258 |
260 void ExpectSyncBackendHostCreation(int times) { | 259 void ExpectSyncBackendHostCreation(int times) { |
261 EXPECT_CALL(*components_factory_, CreateSyncBackendHost(_, _, _, _, _)) | 260 EXPECT_CALL(*components_factory_, CreateSyncBackendHost(_, _, _, _, _)) |
262 .Times(times) | 261 .Times(times) |
263 .WillRepeatedly(ReturnNewSyncBackendHostMock()); | 262 .WillRepeatedly(ReturnNewSyncBackendHostMock()); |
264 } | 263 } |
265 | 264 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 // See that we can override the URL with a flag. | 610 // See that we can override the URL with a flag. |
612 CommandLine command_line( | 611 CommandLine command_line( |
613 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); | 612 base::FilePath(base::FilePath(FILE_PATH_LITERAL("chrome.exe")))); |
614 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); | 613 command_line.AppendSwitchASCII(switches::kSyncServiceURL, "https://foo/bar"); |
615 EXPECT_EQ("https://foo/bar", | 614 EXPECT_EQ("https://foo/bar", |
616 ProfileSyncService::GetSyncServiceURL(command_line).spec()); | 615 ProfileSyncService::GetSyncServiceURL(command_line).spec()); |
617 } | 616 } |
618 | 617 |
619 } // namespace | 618 } // namespace |
620 } // namespace browser_sync | 619 } // namespace browser_sync |
OLD | NEW |