| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 5 #include <map> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
| 12 #include "base/json/json_string_value_serializer.h" | 12 #include "base/json/json_string_value_serializer.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/string_piece.h" | 15 #include "base/string_piece.h" |
| 16 #include "chrome/browser/prefs/pref_model_associator.h" | 16 #include "chrome/browser/prefs/pref_model_associator.h" |
| 17 #include "chrome/browser/prefs/pref_registry_syncable.h" | |
| 18 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 17 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 19 #include "chrome/browser/signin/signin_manager.h" | 18 #include "chrome/browser/signin/signin_manager.h" |
| 20 #include "chrome/browser/signin/signin_manager_factory.h" | 19 #include "chrome/browser/signin/signin_manager_factory.h" |
| 21 #include "chrome/browser/signin/token_service_factory.h" | 20 #include "chrome/browser/signin/token_service_factory.h" |
| 22 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 21 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
| 23 #include "chrome/browser/sync/glue/generic_change_processor.h" | 22 #include "chrome/browser/sync/glue/generic_change_processor.h" |
| 24 #include "chrome/browser/sync/glue/sync_backend_host.h" | 23 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 25 #include "chrome/browser/sync/glue/ui_data_type_controller.h" | 24 #include "chrome/browser/sync/glue/ui_data_type_controller.h" |
| 26 #include "chrome/browser/sync/profile_sync_service_factory.h" | 25 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 27 #include "chrome/browser/sync/profile_sync_test_util.h" | 26 #include "chrome/browser/sync/profile_sync_test_util.h" |
| 28 #include "chrome/browser/sync/test_profile_sync_service.h" | 27 #include "chrome/browser/sync/test_profile_sync_service.h" |
| 29 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 30 #include "chrome/test/base/testing_pref_service_syncable.h" | 29 #include "chrome/test/base/testing_pref_service_syncable.h" |
| 31 #include "chrome/test/base/testing_profile.h" | 30 #include "chrome/test/base/testing_profile.h" |
| 31 #include "components/user_prefs/pref_registry_syncable.h" |
| 32 #include "google_apis/gaia/gaia_constants.h" | 32 #include "google_apis/gaia/gaia_constants.h" |
| 33 #include "sync/api/sync_data.h" | 33 #include "sync/api/sync_data.h" |
| 34 #include "sync/internal_api/public/base/model_type.h" | 34 #include "sync/internal_api/public/base/model_type.h" |
| 35 #include "sync/internal_api/public/change_record.h" | 35 #include "sync/internal_api/public/change_record.h" |
| 36 #include "sync/internal_api/public/read_node.h" | 36 #include "sync/internal_api/public/read_node.h" |
| 37 #include "sync/internal_api/public/read_transaction.h" | 37 #include "sync/internal_api/public/read_transaction.h" |
| 38 #include "sync/internal_api/public/write_node.h" | 38 #include "sync/internal_api/public/write_node.h" |
| 39 #include "sync/internal_api/public/write_transaction.h" | 39 #include "sync/internal_api/public/write_transaction.h" |
| 40 #include "sync/protocol/preference_specifics.pb.h" | 40 #include "sync/protocol/preference_specifics.pb.h" |
| 41 #include "testing/gmock/include/gmock/gmock.h" | 41 #include "testing/gmock/include/gmock/gmock.h" |
| (...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 EXPECT_FALSE(pref->IsDefaultValue()); | 675 EXPECT_FALSE(pref->IsDefaultValue()); |
| 676 // There should be no synced value. | 676 // There should be no synced value. |
| 677 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 677 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 678 // Switch kHomePage back to unmanaged. | 678 // Switch kHomePage back to unmanaged. |
| 679 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 679 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
| 680 // The original value should be picked up. | 680 // The original value should be picked up. |
| 681 EXPECT_TRUE(pref->IsDefaultValue()); | 681 EXPECT_TRUE(pref->IsDefaultValue()); |
| 682 // There should still be no synced value. | 682 // There should still be no synced value. |
| 683 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 683 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 684 } | 684 } |
| OLD | NEW |