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 21 matching lines...) Expand all Loading... |
32 #endif | 32 #endif |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 using testing::Return; | 36 using testing::Return; |
37 using testing::_; | 37 using testing::_; |
38 | 38 |
39 class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { | 39 class SyncedPrefChangeRegistrarTest : public InProcessBrowserTest { |
40 public: | 40 public: |
41 SyncedPrefChangeRegistrarTest() : next_sync_data_id_(0) {} | 41 SyncedPrefChangeRegistrarTest() : next_sync_data_id_(0) {} |
42 virtual ~SyncedPrefChangeRegistrarTest() {} | 42 ~SyncedPrefChangeRegistrarTest() override {} |
43 | 43 |
44 #if defined(ENABLE_CONFIGURATION_POLICY) | 44 #if defined(ENABLE_CONFIGURATION_POLICY) |
45 void UpdateChromePolicy(const policy::PolicyMap& policies) { | 45 void UpdateChromePolicy(const policy::PolicyMap& policies) { |
46 policy_provider_.UpdateChromePolicy(policies); | 46 policy_provider_.UpdateChromePolicy(policies); |
47 DCHECK(base::MessageLoop::current()); | 47 DCHECK(base::MessageLoop::current()); |
48 base::RunLoop loop; | 48 base::RunLoop loop; |
49 loop.RunUntilIdle(); | 49 loop.RunUntilIdle(); |
50 } | 50 } |
51 #endif | 51 #endif |
52 | 52 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 new base::FundamentalValue(true), | 214 new base::FundamentalValue(true), |
215 NULL); | 215 NULL); |
216 UpdateChromePolicy(policies); | 216 UpdateChromePolicy(policies); |
217 | 217 |
218 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); | 218 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); |
219 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); | 219 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); |
220 EXPECT_FALSE(observer.has_been_notified); | 220 EXPECT_FALSE(observer.has_been_notified); |
221 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); | 221 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); |
222 } | 222 } |
223 #endif | 223 #endif |
OLD | NEW |