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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 12 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
15 #include "chrome/test/base/in_process_browser_test.h" | 15 #include "chrome/test/base/in_process_browser_test.h" |
16 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
17 #include "components/policy/core/browser/browser_policy_connector.h" | 17 #include "components/policy/core/browser/browser_policy_connector.h" |
18 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 18 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
19 #include "components/policy/core/common/policy_map.h" | 19 #include "components/policy/core/common/policy_map.h" |
20 #include "components/policy/core/common/policy_types.h" | 20 #include "components/policy/core/common/policy_types.h" |
21 #include "components/policy/policy_constants.h" | 21 #include "components/policy/policy_constants.h" |
22 #include "components/sync/api/attachments/attachment_id.h" | 22 #include "components/sync/model/attachments/attachment_id.h" |
23 #include "components/sync/api/attachments/attachment_service_proxy_for_test.h" | 23 #include "components/sync/model/attachments/attachment_service_proxy_for_test.h" |
24 #include "components/sync/api/fake_sync_change_processor.h" | 24 #include "components/sync/model/fake_sync_change_processor.h" |
25 #include "components/sync/api/sync_change.h" | 25 #include "components/sync/model/sync_change.h" |
26 #include "components/sync/api/sync_error_factory.h" | 26 #include "components/sync/model/sync_error_factory.h" |
27 #include "components/sync/api/sync_error_factory_mock.h" | 27 #include "components/sync/model/sync_error_factory_mock.h" |
28 #include "components/sync/api/syncable_service.h" | 28 #include "components/sync/model/syncable_service.h" |
29 #include "components/sync/protocol/sync.pb.h" | 29 #include "components/sync/protocol/sync.pb.h" |
30 #include "components/syncable_prefs/synced_pref_change_registrar.h" | 30 #include "components/syncable_prefs/synced_pref_change_registrar.h" |
31 #include "components/syncable_prefs/testing_pref_service_syncable.h" | 31 #include "components/syncable_prefs/testing_pref_service_syncable.h" |
32 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" |
33 | 33 |
34 namespace { | 34 namespace { |
35 | 35 |
36 using testing::Return; | 36 using testing::Return; |
37 using testing::_; | 37 using testing::_; |
38 | 38 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 policies.Set(policy::key::kShowHomeButton, policy::POLICY_LEVEL_MANDATORY, | 202 policies.Set(policy::key::kShowHomeButton, policy::POLICY_LEVEL_MANDATORY, |
203 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, | 203 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, |
204 base::MakeUnique<base::FundamentalValue>(true), nullptr); | 204 base::MakeUnique<base::FundamentalValue>(true), nullptr); |
205 UpdateChromePolicy(policies); | 205 UpdateChromePolicy(policies); |
206 | 206 |
207 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); | 207 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); |
208 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); | 208 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); |
209 EXPECT_FALSE(observer.has_been_notified); | 209 EXPECT_FALSE(observer.has_been_notified); |
210 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); | 210 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); |
211 } | 211 } |
OLD | NEW |