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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/sync/backend_migrator.h" 5 #include "chrome/browser/sync/backend_migrator.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/tracked_objects.h" 8 #include "base/tracked_objects.h"
9 #include "chrome/browser/sync/glue/data_type_manager_mock.h" 9 #include "chrome/browser/sync/glue/data_type_manager_mock.h"
10 #include "chrome/browser/sync/internal_api/write_transaction.h" 10 #include "chrome/browser/sync/internal_api/write_transaction.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 progress_marker.set_token("dummy"); 70 progress_marker.set_token("dummy");
71 } 71 }
72 trans.GetLookup()->SetDownloadProgress(type, progress_marker); 72 trans.GetLookup()->SetDownloadProgress(type, progress_marker);
73 } 73 }
74 } 74 }
75 75
76 void SendConfigureDone(DataTypeManager::ConfigureStatus status, 76 void SendConfigureDone(DataTypeManager::ConfigureStatus status,
77 const syncable::ModelTypeSet& requested_types) { 77 const syncable::ModelTypeSet& requested_types) {
78 if (status == DataTypeManager::OK) { 78 if (status == DataTypeManager::OK) {
79 DataTypeManager::ConfigureResult result(status, requested_types); 79 DataTypeManager::ConfigureResult result(status, requested_types);
80 NotificationService::current()->Notify( 80 content::NotificationService::current()->Notify(
81 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, 81 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
82 content::Source<DataTypeManager>(&manager_), 82 content::Source<DataTypeManager>(&manager_),
83 content::Details<const DataTypeManager::ConfigureResult>(&result)); 83 content::Details<const DataTypeManager::ConfigureResult>(&result));
84 } else { 84 } else {
85 std::list<SyncError> errors; 85 std::list<SyncError> errors;
86 DataTypeManager::ConfigureResult result( 86 DataTypeManager::ConfigureResult result(
87 status, 87 status,
88 requested_types, 88 requested_types,
89 errors); 89 errors);
90 NotificationService::current()->Notify( 90 content::NotificationService::current()->Notify(
91 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE, 91 chrome::NOTIFICATION_SYNC_CONFIGURE_DONE,
92 content::Source<DataTypeManager>(&manager_), 92 content::Source<DataTypeManager>(&manager_),
93 content::Details<const DataTypeManager::ConfigureResult>(&result)); 93 content::Details<const DataTypeManager::ConfigureResult>(&result));
94 } 94 }
95 message_loop_.RunAllPending(); 95 message_loop_.RunAllPending();
96 } 96 }
97 97
98 ProfileSyncService* service() { return &service_; } 98 ProfileSyncService* service() { return &service_; }
99 DataTypeManagerMock* manager() { return &manager_; } 99 DataTypeManagerMock* manager() { return &manager_; }
100 const syncable::ModelTypeSet& preferred_types() { return preferred_types_; } 100 const syncable::ModelTypeSet& preferred_types() { return preferred_types_; }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 .WillOnce(Return(DataTypeManager::CONFIGURED)); 322 .WillOnce(Return(DataTypeManager::CONFIGURED));
323 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION)) 323 EXPECT_CALL(*manager(), Configure(_, sync_api::CONFIGURE_REASON_MIGRATION))
324 .Times(1); 324 .Times(1);
325 migrator()->MigrateTypes(to_migrate); 325 migrator()->MigrateTypes(to_migrate);
326 SetUnsyncedTypes(syncable::ModelTypeSet()); 326 SetUnsyncedTypes(syncable::ModelTypeSet());
327 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet()); 327 SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet());
328 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); 328 EXPECT_EQ(BackendMigrator::IDLE, migrator()->state());
329 } 329 }
330 330
331 }; // namespace browser_sync 331 }; // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_browser_tests.cc ('k') | chrome/browser/sync/glue/autofill_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698