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/memory/scoped_temp_dir.h" | |
12 #include "base/message_loop.h" | 11 #include "base/message_loop.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 "content/browser/browser_thread.h" | 19 #include "content/browser/browser_thread.h" |
20 #include "testing/gmock/include/gmock/gmock.h" | 20 #include "testing/gmock/include/gmock/gmock.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // If new-style policy comes in, it should override old-style policy. | 373 // If new-style policy comes in, it should override old-style policy. |
374 policy = CreateHomepagePolicy("http://www.example.com", | 374 policy = CreateHomepagePolicy("http://www.example.com", |
375 base::Time::NowFromSystemTime(), | 375 base::Time::NowFromSystemTime(), |
376 em::PolicyOptions::RECOMMENDED); | 376 em::PolicyOptions::RECOMMENDED); |
377 SetPolicy(&cache, policy, true); | 377 SetPolicy(&cache, policy, true); |
378 EXPECT_TRUE(expected.Equals(recommended_policy(cache))); | 378 EXPECT_TRUE(expected.Equals(recommended_policy(cache))); |
379 EXPECT_TRUE(empty.Equals(mandatory_policy(cache))); | 379 EXPECT_TRUE(empty.Equals(mandatory_policy(cache))); |
380 } | 380 } |
381 | 381 |
382 } // namespace policy | 382 } // namespace policy |
OLD | NEW |