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

Side by Side Diff: chrome/browser/extensions/policy_handlers_unittest.cc

Issue 2273783002: Move policy generated files to components/policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed headers Created 4 years, 4 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
« no previous file with comments | « chrome/browser/extensions/policy_handlers.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 5 #include <utility>
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "chrome/browser/extensions/external_policy_loader.h" 8 #include "chrome/browser/extensions/external_policy_loader.h"
9 #include "chrome/browser/extensions/policy_handlers.h" 9 #include "chrome/browser/extensions/policy_handlers.h"
10 #include "components/policy/core/browser/policy_error_map.h" 10 #include "components/policy/core/browser/policy_error_map.h"
11 #include "components/policy/core/common/policy_map.h" 11 #include "components/policy/core/common/policy_map.h"
12 #include "components/policy/core/common/policy_types.h" 12 #include "components/policy/core/common/policy_types.h"
13 #include "components/policy/core/common/schema.h" 13 #include "components/policy/core/common/schema.h"
14 #include "components/policy/policy_constants.h"
14 #include "components/prefs/pref_value_map.h" 15 #include "components/prefs/pref_value_map.h"
15 #include "extensions/browser/pref_names.h" 16 #include "extensions/browser/pref_names.h"
16 #include "policy/policy_constants.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 namespace extensions { 19 namespace extensions {
20 20
21 const char kTestPref[] = "unit_test.test_pref"; 21 const char kTestPref[] = "unit_test.test_pref";
22 const char kTestManagementPolicy1[] = 22 const char kTestManagementPolicy1[] =
23 "{" 23 "{"
24 " \"abcdefghijklmnopabcdefghijklmnop\": {" 24 " \"abcdefghijklmnopabcdefghijklmnop\": {"
25 " \"installation_mode\": \"force_installed\"," 25 " \"installation_mode\": \"force_installed\","
26 " }," 26 " },"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 policy::POLICY_SOURCE_CLOUD, policy_value->CreateDeepCopy(), 303 policy::POLICY_SOURCE_CLOUD, policy_value->CreateDeepCopy(),
304 nullptr); 304 nullptr);
305 EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors)); 305 EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
306 handler.ApplyPolicySettings(policy_map, &prefs); 306 handler.ApplyPolicySettings(policy_map, &prefs);
307 base::Value* value = NULL; 307 base::Value* value = NULL;
308 ASSERT_TRUE(prefs.GetValue(pref_names::kExtensionManagement, &value)); 308 ASSERT_TRUE(prefs.GetValue(pref_names::kExtensionManagement, &value));
309 EXPECT_TRUE(base::Value::Equals(policy_value.get(), value)); 309 EXPECT_TRUE(base::Value::Equals(policy_value.get(), value));
310 } 310 }
311 311
312 } // namespace extensions 312 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/policy_handlers.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698