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

Side by Side Diff: chrome/browser/policy/configuration_policy_handler_unittest.cc

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years 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 (c) 2012 The Chromium Authors. All rights reserved. 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 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/callback.h" 5 #include "base/callback.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/prefs/pref_value_map.h" 7 #include "base/prefs/pref_value_map.h"
8 #include "chrome/browser/policy/configuration_policy_handler.h" 8 #include "components/policy/core/browser/configuration_policy_handler.h"
9 #include "components/policy/core/browser/policy_error_map.h" 9 #include "components/policy/core/browser/policy_error_map.h"
10 #include "components/policy/core/common/policy_map.h" 10 #include "components/policy/core/common/policy_map.h"
11 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
12 12
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
16 // PolicyErrorMap.
17
13 namespace policy { 18 namespace policy {
14 19
15 namespace { 20 namespace {
16 21
17 StringToIntEnumListPolicyHandler::MappingEntry kTestTypeMap[] = { 22 StringToIntEnumListPolicyHandler::MappingEntry kTestTypeMap[] = {
18 { "one", 1 }, 23 { "one", 1 },
19 { "two", 2 }, 24 { "two", 2 },
20 }; 25 };
21 26
22 const char kTestPolicy[] = "unit_test.test_policy"; 27 const char kTestPolicy[] = "unit_test.test_policy";
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, 482 policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY,
478 POLICY_SCOPE_USER, base::Value::CreateIntegerValue(10), NULL); 483 POLICY_SCOPE_USER, base::Value::CreateIntegerValue(10), NULL);
479 prefs.Clear(); 484 prefs.Clear();
480 handler.ApplyPolicySettings(policy_map, &prefs); 485 handler.ApplyPolicySettings(policy_map, &prefs);
481 expected.reset(base::Value::CreateDoubleValue(0.1)); 486 expected.reset(base::Value::CreateDoubleValue(0.1));
482 EXPECT_TRUE(prefs.GetValue(kTestPref, &value)); 487 EXPECT_TRUE(prefs.GetValue(kTestPref, &value));
483 EXPECT_TRUE(base::Value::Equals(expected.get(), value)); 488 EXPECT_TRUE(base::Value::Equals(expected.get(), value));
484 } 489 }
485 490
486 } // namespace policy 491 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698