| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "base/json/json_reader.h" | 5 #include "base/json/json_reader.h" |
| 6 #include "base/json/json_string_value_serializer.h" | 6 #include "base/json/json_string_value_serializer.h" |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "chrome/browser/prefs/pref_model_associator.h" | 11 #include "chrome/browser/prefs/pref_model_associator.h" |
| 12 #include "chrome/browser/prefs/pref_service_syncable.h" | 12 #include "chrome/browser/prefs/pref_service_syncable.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/test/base/testing_pref_service_syncable.h" | 14 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 15 #include "components/pref_registry/pref_registry_syncable.h" | 15 #include "components/pref_registry/pref_registry_syncable.h" |
| 16 #include "grit/locale_settings.h" | 16 #include "grit/locale_settings.h" |
| 17 #include "sync/api/attachments/attachment_id.h" | 17 #include "sync/api/attachments/attachment_id.h" |
| 18 #include "sync/api/attachments/attachment_service_proxy_for_test.h" | |
| 19 #include "sync/api/sync_change.h" | 18 #include "sync/api/sync_change.h" |
| 20 #include "sync/api/sync_data.h" | 19 #include "sync/api/sync_data.h" |
| 21 #include "sync/api/sync_error_factory_mock.h" | 20 #include "sync/api/sync_error_factory_mock.h" |
| 22 #include "sync/api/syncable_service.h" | 21 #include "sync/api/syncable_service.h" |
| 22 #include "sync/internal_api/public/attachments/attachment_service_proxy_for_test
.h" |
| 23 #include "sync/protocol/preference_specifics.pb.h" | 23 #include "sync/protocol/preference_specifics.pb.h" |
| 24 #include "sync/protocol/sync.pb.h" | 24 #include "sync/protocol/sync.pb.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 26 |
| 27 using syncer::SyncChange; | 27 using syncer::SyncChange; |
| 28 using syncer::SyncData; | 28 using syncer::SyncData; |
| 29 | 29 |
| 30 namespace { | 30 namespace { |
| 31 const char kExampleUrl0[] = "http://example.com/0"; | 31 const char kExampleUrl0[] = "http://example.com/0"; |
| 32 const char kExampleUrl1[] = "http://example.com/1"; | 32 const char kExampleUrl1[] = "http://example.com/1"; |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 EXPECT_FALSE(pref->IsDefaultValue()); | 699 EXPECT_FALSE(pref->IsDefaultValue()); |
| 700 // There should be no synced value. | 700 // There should be no synced value. |
| 701 EXPECT_FALSE(FindValue(prefs::kHomePage, out).get()); | 701 EXPECT_FALSE(FindValue(prefs::kHomePage, out).get()); |
| 702 // Switch kHomePage back to unmanaged. | 702 // Switch kHomePage back to unmanaged. |
| 703 GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 703 GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
| 704 // The original value should be picked up. | 704 // The original value should be picked up. |
| 705 EXPECT_TRUE(pref->IsDefaultValue()); | 705 EXPECT_TRUE(pref->IsDefaultValue()); |
| 706 // There should still be no synced value. | 706 // There should still be no synced value. |
| 707 EXPECT_FALSE(FindValue(prefs::kHomePage, out).get()); | 707 EXPECT_FALSE(FindValue(prefs::kHomePage, out).get()); |
| 708 } | 708 } |
| OLD | NEW |