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" | |
15 #include "chrome/browser/policy/proto/cloud_policy.pb.h" | 14 #include "chrome/browser/policy/proto/cloud_policy.pb.h" |
16 #include "chrome/browser/policy/proto/device_management_backend.pb.h" | 15 #include "chrome/browser/policy/proto/device_management_backend.pb.h" |
17 #include "chrome/browser/policy/proto/device_management_local.pb.h" | 16 #include "chrome/browser/policy/proto/device_management_local.pb.h" |
18 #include "chrome/browser/policy/proto/old_generic_format.pb.h" | 17 #include "chrome/browser/policy/proto/old_generic_format.pb.h" |
19 #include "content/browser/browser_thread.h" | 18 #include "content/browser/browser_thread.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
22 | 21 |
23 using testing::_; | 22 using testing::_; |
24 | 23 |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // If new-style policy comes in, it should override old-style policy. | 407 // If new-style policy comes in, it should override old-style policy. |
409 policy = CreateHomepagePolicy("http://www.example.com", | 408 policy = CreateHomepagePolicy("http://www.example.com", |
410 base::Time::NowFromSystemTime(), | 409 base::Time::NowFromSystemTime(), |
411 em::PolicyOptions::RECOMMENDED); | 410 em::PolicyOptions::RECOMMENDED); |
412 SetPolicy(&cache, policy, true); | 411 SetPolicy(&cache, policy, true); |
413 EXPECT_TRUE(expected.Equals(recommended_policy(cache))); | 412 EXPECT_TRUE(expected.Equals(recommended_policy(cache))); |
414 EXPECT_TRUE(empty.Equals(mandatory_policy(cache))); | 413 EXPECT_TRUE(empty.Equals(mandatory_policy(cache))); |
415 } | 414 } |
416 | 415 |
417 } // namespace policy | 416 } // namespace policy |
OLD | NEW |