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

Unified Diff: net/tools/testserver/chromiumsync_test.py

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, 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
« no previous file with comments | « net/tools/testserver/chromiumsync.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/testserver/chromiumsync_test.py
diff --git a/net/tools/testserver/chromiumsync_test.py b/net/tools/testserver/chromiumsync_test.py
index d704ac3ee2de2700764e072dd48d96908a1ed207..5c9ca8dc9f7475761574e6f5596f63a1523efb19 100755
--- a/net/tools/testserver/chromiumsync_test.py
+++ b/net/tools/testserver/chromiumsync_test.py
@@ -25,8 +25,9 @@ class SyncDataModelTest(unittest.TestCase):
message = sync_pb2.GetUpdatesMessage()
message.from_timestamp = timestamp
for data_type in requested_types:
- message.requested_types.Extensions[
- chromiumsync.SYNC_TYPE_TO_EXTENSION[data_type]].SetInParent()
+ getattr(message.requested_types,
+ chromiumsync.SYNC_TYPE_TO_DESCRIPTOR[
+ data_type].name).SetInParent()
return self.model.GetChanges(
chromiumsync.UpdateSieve(message, self.model.migration_history))
@@ -298,12 +299,12 @@ class SyncDataModelTest(unittest.TestCase):
def testUpdateSieve(self):
# from_timestamp, legacy mode
- autofill = autofill_specifics_pb2.autofill
- theme = theme_specifics_pb2.theme
+ autofill = chromiumsync.SYNC_TYPE_FIELDS['autofill']
+ theme = chromiumsync.SYNC_TYPE_FIELDS['theme']
msg = sync_pb2.GetUpdatesMessage()
msg.from_timestamp = 15412
- msg.requested_types.Extensions[autofill].SetInParent()
- msg.requested_types.Extensions[theme].SetInParent()
+ msg.requested_types.autofill.SetInParent()
+ msg.requested_types.theme.SetInParent()
sieve = chromiumsync.UpdateSieve(msg)
self.assertEqual(sieve._state,
@@ -448,8 +449,8 @@ class SyncDataModelTest(unittest.TestCase):
self.assertTrue(testserver.transient_error)
def testUpdateSieveStoreMigration(self):
- autofill = autofill_specifics_pb2.autofill
- theme = theme_specifics_pb2.theme
+ autofill = chromiumsync.SYNC_TYPE_FIELDS['autofill']
+ theme = chromiumsync.SYNC_TYPE_FIELDS['theme']
migrator = chromiumsync.MigrationHistory()
msg = sync_pb2.GetUpdatesMessage()
marker = msg.from_progress_marker.add()
« no previous file with comments | « net/tools/testserver/chromiumsync.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698