Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: components/policy/core/common/policy_bundle_unittest.cc

Issue 388963002: Get rid of the rest of CreateStringValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix bad rebase Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "components/policy/core/common/policy_bundle.h" 5 #include "components/policy/core/common/policy_bundle.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "components/policy/core/common/external_data_fetcher.h" 10 #include "components/policy/core/common/external_data_fetcher.h"
(...skipping 14 matching lines...) Expand all
25 const char kExtension2[] = "extension-2"; 25 const char kExtension2[] = "extension-2";
26 const char kExtension3[] = "extension-3"; 26 const char kExtension3[] = "extension-3";
27 27
28 // Adds test policies to |policy|. 28 // Adds test policies to |policy|.
29 void AddTestPolicies(PolicyMap* policy) { 29 void AddTestPolicies(PolicyMap* policy) {
30 policy->Set("mandatory-user", 30 policy->Set("mandatory-user",
31 POLICY_LEVEL_MANDATORY, 31 POLICY_LEVEL_MANDATORY,
32 POLICY_SCOPE_USER, 32 POLICY_SCOPE_USER,
33 new base::FundamentalValue(123), 33 new base::FundamentalValue(123),
34 NULL); 34 NULL);
35 policy->Set("mandatory-machine", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, 35 policy->Set("mandatory-machine",
36 base::Value::CreateStringValue("omg"), NULL); 36 POLICY_LEVEL_MANDATORY,
37 POLICY_SCOPE_MACHINE,
38 new base::StringValue("omg"),
39 NULL);
37 policy->Set("recommended-user", 40 policy->Set("recommended-user",
38 POLICY_LEVEL_RECOMMENDED, 41 POLICY_LEVEL_RECOMMENDED,
39 POLICY_SCOPE_USER, 42 POLICY_SCOPE_USER,
40 new base::FundamentalValue(true), 43 new base::FundamentalValue(true),
41 NULL); 44 NULL);
42 base::DictionaryValue* dict = new base::DictionaryValue(); 45 base::DictionaryValue* dict = new base::DictionaryValue();
43 dict->SetBoolean("false", false); 46 dict->SetBoolean("false", false);
44 dict->SetInteger("int", 456); 47 dict->SetInteger("int", 456);
45 dict->SetString("str", "bbq"); 48 dict->SetString("str", "bbq");
46 policy->Set("recommended-machine", POLICY_LEVEL_RECOMMENDED, 49 policy->Set("recommended-machine", POLICY_LEVEL_RECOMMENDED,
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 EXPECT_TRUE(bundle.Equals(other)); 284 EXPECT_TRUE(bundle.Equals(other));
282 policy_map.Set(kPolicy0, 285 policy_map.Set(kPolicy0,
283 POLICY_LEVEL_MANDATORY, 286 POLICY_LEVEL_MANDATORY,
284 POLICY_SCOPE_USER, 287 POLICY_SCOPE_USER,
285 new base::FundamentalValue(123), 288 new base::FundamentalValue(123),
286 NULL); 289 NULL);
287 EXPECT_FALSE(bundle.Equals(other)); 290 EXPECT_FALSE(bundle.Equals(other));
288 } 291 }
289 292
290 } // namespace policy 293 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/mac_util.cc ('k') | components/policy/core/common/policy_loader_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698