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

Unified Diff: chrome/browser/sync/syncable/syncable_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: fix nigori access in testserver Created 8 years, 10 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/syncable/syncable_unittest.cc
diff --git a/chrome/browser/sync/syncable/syncable_unittest.cc b/chrome/browser/sync/syncable/syncable_unittest.cc
index c2d9bd55d9ee542049510837e2b86c191ceb5e39..bf9ec3b26016e77e77a907cf99de26763d0cace5 100644
--- a/chrome/browser/sync/syncable/syncable_unittest.cc
+++ b/chrome/browser/sync/syncable/syncable_unittest.cc
@@ -62,9 +62,8 @@ void PutDataAsBookmarkFavicon(WriteTransaction* wtrans,
const char* bytes,
size_t bytes_length) {
sync_pb::EntitySpecifics specifics;
- specifics.MutableExtension(sync_pb::bookmark)->set_url("http://demo/");
- specifics.MutableExtension(sync_pb::bookmark)->set_favicon(bytes,
- bytes_length);
+ specifics.mutable_bookmark()->set_url("http://demo/");
+ specifics.mutable_bookmark()->set_favicon(bytes, bytes_length);
e->Put(SPECIFICS, specifics);
}
@@ -73,11 +72,10 @@ void ExpectDataFromBookmarkFaviconEquals(BaseTransaction* trans,
const char* bytes,
size_t bytes_length) {
ASSERT_TRUE(e->good());
- ASSERT_TRUE(e->Get(SPECIFICS).HasExtension(sync_pb::bookmark));
- ASSERT_EQ("http://demo/",
- e->Get(SPECIFICS).GetExtension(sync_pb::bookmark).url());
+ ASSERT_TRUE(e->Get(SPECIFICS).has_bookmark());
+ ASSERT_EQ("http://demo/", e->Get(SPECIFICS).bookmark().url());
ASSERT_EQ(std::string(bytes, bytes_length),
- e->Get(SPECIFICS).GetExtension(sync_pb::bookmark).favicon());
+ e->Get(SPECIFICS).bookmark().favicon());
}
} // namespace
@@ -1201,8 +1199,8 @@ TEST_F(SyncableDirectoryTest, TestSimpleFieldsPreservedDuringSaveChanges) {
create.Put(IS_UNSYNCED, true);
update.Put(IS_UNAPPLIED_UPDATE, true);
sync_pb::EntitySpecifics specifics;
- specifics.MutableExtension(sync_pb::bookmark)->set_favicon("PNG");
- specifics.MutableExtension(sync_pb::bookmark)->set_url("http://nowhere");
+ specifics.mutable_bookmark()->set_favicon("PNG");
+ specifics.mutable_bookmark()->set_url("http://nowhere");
create.Put(SPECIFICS, specifics);
create_pre_save = create.GetKernelCopy();
update_pre_save = update.GetKernelCopy();

Powered by Google App Engine
This is Rietveld 408576698