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/scoped_user_pref_update.h" | 17 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
18 #include "chrome/browser/signin/signin_manager.h" | 18 #include "chrome/browser/signin/signin_manager.h" |
19 #include "chrome/browser/signin/signin_manager_factory.h" | 19 #include "chrome/browser/signin/signin_manager_factory.h" |
20 #include "chrome/browser/signin/token_service_factory.h" | 20 #include "chrome/browser/signin/token_service_factory.h" |
21 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" | 21 #include "chrome/browser/sync/abstract_profile_sync_service_test.h" |
22 #include "chrome/browser/sync/api/sync_data.h" | 22 #include "chrome/browser/sync/api/sync_data.h" |
23 #include "chrome/browser/sync/glue/generic_change_processor.h" | 23 #include "chrome/browser/sync/glue/generic_change_processor.h" |
24 #include "chrome/browser/sync/glue/sync_backend_host.h" | 24 #include "chrome/browser/sync/glue/sync_backend_host.h" |
25 #include "chrome/browser/sync/glue/ui_data_type_controller.h" | 25 #include "chrome/browser/sync/glue/ui_data_type_controller.h" |
26 #include "chrome/browser/sync/internal_api/change_record.h" | |
27 #include "chrome/browser/sync/internal_api/read_node.h" | |
28 #include "chrome/browser/sync/internal_api/read_transaction.h" | |
29 #include "chrome/browser/sync/internal_api/write_node.h" | |
30 #include "chrome/browser/sync/internal_api/write_transaction.h" | |
31 #include "chrome/browser/sync/profile_sync_test_util.h" | 26 #include "chrome/browser/sync/profile_sync_test_util.h" |
32 #include "chrome/browser/sync/test_profile_sync_service.h" | 27 #include "chrome/browser/sync/test_profile_sync_service.h" |
33 #include "chrome/common/net/gaia/gaia_constants.h" | 28 #include "chrome/common/net/gaia/gaia_constants.h" |
34 #include "chrome/common/pref_names.h" | 29 #include "chrome/common/pref_names.h" |
35 #include "chrome/test/base/testing_pref_service.h" | 30 #include "chrome/test/base/testing_pref_service.h" |
36 #include "chrome/test/base/testing_profile.h" | 31 #include "chrome/test/base/testing_profile.h" |
| 32 #include "sync/internal_api/change_record.h" |
| 33 #include "sync/internal_api/read_node.h" |
| 34 #include "sync/internal_api/read_transaction.h" |
| 35 #include "sync/internal_api/write_node.h" |
| 36 #include "sync/internal_api/write_transaction.h" |
37 #include "sync/protocol/preference_specifics.pb.h" | 37 #include "sync/protocol/preference_specifics.pb.h" |
38 #include "sync/syncable/model_type.h" | 38 #include "sync/syncable/model_type.h" |
39 #include "testing/gmock/include/gmock/gmock.h" | 39 #include "testing/gmock/include/gmock/gmock.h" |
40 #include "testing/gtest/include/gtest/gtest.h" | 40 #include "testing/gtest/include/gtest/gtest.h" |
41 | 41 |
42 using base::JSONReader; | 42 using base::JSONReader; |
43 using browser_sync::GenericChangeProcessor; | 43 using browser_sync::GenericChangeProcessor; |
44 using browser_sync::SharedChangeProcessor; | 44 using browser_sync::SharedChangeProcessor; |
45 using browser_sync::UIDataTypeController; | 45 using browser_sync::UIDataTypeController; |
46 using sync_api::ChangeRecord; | 46 using sync_api::ChangeRecord; |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 EXPECT_FALSE(pref->IsDefaultValue()); | 572 EXPECT_FALSE(pref->IsDefaultValue()); |
573 // There should be no synced value. | 573 // There should be no synced value. |
574 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 574 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
575 // Switch kHomePage back to unmanaged. | 575 // Switch kHomePage back to unmanaged. |
576 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 576 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
577 // The original value should be picked up. | 577 // The original value should be picked up. |
578 EXPECT_TRUE(pref->IsDefaultValue()); | 578 EXPECT_TRUE(pref->IsDefaultValue()); |
579 // There should still be no synced value. | 579 // There should still be no synced value. |
580 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 580 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
581 } | 581 } |
OLD | NEW |