OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <gtest/gtest.h> | 5 #include <gtest/gtest.h> |
6 #include <windows.h> | 6 #include <windows.h> |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 const char* policy_name() const { return policy_name_; } | 71 const char* policy_name() const { return policy_name_; } |
72 const Value* hklm_value() const { return hklm_value_.get(); } | 72 const Value* hklm_value() const { return hklm_value_.get(); } |
73 const Value* hkcu_value() const { return hkcu_value_.get(); } | 73 const Value* hkcu_value() const { return hkcu_value_.get(); } |
74 | 74 |
75 // Factory methods for different value types. | 75 // Factory methods for different value types. |
76 static PolicyTestParams ForStringPolicy( | 76 static PolicyTestParams ForStringPolicy( |
77 ConfigurationPolicyType type, | 77 ConfigurationPolicyType type, |
78 const char* policy_name) { | 78 const char* policy_name) { |
79 return PolicyTestParams(type, | 79 return PolicyTestParams(type, |
80 policy_name, | 80 policy_name, |
81 Value::CreateStringValue("string_a"), | 81 base::StringValue::New("string_a"), |
82 Value::CreateStringValue("string_b")); | 82 base::StringValue::New("string_b")); |
83 } | 83 } |
84 static PolicyTestParams ForBooleanPolicy( | 84 static PolicyTestParams ForBooleanPolicy( |
85 ConfigurationPolicyType type, | 85 ConfigurationPolicyType type, |
86 const char* policy_name) { | 86 const char* policy_name) { |
87 return PolicyTestParams(type, | 87 return PolicyTestParams(type, |
88 policy_name, | 88 policy_name, |
89 Value::CreateBooleanValue(true), | 89 base::TrueValue(), |
90 Value::CreateBooleanValue(false)); | 90 base::FalseValue()); |
91 } | 91 } |
92 static PolicyTestParams ForIntegerPolicy( | 92 static PolicyTestParams ForIntegerPolicy( |
93 ConfigurationPolicyType type, | 93 ConfigurationPolicyType type, |
94 const char* policy_name) { | 94 const char* policy_name) { |
95 return PolicyTestParams(type, | 95 return PolicyTestParams(type, |
96 policy_name, | 96 policy_name, |
97 Value::CreateIntegerValue(42), | 97 base::NumberValue::New(42), |
98 Value::CreateIntegerValue(17)); | 98 base::NumberValue::New(17)); |
99 } | 99 } |
100 static PolicyTestParams ForListPolicy( | 100 static PolicyTestParams ForListPolicy( |
101 ConfigurationPolicyType type, | 101 ConfigurationPolicyType type, |
102 const char* policy_name) { | 102 const char* policy_name) { |
103 ListValue* hklm_value = new ListValue; | 103 ListValue* hklm_value = new ListValue; |
104 hklm_value->Set(0U, Value::CreateStringValue("It's a plane!")); | 104 hklm_value->Set(0U, base::StringValue::New("It's a plane!")); |
105 ListValue* hkcu_value = new ListValue; | 105 ListValue* hkcu_value = new ListValue; |
106 hkcu_value->Set(0U, Value::CreateStringValue("It's a bird!")); | 106 hkcu_value->Set(0U, base::StringValue::New("It's a bird!")); |
107 hkcu_value->Set(0U, Value::CreateStringValue("It's a flying carpet!")); | 107 hkcu_value->Set(0U, base::StringValue::New("It's a flying carpet!")); |
108 return PolicyTestParams(type, policy_name, hklm_value, hkcu_value); | 108 return PolicyTestParams(type, policy_name, hklm_value, hkcu_value); |
109 } | 109 } |
110 | 110 |
111 private: | 111 private: |
112 ConfigurationPolicyType type_; | 112 ConfigurationPolicyType type_; |
113 const char* policy_name_; | 113 const char* policy_name_; |
114 scoped_ptr<Value> hklm_value_; | 114 scoped_ptr<Value> hklm_value_; |
115 scoped_ptr<Value> hkcu_value_; | 115 scoped_ptr<Value> hkcu_value_; |
116 }; | 116 }; |
117 | 117 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 kPolicyDisabledSchemes, | 502 kPolicyDisabledSchemes, |
503 key::kDisabledSchemes), | 503 key::kDisabledSchemes), |
504 PolicyTestParams::ForStringPolicy( | 504 PolicyTestParams::ForStringPolicy( |
505 kPolicyDiskCacheDir, | 505 kPolicyDiskCacheDir, |
506 key::kDiskCacheDir), | 506 key::kDiskCacheDir), |
507 PolicyTestParams::ForIntegerPolicy( | 507 PolicyTestParams::ForIntegerPolicy( |
508 kPolicyMaxConnectionsPerProxy, | 508 kPolicyMaxConnectionsPerProxy, |
509 key::kMaxConnectionsPerProxy))); | 509 key::kMaxConnectionsPerProxy))); |
510 | 510 |
511 } // namespace policy | 511 } // namespace policy |
OLD | NEW |