import session_specifics_pb2
import sync_pb2
import sync_enums_pb2
+import synced_notification_app_info_specifics_pb2
import synced_notification_data_pb2
import synced_notification_render_pb2
import synced_notification_specifics_pb2
SEARCH_ENGINE,
SESSION,
SYNCED_NOTIFICATION,
+ SYNCED_NOTIFICATION_APP_INFO,
THEME,
TYPED_URL,
EXTENSION_SETTINGS,
FAVICON_IMAGES,
- FAVICON_TRACKING) = range(29)
+ FAVICON_TRACKING) = range(30)
# An enumeration on the frequency at which the server should send errors
# to the client. This would be specified by the url that triggers the error.
SEARCH_ENGINE: SYNC_TYPE_FIELDS['search_engine'],
SESSION: SYNC_TYPE_FIELDS['session'],
SYNCED_NOTIFICATION: SYNC_TYPE_FIELDS["synced_notification"],
+ SYNCED_NOTIFICATION_APP_INFO:
+ SYNC_TYPE_FIELDS["synced_notification_app_info"],
THEME: SYNC_TYPE_FIELDS['theme'],
TYPED_URL: SYNC_TYPE_FIELDS['typed_url'],
}
PermanentItem('google_chrome_synced_notifications',
name='Synced Notifications',
parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION),
+ PermanentItem('google_chrome_synced_notification_app_info',
+ name='Synced Notification App Info',
+ parent_tag=ROOT_ID, sync_type=SYNCED_NOTIFICATION_APP_INFO),
PermanentItem('google_chrome_search_engines', name='Search Engines',
parent_tag=ROOT_ID, sync_type=SEARCH_ENGINE),
PermanentItem('google_chrome_sessions', name='Sessions',
generation methods.
Args:
- datatype: The sync type (python enum) of the identified object.
tag: The unique, known-to-the-client tag of a server-generated item.
Returns:
The string value of the computed server ID.
entity.parent_id_string = self._ServerTagToId(
'google_chrome_synced_notifications')
entity.name = 'Synced notification added for testing'
- entity.server_defined_unique_tag = unique_notification_id
# Set the version to one more than the greatest version number already seen.
entries = sorted(self._entries.values(), key=operator.attrgetter('version'))
entity.client_defined_unique_tag = self._CreateSyncedNotificationClientTag(
specifics.synced_notification.coalesced_notification.key)
entity.id_string = self._ClientTagToId(GetEntryType(entity),
- entity.client_defined_unique_tag)
+ entity.client_defined_unique_tag)
self._entries[entity.id_string] = copy.deepcopy(entity)
return specifics
-
def _CreateSyncedNotificationClientTag(self, key):
"""Create the client_defined_unique_tag value for a SyncedNotification.
hash_input = serialized_type.SerializeToString() + key
return base64.b64encode(hashlib.sha1(hash_input).digest())
-
class TestServer(object):
"""An object to handle requests for one (and only one) Chrome Sync account.