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

Side by Side Diff: chrome/browser/sync/engine/process_commit_response_command_unittest.cc

Issue 9460047: sync: remove use of protobuf extensions in protocol to reduce static init overhead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fred's review Created 8 years, 9 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 <vector> 5 #include <vector>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/stringprintf.h" 8 #include "base/stringprintf.h"
9 #include "chrome/browser/sync/engine/process_commit_response_command.h" 9 #include "chrome/browser/sync/engine/process_commit_response_command.h"
10 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h" 10 #include "chrome/browser/sync/protocol/bookmark_specifics.pb.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 ASSERT_TRUE(entry.good()); 90 ASSERT_TRUE(entry.good());
91 entry.Put(syncable::ID, item_id); 91 entry.Put(syncable::ID, item_id);
92 entry.Put(syncable::BASE_VERSION, 92 entry.Put(syncable::BASE_VERSION,
93 item_id.ServerKnows() ? next_old_revision_++ : 0); 93 item_id.ServerKnows() ? next_old_revision_++ : 0);
94 entry.Put(syncable::IS_UNSYNCED, true); 94 entry.Put(syncable::IS_UNSYNCED, true);
95 entry.Put(syncable::IS_DIR, is_folder); 95 entry.Put(syncable::IS_DIR, is_folder);
96 entry.Put(syncable::IS_DEL, false); 96 entry.Put(syncable::IS_DEL, false);
97 entry.Put(syncable::PARENT_ID, parent_id); 97 entry.Put(syncable::PARENT_ID, parent_id);
98 entry.PutPredecessor(predecessor_id); 98 entry.PutPredecessor(predecessor_id);
99 sync_pb::EntitySpecifics default_specifics; 99 sync_pb::EntitySpecifics default_specifics;
100 syncable::AddDefaultExtensionValue(model_type, &default_specifics); 100 syncable::AddDefaultFieldValue(model_type, &default_specifics);
101 entry.Put(syncable::SPECIFICS, default_specifics); 101 entry.Put(syncable::SPECIFICS, default_specifics);
102 if (item_id.ServerKnows()) { 102 if (item_id.ServerKnows()) {
103 entry.Put(syncable::SERVER_SPECIFICS, default_specifics); 103 entry.Put(syncable::SERVER_SPECIFICS, default_specifics);
104 entry.Put(syncable::SERVER_IS_DIR, is_folder); 104 entry.Put(syncable::SERVER_IS_DIR, is_folder);
105 entry.Put(syncable::SERVER_PARENT_ID, parent_id); 105 entry.Put(syncable::SERVER_PARENT_ID, parent_id);
106 entry.Put(syncable::SERVER_IS_DEL, false); 106 entry.Put(syncable::SERVER_IS_DEL, false);
107 } 107 }
108 if (metahandle_out) 108 if (metahandle_out)
109 *metahandle_out = entry.Get(syncable::META_HANDLE); 109 *metahandle_out = entry.Get(syncable::META_HANDLE);
110 } 110 }
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id); 428 EXPECT_EQ("xyz", final_monitor_records["xyz"].extension_id);
429 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count); 429 EXPECT_EQ(2049U, final_monitor_records["ABC"].bookmark_write_count);
430 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count); 430 EXPECT_EQ(4U, final_monitor_records["xyz"].bookmark_write_count);
431 } else { 431 } else {
432 EXPECT_TRUE(final_monitor_records.empty()) 432 EXPECT_TRUE(final_monitor_records.empty())
433 << "Should not restore records after successful bookmark commit."; 433 << "Should not restore records after successful bookmark commit.";
434 } 434 }
435 } 435 }
436 436
437 } // namespace browser_sync 437 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/engine/nigori_util_unittest.cc ('k') | chrome/browser/sync/engine/store_timestamps_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698