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

Side by Side Diff: chrome/browser/extensions/app_notification_manager_sync_unittest.cc

Issue 10698141: Revert 145993 - [Sync] Add location parameter to SyncChange in Sync API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "chrome/browser/extensions/app_notification.h" 9 #include "chrome/browser/extensions/app_notification.h"
10 #include "chrome/browser/extensions/app_notification_manager.h" 10 #include "chrome/browser/extensions/app_notification_manager.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return AppNotificationManager::CreateSyncDataFromNotification(*notif); 199 return AppNotificationManager::CreateSyncDataFromNotification(*notif);
200 } 200 }
201 201
202 // Helper to create syncer::SyncChange. Takes ownership of |notif|. 202 // Helper to create syncer::SyncChange. Takes ownership of |notif|.
203 static syncer::SyncChange CreateSyncChange( 203 static syncer::SyncChange CreateSyncChange(
204 syncer::SyncChange::SyncChangeType type, 204 syncer::SyncChange::SyncChangeType type,
205 AppNotification* notif) { 205 AppNotification* notif) {
206 // Take control of notif to clean it up after we create data out of it. 206 // Take control of notif to clean it up after we create data out of it.
207 scoped_ptr<AppNotification> scoped_notif(notif); 207 scoped_ptr<AppNotification> scoped_notif(notif);
208 return syncer::SyncChange( 208 return syncer::SyncChange(
209 FROM_HERE, 209 type, AppNotificationManager::CreateSyncDataFromNotification(*notif));
210 type,
211 AppNotificationManager::CreateSyncDataFromNotification(*notif));
212 } 210 }
213 211
214 void AssertSyncChange(const syncer::SyncChange& change, 212 void AssertSyncChange(const syncer::SyncChange& change,
215 syncer::SyncChange::SyncChangeType type, 213 syncer::SyncChange::SyncChangeType type,
216 const AppNotification& notif) { 214 const AppNotification& notif) {
217 ASSERT_EQ(type, change.change_type()); 215 ASSERT_EQ(type, change.change_type());
218 scoped_ptr<AppNotification> notif2( 216 scoped_ptr<AppNotification> notif2(
219 AppNotificationManager::CreateNotificationFromSyncData( 217 AppNotificationManager::CreateNotificationFromSyncData(
220 change.sync_data())); 218 change.sync_data()));
221 ASSERT_TRUE(notif.Equals(*notif2)); 219 ASSERT_TRUE(notif.Equals(*notif2));
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 740
743 EXPECT_EQ(3U, processor()->change_list_size()); 741 EXPECT_EQ(3U, processor()->change_list_size());
744 EXPECT_TRUE(processor()->ContainsGuid(n1->guid())); 742 EXPECT_TRUE(processor()->ContainsGuid(n1->guid()));
745 syncer::SyncChange c1 = processor()->GetChangeByGuid(n1->guid()); 743 syncer::SyncChange c1 = processor()->GetChangeByGuid(n1->guid());
746 AssertSyncChange(c1, syncer::SyncChange::ACTION_DELETE, *n1); 744 AssertSyncChange(c1, syncer::SyncChange::ACTION_DELETE, *n1);
747 syncer::SyncChange c2 = processor()->GetChangeByGuid(n2->guid()); 745 syncer::SyncChange c2 = processor()->GetChangeByGuid(n2->guid());
748 AssertSyncChange(c2, syncer::SyncChange::ACTION_DELETE, *n2); 746 AssertSyncChange(c2, syncer::SyncChange::ACTION_DELETE, *n2);
749 syncer::SyncChange c3 = processor()->GetChangeByGuid(n3->guid()); 747 syncer::SyncChange c3 = processor()->GetChangeByGuid(n3->guid());
750 AssertSyncChange(c3, syncer::SyncChange::ACTION_DELETE, *n3); 748 AssertSyncChange(c3, syncer::SyncChange::ACTION_DELETE, *n3);
751 } 749 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notification_manager.cc ('k') | chrome/browser/extensions/app_sync_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698