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 "chrome/browser/prefs/incognito_mode_prefs.h" | 5 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
6 #include "chrome/browser/profiles/incognito_mode_policy_handler.h" | 6 #include "chrome/browser/profiles/incognito_mode_policy_handler.h" |
7 #include "chrome/common/pref_names.h" | 7 #include "chrome/common/pref_names.h" |
8 #include "components/policy/core/browser/configuration_policy_pref_store.h" | 8 #include "components/policy/core/browser/configuration_policy_pref_store.h" |
9 #include "components/policy/core/browser/configuration_policy_pref_store_test.h" | 9 #include "components/policy/core/browser/configuration_policy_pref_store_test.h" |
10 #include "policy/policy_constants.h" | 10 #include "policy/policy_constants.h" |
11 | 11 |
12 namespace policy { | 12 namespace policy { |
13 | 13 |
14 // Tests Incognito mode availability preference setting. | 14 // Tests Incognito mode availability preference setting. |
15 class IncognitoModePolicyHandlerTest | 15 class IncognitoModePolicyHandlerTest |
16 : public ConfigurationPolicyPrefStoreTest { | 16 : public ConfigurationPolicyPrefStoreTest { |
17 public: | 17 public: |
18 virtual void SetUp() OVERRIDE { | 18 virtual void SetUp() override { |
19 handler_list_.AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( | 19 handler_list_.AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( |
20 new IncognitoModePolicyHandler)); | 20 new IncognitoModePolicyHandler)); |
21 } | 21 } |
22 protected: | 22 protected: |
23 static const int kIncognitoModeAvailabilityNotSet = -1; | 23 static const int kIncognitoModeAvailabilityNotSet = -1; |
24 | 24 |
25 enum ObsoleteIncognitoEnabledValue { | 25 enum ObsoleteIncognitoEnabledValue { |
26 INCOGNITO_ENABLED_UNKNOWN, | 26 INCOGNITO_ENABLED_UNKNOWN, |
27 INCOGNITO_ENABLED_TRUE, | 27 INCOGNITO_ENABLED_TRUE, |
28 INCOGNITO_ENABLED_FALSE | 28 INCOGNITO_ENABLED_FALSE |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 VerifyValues(IncognitoModePrefs::ENABLED); | 105 VerifyValues(IncognitoModePrefs::ENABLED); |
106 } | 106 } |
107 | 107 |
108 TEST_F(IncognitoModePolicyHandlerTest, | 108 TEST_F(IncognitoModePolicyHandlerTest, |
109 ObsoletePolicySetsPreferenceToDisabled) { | 109 ObsoletePolicySetsPreferenceToDisabled) { |
110 SetPolicies(INCOGNITO_ENABLED_FALSE, kIncognitoModeAvailabilityNotSet); | 110 SetPolicies(INCOGNITO_ENABLED_FALSE, kIncognitoModeAvailabilityNotSet); |
111 VerifyValues(IncognitoModePrefs::DISABLED); | 111 VerifyValues(IncognitoModePrefs::DISABLED); |
112 } | 112 } |
113 | 113 |
114 } // namespace policy | 114 } // namespace policy |
OLD | NEW |