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

Side by Side Diff: chrome/browser/sync/protocol/proto_value_conversions_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 // Keep this file in sync with the .proto files in this directory. 5 // Keep this file in sync with the .proto files in this directory.
6 6
7 #include "chrome/browser/sync/protocol/proto_value_conversions.h" 7 #include "chrome/browser/sync/protocol/proto_value_conversions.h"
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 TEST_F(ProtoValueConversionsTest, TypedUrlSpecificsToValue) { 155 TEST_F(ProtoValueConversionsTest, TypedUrlSpecificsToValue) {
156 TestSpecificsToValue(TypedUrlSpecificsToValue); 156 TestSpecificsToValue(TypedUrlSpecificsToValue);
157 } 157 }
158 158
159 // TODO(akalin): Figure out how to better test EntitySpecificsToValue. 159 // TODO(akalin): Figure out how to better test EntitySpecificsToValue.
160 160
161 TEST_F(ProtoValueConversionsTest, EntitySpecificsToValue) { 161 TEST_F(ProtoValueConversionsTest, EntitySpecificsToValue) {
162 sync_pb::EntitySpecifics specifics; 162 sync_pb::EntitySpecifics specifics;
163 // Touch the extensions to make sure it shows up in the generated 163 // Touch the extensions to make sure it shows up in the generated
164 // value. 164 // value.
165 #define SET_EXTENSION(key) (void)specifics.MutableExtension(sync_pb::key) 165 #define SET_FIELD(key) (void)specifics.mutable_##key()
166 166
167 SET_EXTENSION(app); 167 SET_FIELD(app);
168 SET_EXTENSION(app_notification); 168 SET_FIELD(app_notification);
169 SET_EXTENSION(app_setting); 169 SET_FIELD(app_setting);
170 SET_EXTENSION(autofill); 170 SET_FIELD(autofill);
171 SET_EXTENSION(autofill_profile); 171 SET_FIELD(autofill_profile);
172 SET_EXTENSION(bookmark); 172 SET_FIELD(bookmark);
173 SET_EXTENSION(extension); 173 SET_FIELD(extension);
174 SET_EXTENSION(extension_setting); 174 SET_FIELD(extension_setting);
175 SET_EXTENSION(nigori); 175 SET_FIELD(nigori);
176 SET_EXTENSION(password); 176 SET_FIELD(password);
177 SET_EXTENSION(preference); 177 SET_FIELD(preference);
178 SET_EXTENSION(search_engine); 178 SET_FIELD(search_engine);
179 SET_EXTENSION(session); 179 SET_FIELD(session);
180 SET_EXTENSION(theme); 180 SET_FIELD(theme);
181 SET_EXTENSION(typed_url); 181 SET_FIELD(typed_url);
182 182
183 #undef SET_EXTENSION 183 #undef SET_FIELD
184 184
185 scoped_ptr<DictionaryValue> value(EntitySpecificsToValue(specifics)); 185 scoped_ptr<DictionaryValue> value(EntitySpecificsToValue(specifics));
186 EXPECT_EQ(syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, 186 EXPECT_EQ(syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE,
187 static_cast<int>(value->size())); 187 static_cast<int>(value->size()));
188 } 188 }
189 189
190 } // namespace 190 } // namespace
191 } // namespace browser_sync 191 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/protocol/proto_value_conversions.cc ('k') | chrome/browser/sync/protocol/search_engine_specifics.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698