OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
11 #include "base/task.h" | 11 #include "base/task.h" |
12 #include "base/tracked.h" | 12 #include "base/tracked.h" |
13 #include "chrome/browser/prefs/pref_model_associator.h" | 13 #include "chrome/browser/prefs/pref_model_associator.h" |
14 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 14 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
15 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 15 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
16 #include "chrome/browser/sync/api/sync_data.h" | 16 #include "chrome/browser/sync/api/sync_data.h" |
17 #include "chrome/browser/sync/engine/syncapi.h" | 17 #include "chrome/browser/sync/engine/syncapi.h" |
18 #include "chrome/browser/sync/glue/generic_change_processor.h" | 18 #include "chrome/browser/sync/glue/generic_change_processor.h" |
19 #include "chrome/browser/sync/glue/preference_data_type_controller.h" | 19 #include "chrome/browser/sync/glue/preference_data_type_controller.h" |
20 #include "chrome/browser/sync/glue/sync_backend_host.h" | 20 #include "chrome/browser/sync/glue/sync_backend_host.h" |
21 #include "chrome/browser/sync/glue/syncable_service_adapter.h" | 21 #include "chrome/browser/sync/glue/syncable_service_adapter.h" |
22 #include "chrome/browser/sync/profile_sync_test_util.h" | 22 #include "chrome/browser/sync/profile_sync_test_util.h" |
23 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" | 23 #include "chrome/browser/sync/protocol/preference_specifics.pb.h" |
24 #include "chrome/browser/sync/syncable/model_type.h" | 24 #include "chrome/browser/sync/syncable/model_type.h" |
25 #include "chrome/browser/sync/test_profile_sync_service.h" | 25 #include "chrome/browser/sync/test_profile_sync_service.h" |
26 #include "chrome/common/net/gaia/gaia_constants.h" | 26 #include "chrome/common/net/gaia/gaia_constants.h" |
27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/test/base/testing_pref_service.h" |
28 #include "chrome/test/base/testing_profile.h" | 29 #include "chrome/test/base/testing_profile.h" |
29 #include "chrome/test/testing_pref_service.h" | |
30 #include "content/common/json_value_serializer.h" | 30 #include "content/common/json_value_serializer.h" |
31 #include "testing/gmock/include/gmock/gmock.h" | 31 #include "testing/gmock/include/gmock/gmock.h" |
32 #include "testing/gtest/include/gtest/gtest.h" | 32 #include "testing/gtest/include/gtest/gtest.h" |
33 | 33 |
34 using base::JSONReader; | 34 using base::JSONReader; |
35 using browser_sync::GenericChangeProcessor; | 35 using browser_sync::GenericChangeProcessor; |
36 using browser_sync::PreferenceDataTypeController; | 36 using browser_sync::PreferenceDataTypeController; |
37 using browser_sync::SyncBackendHost; | 37 using browser_sync::SyncBackendHost; |
38 using browser_sync::SyncableServiceAdapter; | 38 using browser_sync::SyncableServiceAdapter; |
39 using sync_api::SyncManager; | 39 using sync_api::SyncManager; |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 | 531 |
532 // The pref value should still be the one dictated by policy. | 532 // The pref value should still be the one dictated by policy. |
533 EXPECT_TRUE(managed_value->Equals(&GetPreferenceValue(prefs::kHomePage))); | 533 EXPECT_TRUE(managed_value->Equals(&GetPreferenceValue(prefs::kHomePage))); |
534 | 534 |
535 // Switch kHomePage back to unmanaged. | 535 // Switch kHomePage back to unmanaged. |
536 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 536 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
537 | 537 |
538 // Sync value should be picked up. | 538 // Sync value should be picked up. |
539 EXPECT_TRUE(sync_value->Equals(&GetPreferenceValue(prefs::kHomePage))); | 539 EXPECT_TRUE(sync_value->Equals(&GetPreferenceValue(prefs::kHomePage))); |
540 } | 540 } |
OLD | NEW |