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

Unified Diff: chrome/browser/sync/js/js_sync_manager_observer_unittest.cc

Issue 7918001: [Sync] Move ChangeRecord into its own file (change_record.{h,cc}) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/js/js_sync_manager_observer_unittest.cc
diff --git a/chrome/browser/sync/js/js_sync_manager_observer_unittest.cc b/chrome/browser/sync/js/js_sync_manager_observer_unittest.cc
index 0ded637d6b8120a2e96ceaf15f444b2b0cbd3dfb..4073a28b9cb64434ad4f2a96739dcb1f10f7076a 100644
--- a/chrome/browser/sync/js/js_sync_manager_observer_unittest.cc
+++ b/chrome/browser/sync/js/js_sync_manager_observer_unittest.cc
@@ -241,28 +241,6 @@ TEST_F(JsSyncManagerObserverTest, OnEncryptionComplete) {
PumpLoop();
}
-TEST_F(JsSyncManagerObserverTest, OnMigrationNeededForTypes) {
- DictionaryValue expected_details;
- ListValue* type_values = new ListValue();
- expected_details.Set("types", type_values);
- syncable::ModelTypeSet types;
-
- for (int i = syncable::FIRST_REAL_MODEL_TYPE;
- i < syncable::MODEL_TYPE_COUNT; ++i) {
- syncable::ModelType type = syncable::ModelTypeFromInt(i);
- types.insert(type);
- type_values->Append(Value::CreateStringValue(
- syncable::ModelTypeToString(type)));
- }
-
- EXPECT_CALL(mock_js_event_handler_,
- HandleJsEvent("onMigrationNeededForTypes",
- HasDetailsAsDictionary(expected_details)));
-
- js_sync_manager_observer_.OnMigrationNeededForTypes(types);
- PumpLoop();
-}
-
namespace {
// Makes a node of the given model type. Returns the id of the
@@ -290,7 +268,7 @@ TEST_F(JsSyncManagerObserverTest, OnChangesApplied) {
// We don't test with passwords as that requires additional setup.
// Build a list of example ChangeRecords.
- sync_api::SyncManager::ChangeRecord changes[syncable::MODEL_TYPE_COUNT];
+ sync_api::ChangeRecord changes[syncable::MODEL_TYPE_COUNT];
for (int i = syncable::AUTOFILL_PROFILE;
i < syncable::MODEL_TYPE_COUNT; ++i) {
changes[i].id =
@@ -298,15 +276,15 @@ TEST_F(JsSyncManagerObserverTest, OnChangesApplied) {
switch (i % 3) {
case 0:
changes[i].action =
- sync_api::SyncManager::ChangeRecord::ACTION_ADD;
+ sync_api::ChangeRecord::ACTION_ADD;
break;
case 1:
changes[i].action =
- sync_api::SyncManager::ChangeRecord::ACTION_UPDATE;
+ sync_api::ChangeRecord::ACTION_UPDATE;
break;
default:
changes[i].action =
- sync_api::SyncManager::ChangeRecord::ACTION_DELETE;
+ sync_api::ChangeRecord::ACTION_DELETE;
break;
}
{
@@ -343,9 +321,12 @@ TEST_F(JsSyncManagerObserverTest, OnChangesApplied) {
for (int i = syncable::AUTOFILL_PROFILE;
i < syncable::MODEL_TYPE_COUNT; ++i) {
sync_api::ReadTransaction trans(FROM_HERE, test_user_share.user_share());
- js_sync_manager_observer_.OnChangesApplied(syncable::ModelTypeFromInt(i),
- &trans, &changes[i],
- syncable::MODEL_TYPE_COUNT - i);
+ sync_api::ChangeRecordList
+ local_changes(changes + i, changes + arraysize(changes));
+ js_sync_manager_observer_.OnChangesApplied(
+ syncable::ModelTypeFromInt(i),
+ &trans,
+ sync_api::ImmutableChangeRecordList(&local_changes));
}
test_user_share.TearDown();
« no previous file with comments | « chrome/browser/sync/js/js_sync_manager_observer.cc ('k') | chrome/browser/sync/profile_sync_service_bookmark_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698