| 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/message_loop/message_loop.h" |
| 10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 11 #include "base/values.h" | 12 #include "base/values.h" |
| 12 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 13 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
| 15 #include "chrome/test/base/in_process_browser_test.h" | 16 #include "chrome/test/base/in_process_browser_test.h" |
| 16 #include "chrome/test/base/testing_profile.h" | 17 #include "chrome/test/base/testing_profile.h" |
| 17 #include "components/policy/core/browser/browser_policy_connector.h" | 18 #include "components/policy/core/browser/browser_policy_connector.h" |
| 18 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 19 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
| 19 #include "components/policy/core/common/policy_map.h" | 20 #include "components/policy/core/common/policy_map.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 policies.Set(policy::key::kShowHomeButton, policy::POLICY_LEVEL_MANDATORY, | 201 policies.Set(policy::key::kShowHomeButton, policy::POLICY_LEVEL_MANDATORY, |
| 201 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, | 202 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, |
| 202 base::MakeUnique<base::Value>(true), nullptr); | 203 base::MakeUnique<base::Value>(true), nullptr); |
| 203 UpdateChromePolicy(policies); | 204 UpdateChromePolicy(policies); |
| 204 | 205 |
| 205 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); | 206 EXPECT_TRUE(prefs()->IsManagedPreference(prefs::kShowHomeButton)); |
| 206 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); | 207 SetBooleanPrefValueFromSync(prefs::kShowHomeButton, false); |
| 207 EXPECT_FALSE(observer.has_been_notified); | 208 EXPECT_FALSE(observer.has_been_notified); |
| 208 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); | 209 EXPECT_TRUE(GetBooleanPrefValue(prefs::kShowHomeButton)); |
| 209 } | 210 } |
| OLD | NEW |