OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/user_policy_cache.h" | 5 #include "chrome/browser/policy/user_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/policy/configuration_policy_provider.h" | 14 #include "chrome/browser/policy/configuration_policy_provider.h" |
15 #include "chrome/browser/policy/proto/cloud_policy.pb.h" | 15 #include "chrome/browser/policy/proto/cloud_policy.pb.h" |
16 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 16 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
17 #include "chrome/browser/policy/proto/device_management_local.pb.h" | 17 #include "chrome/browser/policy/proto/device_management_local.pb.h" |
18 #include "chrome/browser/policy/proto/old_generic_format.pb.h" | 18 #include "chrome/browser/policy/proto/old_generic_format.pb.h" |
19 #include "chrome/test/testing_browser_process_test.h" | 19 #include "chrome/test/base/testing_browser_process_test.h" |
20 #include "content/browser/browser_thread.h" | 20 #include "content/browser/browser_thread.h" |
21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
23 | 23 |
24 using testing::_; | 24 using testing::_; |
25 | 25 |
26 namespace policy { | 26 namespace policy { |
27 | 27 |
28 // Decodes a CloudPolicySettings object into two maps with mandatory and | 28 // Decodes a CloudPolicySettings object into two maps with mandatory and |
29 // recommended settings, respectively. The implementation is generated code | 29 // recommended settings, respectively. The implementation is generated code |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // If new-style policy comes in, it should override old-style policy. | 378 // If new-style policy comes in, it should override old-style policy. |
379 policy = CreateHomepagePolicy("http://www.example.com", | 379 policy = CreateHomepagePolicy("http://www.example.com", |
380 base::Time::NowFromSystemTime(), | 380 base::Time::NowFromSystemTime(), |
381 em::PolicyOptions::RECOMMENDED); | 381 em::PolicyOptions::RECOMMENDED); |
382 SetPolicy(&cache, policy, true); | 382 SetPolicy(&cache, policy, true); |
383 EXPECT_TRUE(expected.Equals(recommended_policy(cache))); | 383 EXPECT_TRUE(expected.Equals(recommended_policy(cache))); |
384 EXPECT_TRUE(empty.Equals(mandatory_policy(cache))); | 384 EXPECT_TRUE(empty.Equals(mandatory_policy(cache))); |
385 } | 385 } |
386 | 386 |
387 } // namespace policy | 387 } // namespace policy |
OLD | NEW |