| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/json/json_string_value_serializer.h" | 7 #include "base/json/json_string_value_serializer.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 using testing::AnyNumber; | 30 using testing::AnyNumber; |
| 31 using testing::Return; | 31 using testing::Return; |
| 32 using testing::_; | 32 using testing::_; |
| 33 | 33 |
| 34 class TestSyncProcessorStub : public syncer::SyncChangeProcessor { | 34 class TestSyncProcessorStub : public syncer::SyncChangeProcessor { |
| 35 virtual syncer::SyncError ProcessSyncChanges( | 35 virtual syncer::SyncError ProcessSyncChanges( |
| 36 const tracked_objects::Location& from_here, | 36 const tracked_objects::Location& from_here, |
| 37 const syncer::SyncChangeList& change_list) OVERRIDE { | 37 const syncer::SyncChangeList& change_list) OVERRIDE { |
| 38 return syncer::SyncError(); | 38 return syncer::SyncError(); |
| 39 } | 39 } |
| 40 |
| 41 virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const |
| 42 OVERRIDE { |
| 43 return syncer::SyncDataList(); |
| 44 } |
| 40 }; | 45 }; |
| 41 | 46 |
| 42 class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { | 47 class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { |
| 43 public: | 48 public: |
| 44 SyncedPrefChangeRegistrarTest() : next_sync_data_id_(0) {} | 49 SyncedPrefChangeRegistrarTest() : next_sync_data_id_(0) {} |
| 45 virtual ~SyncedPrefChangeRegistrarTest() {} | 50 virtual ~SyncedPrefChangeRegistrarTest() {} |
| 46 | 51 |
| 47 void UpdateChromePolicy(const policy::PolicyMap& policies) { | 52 void UpdateChromePolicy(const policy::PolicyMap& policies) { |
| 48 policy_provider_.UpdateChromePolicy(policies); | 53 policy_provider_.UpdateChromePolicy(policies); |
| 49 DCHECK(base::MessageLoop::current()); | 54 DCHECK(base::MessageLoop::current()); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 policy::POLICY_SCOPE_USER, | 212 policy::POLICY_SCOPE_USER, |
| 208 base::Value::CreateBooleanValue(true), | 213 base::Value::CreateBooleanValue(true), |
| 209 NULL); | 214 NULL); |
| 210 UpdateChromePolicy(policies); | 215 UpdateChromePolicy(policies); |
| 211 | 216 |
| 212 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); | 217 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); |
| 213 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); | 218 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); |
| 214 EXPECT_FALSE(observer.has_been_notified); | 219 EXPECT_FALSE(observer.has_been_notified); |
| 215 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); | 220 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); |
| 216 } | 221 } |
| OLD | NEW |