| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/messaging/native_messaging_policy_handle
r.h" | 5 #include "chrome/browser/extensions/api/messaging/native_messaging_policy_handle
r.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_value_map.h" | 7 #include "base/prefs/pref_value_map.h" |
| 8 #include "chrome/browser/extensions/policy_handlers.h" | 8 #include "chrome/browser/extensions/policy_handlers.h" |
| 9 #include "chrome/common/pref_names.h" | |
| 10 #include "components/policy/core/browser/policy_error_map.h" | 9 #include "components/policy/core/browser/policy_error_map.h" |
| 11 #include "components/policy/core/common/policy_map.h" | 10 #include "components/policy/core/common/policy_map.h" |
| 12 #include "policy/policy_constants.h" | 11 #include "policy/policy_constants.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 13 |
| 15 namespace extensions { | 14 namespace extensions { |
| 16 | 15 |
| 17 const char kTestPref[] = "unit_test.test_pref"; | 16 const char kTestPref[] = "unit_test.test_pref"; |
| 18 | 17 |
| 19 TEST(NativeMessagingHostListPolicyHandlerTest, CheckPolicySettings) { | 18 TEST(NativeMessagingHostListPolicyHandlerTest, CheckPolicySettings) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 policy::POLICY_LEVEL_MANDATORY, | 109 policy::POLICY_LEVEL_MANDATORY, |
| 111 policy::POLICY_SCOPE_USER, | 110 policy::POLICY_SCOPE_USER, |
| 112 policy.DeepCopy(), | 111 policy.DeepCopy(), |
| 113 NULL); | 112 NULL); |
| 114 handler.ApplyPolicySettings(policy_map, &prefs); | 113 handler.ApplyPolicySettings(policy_map, &prefs); |
| 115 EXPECT_TRUE(prefs.GetValue(kTestPref, &value)); | 114 EXPECT_TRUE(prefs.GetValue(kTestPref, &value)); |
| 116 EXPECT_TRUE(base::Value::Equals(&expected, value)); | 115 EXPECT_TRUE(base::Value::Equals(&expected, value)); |
| 117 } | 116 } |
| 118 | 117 |
| 119 } // namespace extensions | 118 } // namespace extensions |
| OLD | NEW |