summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorskrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:52:05 +0000
committerskrul@chromium.org <skrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-07 22:52:05 +0000
commit4fe95a617e494a2e279d9d623816f3e3b7aed944 (patch)
treec8b4ce33bb3793d757b166c9be330ac224e31cf5 /chrome
parent30839bd931ee2e32cb4bab8c5afd2649eb00e634 (diff)
downloadchromium_src-4fe95a617e494a2e279d9d623816f3e3b7aed944.zip
chromium_src-4fe95a617e494a2e279d9d623816f3e3b7aed944.tar.gz
chromium_src-4fe95a617e494a2e279d9d623816f3e3b7aed944.tar.bz2
Mac clients should ignore updates of kAcceptLanguages.
Also add a unit test to make sure the change processor does not explode when it sees updates from the cloud to a preference it does not know about. BUG=44714 TEST=unit Review URL: http://codereview.chromium.org/2805077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/sync/glue/synchronized_preferences.h4
-rw-r--r--chrome/browser/sync/profile_sync_service_preference_unittest.cc20
2 files changed, 24 insertions, 0 deletions
diff --git a/chrome/browser/sync/glue/synchronized_preferences.h b/chrome/browser/sync/glue/synchronized_preferences.h
index 6b4a9086..0ecb3a6 100644
--- a/chrome/browser/sync/glue/synchronized_preferences.h
+++ b/chrome/browser/sync/glue/synchronized_preferences.h
@@ -61,7 +61,11 @@ static const wchar_t* kSynchronizedPreferences[] = {
// Options dialog: Under the hood -> Change font and language settings.
// Serif, San Serif, Fixed font settings not synced.
prefs::kDefaultCharset,
+ // There is no dialog to modify the kAcceptLanguages list on OSX, so
+ // don't sync it.
+#if !defined(OS_MACOSX)
prefs::kAcceptLanguages,
+#endif
prefs::kEnableSpellCheck,
// Spell checker language not synced.
prefs::kApplicationLocale,
diff --git a/chrome/browser/sync/profile_sync_service_preference_unittest.cc b/chrome/browser/sync/profile_sync_service_preference_unittest.cc
index 18f6194..6556c83 100644
--- a/chrome/browser/sync/profile_sync_service_preference_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_preference_unittest.cc
@@ -391,3 +391,23 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionAdd) {
EXPECT_EQ(node_id,
model_associator_->GetSyncIdFromChromeId(prefs::kHomePage));
}
+
+TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeUnknownPreference) {
+ CreateRootTask task(this, syncable::PREFERENCES);
+ ASSERT_TRUE(StartSyncService(&task, false));
+ ASSERT_TRUE(task.success());
+
+ scoped_ptr<Value> expected(Value::CreateStringValue(example_url0_));
+ int64 node_id = SetSyncedValue(L"unknown preference", *expected);
+ ASSERT_NE(node_id, sync_api::kInvalidId);
+ scoped_ptr<SyncManager::ChangeRecord> record(new SyncManager::ChangeRecord);
+ record->action = SyncManager::ChangeRecord::ACTION_ADD;
+ record->id = node_id;
+ {
+ sync_api::WriteTransaction trans(backend()->GetUserShareHandle());
+ change_processor_->ApplyChangesFromSyncModel(&trans, record.get(), 1);
+ }
+
+ // Nothing interesting happens on the client when it gets an update
+ // of an unknown preference. We just should not crash.
+}