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

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

Issue 6312121: Add initial device policy infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup/compile fixes. Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/policy/device_management_policy_cache.h" 5 #include "chrome/browser/policy/cloud_policy_cache.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/scoped_temp_dir.h" 12 #include "base/scoped_temp_dir.h"
13 #include "base/values.h" 13 #include "base/values.h"
14 #include "chrome/browser/browser_thread.h" 14 #include "chrome/browser/browser_thread.h"
15 #include "chrome/browser/policy/proto/device_management_constants.h" 15 #include "chrome/browser/policy/proto/device_management_constants.h"
16 #include "chrome/browser/policy/proto/device_management_local.pb.h" 16 #include "chrome/browser/policy/proto/device_management_local.pb.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 18
19 #if 0
danno 2011/02/04 16:01:33 uuuuuhhhhh, might need some rework here?
20
19 namespace policy { 21 namespace policy {
20 22
21 // Wraps base functionaly for the test cases. 23 // Wraps base functionaly for the test cases.
22 class DeviceManagementPolicyCacheTestBase : public testing::Test { 24 class DeviceManagementPolicyCacheTestBase : public testing::Test {
23 protected: 25 protected:
24 // Add a string policy setting to a policy response message. 26 // Add a string policy setting to a policy response message.
25 void AddStringPolicy(em::DevicePolicyResponse* policy, 27 void AddStringPolicy(em::DevicePolicyResponse* policy,
26 const std::string& name, 28 const std::string& name,
27 const std::string& value) { 29 const std::string& value) {
28 em::DevicePolicySetting* setting = policy->add_setting(); 30 em::DevicePolicySetting* setting = policy->add_setting();
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 em::DevicePolicyResponse policy; 314 em::DevicePolicyResponse policy;
313 AddStringPolicy(&policy, "HomepageLocation", "http://www.example.com"); 315 AddStringPolicy(&policy, "HomepageLocation", "http://www.example.com");
314 scoped_ptr<Value> decoded(DeviceManagementPolicyCache::DecodePolicy(policy)); 316 scoped_ptr<Value> decoded(DeviceManagementPolicyCache::DecodePolicy(policy));
315 DictionaryValue expected; 317 DictionaryValue expected;
316 expected.Set("HomepageLocation", 318 expected.Set("HomepageLocation",
317 Value::CreateStringValue("http://www.example.com")); 319 Value::CreateStringValue("http://www.example.com"));
318 EXPECT_TRUE(expected.Equals(decoded.get())); 320 EXPECT_TRUE(expected.Equals(decoded.get()));
319 } 321 }
320 322
321 } // namespace policy 323 } // namespace policy
324
325 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698