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/policy/javascript_policy_handler.h" | 5 #include "chrome/browser/policy/javascript_policy_handler.h" |
6 #include "chrome/common/content_settings.h" | 6 #include "chrome/common/content_settings.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 "components/policy/core/browser/policy_error_map.h" | 10 #include "components/policy/core/browser/policy_error_map.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 NULL); | 53 NULL); |
54 UpdateProviderPolicy(policy); | 54 UpdateProviderPolicy(policy); |
55 const base::Value* value = NULL; | 55 const base::Value* value = NULL; |
56 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, | 56 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, |
57 &value)); | 57 &value)); |
58 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_BLOCK).Equals(value)); | 58 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_BLOCK).Equals(value)); |
59 // DefaultJavaScriptSetting overrides JavascriptEnabled. | 59 // DefaultJavaScriptSetting overrides JavascriptEnabled. |
60 policy.Set(key::kDefaultJavaScriptSetting, | 60 policy.Set(key::kDefaultJavaScriptSetting, |
61 POLICY_LEVEL_MANDATORY, | 61 POLICY_LEVEL_MANDATORY, |
62 POLICY_SCOPE_USER, | 62 POLICY_SCOPE_USER, |
63 base::Value::CreateIntegerValue(CONTENT_SETTING_ALLOW), | 63 new base::FundamentalValue(CONTENT_SETTING_ALLOW), |
64 NULL); | 64 NULL); |
65 UpdateProviderPolicy(policy); | 65 UpdateProviderPolicy(policy); |
66 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, | 66 EXPECT_TRUE(store_->GetValue(prefs::kManagedDefaultJavaScriptSetting, |
67 &value)); | 67 &value)); |
68 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); | 68 EXPECT_TRUE(base::FundamentalValue(CONTENT_SETTING_ALLOW).Equals(value)); |
69 } | 69 } |
70 | 70 |
71 } // namespace policy | 71 } // namespace policy |
OLD | NEW |