1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/callback.h"
6 #include "base/memory/scoped_ptr.h"
7 #include "base/prefs/pref_value_map.h"
8 #include "components/policy/core/browser/configuration_policy_handler.h"
9 #include "components/policy/core/browser/policy_error_map.h"
10 #include "components/policy/core/common/policy_map.h"
11 #include "testing/gtest/include/gtest/gtest.h"
13 // Note: this file should move to components/policy/core/browser, but the
14 // components_unittests runner does not load the ResourceBundle as
15 // ChromeTestSuite::Initialize does, which leads to failures using
22 StringToIntEnumListPolicyHandler::MappingEntry kTestTypeMap
[] = {
27 const char kTestPolicy
[] = "unit_test.test_policy";
28 const char kTestPref
[] = "unit_test.test_pref";
32 TEST(StringToIntEnumListPolicyHandlerTest
, CheckPolicySettings
) {
35 PolicyErrorMap errors
;
36 StringToIntEnumListPolicyHandler
handler(
40 kTestTypeMap
+ arraysize(kTestTypeMap
));
42 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
43 POLICY_SCOPE_USER
, list
.DeepCopy(), NULL
);
45 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
46 EXPECT_TRUE(errors
.empty());
48 list
.AppendString("one");
49 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
50 POLICY_SCOPE_USER
, list
.DeepCopy(), NULL
);
52 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
53 EXPECT_TRUE(errors
.empty());
55 list
.AppendString("invalid");
56 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
57 POLICY_SCOPE_USER
, list
.DeepCopy(), NULL
);
59 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
60 EXPECT_FALSE(errors
.empty());
61 EXPECT_FALSE(errors
.GetErrors(kTestPolicy
).empty());
63 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
65 base::Value::CreateStringValue("no list"), NULL
);
67 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
68 EXPECT_FALSE(errors
.empty());
69 EXPECT_FALSE(errors
.GetErrors(kTestPolicy
).empty());
72 TEST(StringToIntEnumListPolicyHandlerTest
, ApplyPolicySettings
) {
74 base::ListValue expected
;
78 StringToIntEnumListPolicyHandler
handler(
82 kTestTypeMap
+ arraysize(kTestTypeMap
));
84 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
85 POLICY_SCOPE_USER
, list
.DeepCopy(), NULL
);
86 handler
.ApplyPolicySettings(policy_map
, &prefs
);
87 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
88 EXPECT_TRUE(base::Value::Equals(&expected
, value
));
90 list
.AppendString("two");
91 expected
.AppendInteger(2);
92 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
93 POLICY_SCOPE_USER
, list
.DeepCopy(), NULL
);
94 handler
.ApplyPolicySettings(policy_map
, &prefs
);
95 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
96 EXPECT_TRUE(base::Value::Equals(&expected
, value
));
98 list
.AppendString("invalid");
99 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
100 POLICY_SCOPE_USER
, list
.DeepCopy(), NULL
);
101 handler
.ApplyPolicySettings(policy_map
, &prefs
);
102 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
103 EXPECT_TRUE(base::Value::Equals(&expected
, value
));
106 TEST(IntRangePolicyHandler
, CheckPolicySettingsClamp
) {
107 PolicyMap policy_map
;
108 PolicyErrorMap errors
;
110 // This tests needs to modify an int policy. The exact policy used and its
111 // semantics outside the test are irrelevant.
112 IntRangePolicyHandler
handler(kTestPolicy
, kTestPref
, 0, 10, true);
114 // Check that values lying in the accepted range are not rejected.
115 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
116 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
118 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
119 EXPECT_TRUE(errors
.empty());
121 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
122 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
124 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
125 EXPECT_TRUE(errors
.empty());
127 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
128 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
130 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
131 EXPECT_TRUE(errors
.empty());
133 // Check that values lying outside the accepted range are not rejected
134 // (because clamping is enabled) but do yield a warning message.
135 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
136 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(-5), NULL
);
138 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
139 EXPECT_FALSE(errors
.empty());
141 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
142 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(15), NULL
);
144 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
145 EXPECT_FALSE(errors
.empty());
147 // Check that an entirely invalid value is rejected and yields an error
149 policy_map
.Set(kTestPolicy
,
150 POLICY_LEVEL_MANDATORY
, POLICY_SCOPE_USER
,
151 base::Value::CreateStringValue("invalid"), NULL
);
153 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
154 EXPECT_FALSE(errors
.empty());
157 TEST(IntRangePolicyHandler
, CheckPolicySettingsDontClamp
) {
158 PolicyMap policy_map
;
159 PolicyErrorMap errors
;
161 // This tests needs to modify an int policy. The exact policy used and its
162 // semantics outside the test are irrelevant.
163 IntRangePolicyHandler
handler(kTestPolicy
, kTestPref
, 0, 10, false);
165 // Check that values lying in the accepted range are not rejected.
166 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
167 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
169 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
170 EXPECT_TRUE(errors
.empty());
172 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
173 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
175 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
176 EXPECT_TRUE(errors
.empty());
178 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
179 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
181 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
182 EXPECT_TRUE(errors
.empty());
184 // Check that values lying outside the accepted range are rejected and yield
186 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
187 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(-5), NULL
);
189 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
190 EXPECT_FALSE(errors
.empty());
192 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
193 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(15), NULL
);
195 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
196 EXPECT_FALSE(errors
.empty());
198 // Check that an entirely invalid value is rejected and yields an error
200 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
, POLICY_SCOPE_USER
,
201 base::Value::CreateStringValue("invalid"), NULL
);
203 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
204 EXPECT_FALSE(errors
.empty());
207 TEST(IntRangePolicyHandler
, ApplyPolicySettingsClamp
) {
208 PolicyMap policy_map
;
210 scoped_ptr
<base::Value
> expected
;
211 const base::Value
* value
;
213 // This tests needs to modify an int policy. The exact policy used and its
214 // semantics outside the test are irrelevant.
215 IntRangePolicyHandler
handler(kTestPolicy
, kTestPref
, 0, 10, true);
217 // Check that values lying in the accepted range are written to the pref.
218 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
219 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
221 handler
.ApplyPolicySettings(policy_map
, &prefs
);
222 expected
.reset(base::Value::CreateIntegerValue(0));
223 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
224 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
226 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
227 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
229 handler
.ApplyPolicySettings(policy_map
, &prefs
);
230 expected
.reset(base::Value::CreateIntegerValue(5));
231 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
232 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
234 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
235 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
237 handler
.ApplyPolicySettings(policy_map
, &prefs
);
238 expected
.reset(base::Value::CreateIntegerValue(10));
239 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
240 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
242 // Check that values lying outside the accepted range are clamped and written
244 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
245 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(-5), NULL
);
247 handler
.ApplyPolicySettings(policy_map
, &prefs
);
248 expected
.reset(base::Value::CreateIntegerValue(0));
249 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
250 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
252 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
253 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(15), NULL
);
255 handler
.ApplyPolicySettings(policy_map
, &prefs
);
256 expected
.reset(base::Value::CreateIntegerValue(10));
257 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
258 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
261 TEST(IntRangePolicyHandler
, ApplyPolicySettingsDontClamp
) {
262 PolicyMap policy_map
;
264 scoped_ptr
<base::Value
> expected
;
265 const base::Value
* value
;
267 // This tests needs to modify an int policy. The exact policy used and its
268 // semantics outside the test are irrelevant.
269 IntRangePolicyHandler
handler(kTestPolicy
, kTestPref
, 0, 10, true);
271 // Check that values lying in the accepted range are written to the pref.
272 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
273 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
275 handler
.ApplyPolicySettings(policy_map
, &prefs
);
276 expected
.reset(base::Value::CreateIntegerValue(0));
277 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
278 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
280 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
281 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
283 handler
.ApplyPolicySettings(policy_map
, &prefs
);
284 expected
.reset(base::Value::CreateIntegerValue(5));
285 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
286 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
288 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
289 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
291 handler
.ApplyPolicySettings(policy_map
, &prefs
);
292 expected
.reset(base::Value::CreateIntegerValue(10));
293 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
294 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
297 TEST(IntPercentageToDoublePolicyHandler
, CheckPolicySettingsClamp
) {
298 PolicyMap policy_map
;
299 PolicyErrorMap errors
;
301 // This tests needs to modify an int policy. The exact policy used and its
302 // semantics outside the test are irrelevant.
303 IntPercentageToDoublePolicyHandler
handler(
304 kTestPolicy
, kTestPref
, 0, 10, true);
306 // Check that values lying in the accepted range are not rejected.
307 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
308 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
310 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
311 EXPECT_TRUE(errors
.empty());
313 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
314 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
316 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
317 EXPECT_TRUE(errors
.empty());
319 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
320 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
322 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
323 EXPECT_TRUE(errors
.empty());
325 // Check that values lying outside the accepted range are not rejected
326 // (because clamping is enabled) but do yield a warning message.
327 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
328 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(-5), NULL
);
330 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
331 EXPECT_FALSE(errors
.empty());
333 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
334 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(15), NULL
);
336 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
337 EXPECT_FALSE(errors
.empty());
339 // Check that an entirely invalid value is rejected and yields an error
341 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
, POLICY_SCOPE_USER
,
342 base::Value::CreateStringValue("invalid"), NULL
);
344 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
345 EXPECT_FALSE(errors
.empty());
348 TEST(IntPercentageToDoublePolicyHandler
, CheckPolicySettingsDontClamp
) {
349 PolicyMap policy_map
;
350 PolicyErrorMap errors
;
352 // This tests needs to modify an int policy. The exact policy used and its
353 // semantics outside the test are irrelevant.
354 IntPercentageToDoublePolicyHandler
handler(
355 kTestPolicy
, kTestPref
, 0, 10, false);
357 // Check that values lying in the accepted range are not rejected.
358 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
359 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
361 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
362 EXPECT_TRUE(errors
.empty());
364 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
365 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
367 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
368 EXPECT_TRUE(errors
.empty());
370 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
371 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
373 EXPECT_TRUE(handler
.CheckPolicySettings(policy_map
, &errors
));
374 EXPECT_TRUE(errors
.empty());
376 // Check that values lying outside the accepted range are rejected and yield
378 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
379 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(-5), NULL
);
381 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
382 EXPECT_FALSE(errors
.empty());
384 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
385 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(15), NULL
);
387 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
388 EXPECT_FALSE(errors
.empty());
390 // Check that an entirely invalid value is rejected and yields an error
392 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
, POLICY_SCOPE_USER
,
393 base::Value::CreateStringValue("invalid"), NULL
);
395 EXPECT_FALSE(handler
.CheckPolicySettings(policy_map
, &errors
));
396 EXPECT_FALSE(errors
.empty());
399 TEST(IntPercentageToDoublePolicyHandler
, ApplyPolicySettingsClamp
) {
400 PolicyMap policy_map
;
402 scoped_ptr
<base::Value
> expected
;
403 const base::Value
* value
;
405 // This tests needs to modify an int policy. The exact policy used and its
406 // semantics outside the test are irrelevant.
407 IntPercentageToDoublePolicyHandler
handler(
408 kTestPolicy
, kTestPref
, 0, 10, true);
410 // Check that values lying in the accepted range are written to the pref.
411 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
412 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
414 handler
.ApplyPolicySettings(policy_map
, &prefs
);
415 expected
.reset(base::Value::CreateDoubleValue(0.0));
416 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
417 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
419 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
420 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
422 handler
.ApplyPolicySettings(policy_map
, &prefs
);
423 expected
.reset(base::Value::CreateDoubleValue(0.05));
424 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
425 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
427 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
428 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
430 handler
.ApplyPolicySettings(policy_map
, &prefs
);
431 expected
.reset(base::Value::CreateDoubleValue(0.1));
432 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
433 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
435 // Check that values lying outside the accepted range are clamped and written
437 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
438 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(-5), NULL
);
440 handler
.ApplyPolicySettings(policy_map
, &prefs
);
441 expected
.reset(base::Value::CreateDoubleValue(0.0));
442 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
443 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
445 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
446 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(15), NULL
);
448 handler
.ApplyPolicySettings(policy_map
, &prefs
);
449 expected
.reset(base::Value::CreateDoubleValue(0.1));
450 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
451 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
454 TEST(IntPercentageToDoublePolicyHandler
, ApplyPolicySettingsDontClamp
) {
455 PolicyMap policy_map
;
457 scoped_ptr
<base::Value
> expected
;
458 const base::Value
* value
;
460 // This tests needs to modify an int policy. The exact policy used and its
461 // semantics outside the test are irrelevant.
462 IntPercentageToDoublePolicyHandler
handler(
463 kTestPolicy
, kTestPref
, 0, 10, true);
465 // Check that values lying in the accepted range are written to the pref.
466 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
467 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(0), NULL
);
469 handler
.ApplyPolicySettings(policy_map
, &prefs
);
470 expected
.reset(base::Value::CreateDoubleValue(0.0));
471 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
472 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
474 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
475 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(5), NULL
);
477 handler
.ApplyPolicySettings(policy_map
, &prefs
);
478 expected
.reset(base::Value::CreateDoubleValue(0.05));
479 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
480 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
482 policy_map
.Set(kTestPolicy
, POLICY_LEVEL_MANDATORY
,
483 POLICY_SCOPE_USER
, base::Value::CreateIntegerValue(10), NULL
);
485 handler
.ApplyPolicySettings(policy_map
, &prefs
);
486 expected
.reset(base::Value::CreateDoubleValue(0.1));
487 EXPECT_TRUE(prefs
.GetValue(kTestPref
, &value
));
488 EXPECT_TRUE(base::Value::Equals(expected
.get(), value
));
491 } // namespace policy