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

Side by Side Diff: components/policy/core/browser/configuration_policy_handler_unittest.cc

Issue 1651203002: Update components for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/pref_value_map.h"
10 #include "base/values.h" 9 #include "base/values.h"
11 #include "components/policy/core/browser/configuration_policy_handler.h" 10 #include "components/policy/core/browser/configuration_policy_handler.h"
12 #include "components/policy/core/browser/policy_error_map.h" 11 #include "components/policy/core/browser/policy_error_map.h"
13 #include "components/policy/core/common/policy_map.h" 12 #include "components/policy/core/common/policy_map.h"
14 #include "components/policy/core/common/policy_types.h" 13 #include "components/policy/core/common/policy_types.h"
15 #include "components/policy/core/common/schema.h" 14 #include "components/policy/core/common/schema.h"
15 #include "components/prefs/pref_value_map.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace policy { 18 namespace policy {
19 19
20 namespace { 20 namespace {
21 21
22 void GetIntegerTypeMap( 22 void GetIntegerTypeMap(
23 ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { 23 ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) {
24 result->push_back(new StringMappingListPolicyHandler::MappingEntry( 24 result->push_back(new StringMappingListPolicyHandler::MappingEntry(
25 "one", scoped_ptr<base::Value>(new base::FundamentalValue(1)))); 25 "one", scoped_ptr<base::Value>(new base::FundamentalValue(1))));
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 handler_recommended.ApplyPolicySettings(policy_map_mandatory, &prefs); 854 handler_recommended.ApplyPolicySettings(policy_map_mandatory, &prefs);
855 EXPECT_TRUE(prefs.GetValue(kTestPref, &value_set_in_pref)); 855 EXPECT_TRUE(prefs.GetValue(kTestPref, &value_set_in_pref));
856 EXPECT_TRUE(value_expected_in_pref->Equals(value_set_in_pref)); 856 EXPECT_TRUE(value_expected_in_pref->Equals(value_set_in_pref));
857 857
858 EXPECT_FALSE( 858 EXPECT_FALSE(
859 handler_none.CheckPolicySettings(policy_map_recommended, &errors)); 859 handler_none.CheckPolicySettings(policy_map_recommended, &errors));
860 EXPECT_FALSE(errors.empty()); 860 EXPECT_FALSE(errors.empty());
861 } 861 }
862 862
863 } // namespace policy 863 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698