| 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" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 | 96 |
| 97 syncer::WriteNode::InitUniqueByCreationResult result = | 97 syncer::WriteNode::InitUniqueByCreationResult result = |
| 98 node.InitUniqueByCreation(syncer::PREFERENCES, root, name); | 98 node.InitUniqueByCreation(syncer::PREFERENCES, root, name); |
| 99 if (result == syncer::WriteNode::INIT_SUCCESS) | 99 if (result == syncer::WriteNode::INIT_SUCCESS) |
| 100 return WriteSyncedValue(name, value, &node); | 100 return WriteSyncedValue(name, value, &node); |
| 101 | 101 |
| 102 return syncer::kInvalidId; | 102 return syncer::kInvalidId; |
| 103 } | 103 } |
| 104 | 104 |
| 105 // DataTypeDebugInfoListener implementation. | 105 // DataTypeDebugInfoListener implementation. |
| 106 virtual void OnSingleDataTypeConfigureComplete( | 106 virtual void OnDataTypeConfigureComplete( |
| 107 const syncer::DataTypeConfigurationStats& configuration_stats) OVERRIDE { | 107 const std::vector<syncer::DataTypeConfigurationStats>& |
| 108 association_stats_ = configuration_stats.association_stats; | 108 configuration_stats) OVERRIDE { |
| 109 } | 109 ASSERT_EQ(1u, configuration_stats.size()); |
| 110 virtual void OnConfigureComplete() OVERRIDE { | 110 association_stats_ = configuration_stats[0].association_stats; |
| 111 // Do nothing. | |
| 112 } | 111 } |
| 113 | 112 |
| 114 protected: | 113 protected: |
| 115 ProfileSyncServicePreferenceTest() | 114 ProfileSyncServicePreferenceTest() |
| 116 : debug_ptr_factory_(this), | 115 : debug_ptr_factory_(this), |
| 117 example_url0_("http://example.com/0"), | 116 example_url0_("http://example.com/0"), |
| 118 example_url1_("http://example.com/1"), | 117 example_url1_("http://example.com/1"), |
| 119 example_url2_("http://example.com/2"), | 118 example_url2_("http://example.com/2"), |
| 120 not_synced_preference_name_("nonsense_pref_name"), | 119 not_synced_preference_name_("nonsense_pref_name"), |
| 121 not_synced_preference_default_value_("default"), | 120 not_synced_preference_default_value_("default"), |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 EXPECT_FALSE(pref->IsDefaultValue()); | 684 EXPECT_FALSE(pref->IsDefaultValue()); |
| 686 // There should be no synced value. | 685 // There should be no synced value. |
| 687 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 686 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 688 // Switch kHomePage back to unmanaged. | 687 // Switch kHomePage back to unmanaged. |
| 689 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 688 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
| 690 // The original value should be picked up. | 689 // The original value should be picked up. |
| 691 EXPECT_TRUE(pref->IsDefaultValue()); | 690 EXPECT_TRUE(pref->IsDefaultValue()); |
| 692 // There should still be no synced value. | 691 // There should still be no synced value. |
| 693 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 692 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 694 } | 693 } |
| OLD | NEW |