| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 profile_.reset(new TestingProfile()); | 98 profile_.reset(new TestingProfile()); |
| 99 profile_->CreateRequestContext(); | 99 profile_->CreateRequestContext(); |
| 100 prefs_ = profile_->GetTestingPrefService(); | 100 prefs_ = profile_->GetTestingPrefService(); |
| 101 | 101 |
| 102 prefs_->RegisterStringPref(not_synced_preference_name_.c_str(), | 102 prefs_->RegisterStringPref(not_synced_preference_name_.c_str(), |
| 103 not_synced_preference_default_value_, | 103 not_synced_preference_default_value_, |
| 104 PrefService::UNSYNCABLE_PREF); | 104 PrefService::UNSYNCABLE_PREF); |
| 105 } | 105 } |
| 106 | 106 |
| 107 virtual void TearDown() { | 107 virtual void TearDown() { |
| 108 service_->Shutdown(); |
| 108 service_.reset(); | 109 service_.reset(); |
| 109 profile_.reset(); | 110 profile_.reset(); |
| 110 AbstractProfileSyncServiceTest::TearDown(); | 111 AbstractProfileSyncServiceTest::TearDown(); |
| 111 } | 112 } |
| 112 | 113 |
| 113 bool StartSyncService(const base::Closure& callback, | 114 bool StartSyncService(const base::Closure& callback, |
| 114 bool will_fail_association) { | 115 bool will_fail_association) { |
| 115 if (service_.get()) | 116 if (service_.get()) |
| 116 return false; | 117 return false; |
| 117 | 118 |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 EXPECT_FALSE(pref->IsDefaultValue()); | 576 EXPECT_FALSE(pref->IsDefaultValue()); |
| 576 // There should be no synced value. | 577 // There should be no synced value. |
| 577 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 578 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 578 // Switch kHomePage back to unmanaged. | 579 // Switch kHomePage back to unmanaged. |
| 579 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); | 580 profile_->GetTestingPrefService()->RemoveManagedPref(prefs::kHomePage); |
| 580 // The original value should be picked up. | 581 // The original value should be picked up. |
| 581 EXPECT_TRUE(pref->IsDefaultValue()); | 582 EXPECT_TRUE(pref->IsDefaultValue()); |
| 582 // There should still be no synced value. | 583 // There should still be no synced value. |
| 583 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); | 584 EXPECT_TRUE(GetSyncedValue(prefs::kHomePage) == NULL); |
| 584 } | 585 } |
| OLD | NEW |