[Sync::Cleanup] Exclude deprecated model types from presubmit check.
1) Exclude deprecated model types (e.g. DEPRECATED_SUPERVISED_USERS and DEPRECATED_SUPERVISED_USER_SHARED_SETTINGS) from kModelTypeInfoMap presubmit check.
2) Improve a couple of comments in model_type.cc.
Change-Id: I68fd166396804c69ca567686b671ee9d19c624ac
Reviewed-on: https://chromium-review.googlesource.com/1054875
Reviewed-by: Marc Treib <[email protected]>
Commit-Queue: vitaliii <[email protected]>
Cr-Commit-Position: refs/heads/master@{#557858}
diff --git a/components/sync/PRESUBMIT_test.py b/components/sync/PRESUBMIT_test.py
index d22f53c..6164a18a 100755
--- a/components/sync/PRESUBMIT_test.py
+++ b/components/sync/PRESUBMIT_test.py
@@ -76,6 +76,8 @@
'optional AppSpecifics app = 456;\n'
'optional AppSettingSpecifics app_setting = 789;\n'
'optional ExtensionSettingSpecifics extension_setting = 910;\n'
+ 'optional ManagedUserSharedSettingSpecifics managed_user_shared_setting'
+ ' = 915;\n'
'//comment\n'
'}\n')
@@ -84,6 +86,7 @@
# in order to test presubmit parsing of the ModelTypeInfoMap in that file.
MOCK_MODELTYPE_CONTENTS =('\n'
'const ModelTypeInfo kModelTypeInfoMap[] = {\n'
+ '// Some comment \n'
'{APP_SETTINGS, "APP_SETTING", "app_settings", "App settings",\n'
'sync_pb::EntitySpecifics::kAppSettingFieldNumber, 13},\n'
'%s\n'
@@ -107,6 +110,13 @@
results = self._testChange('{PROXY_TABS, "", "", "Tabs", -1, 25},')
self.assertEqual(0, len(results))
+ def testValidChangeDeprecatedEntry(self):
+ results = self._testChange('{DEPRECATED_SUPERVISED_USER_SHARED_SETTINGS,'
+ '"MANAGED_USER_SHARED_SETTING", "managed_user_shared_settings",'
+ '"Managed User Shared Settings",'
+ 'sync_pb::EntitySpecifics::kManagedUserSharedSettingFieldNumber, 30},')
+ self.assertEqual(0, len(results))
+
def testInvalidChangeMismatchedNotificationType(self):
results = self._testChange('{AUTOFILL, "AUTOFILL_WRONG", "autofill",\n'
'"Autofill",sync_pb::EntitySpecifics::kAutofillFieldNumber, 6},')