OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/policy/core/common/cloud/cloud_policy_core.h" | 5 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/prefs/pref_registry_simple.h" | |
9 #include "base/prefs/testing_pref_service.h" | |
10 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 8 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
11 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" | 9 #include "components/policy/core/common/cloud/cloud_policy_refresh_scheduler.h" |
12 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" | 10 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h" |
13 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" | 11 #include "components/policy/core/common/cloud/mock_cloud_policy_store.h" |
14 #include "components/policy/core/common/policy_pref_names.h" | 12 #include "components/policy/core/common/policy_pref_names.h" |
| 13 #include "components/prefs/pref_registry_simple.h" |
| 14 #include "components/prefs/testing_pref_service.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace policy { | 17 namespace policy { |
18 | 18 |
19 class CloudPolicyCoreTest : public testing::Test, | 19 class CloudPolicyCoreTest : public testing::Test, |
20 public CloudPolicyCore::Observer { | 20 public CloudPolicyCore::Observer { |
21 protected: | 21 protected: |
22 CloudPolicyCoreTest() | 22 CloudPolicyCoreTest() |
23 : core_(dm_protocol::kChromeUserPolicyType, | 23 : core_(dm_protocol::kChromeUserPolicyType, |
24 std::string(), | 24 std::string(), |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 prefs_.ClearPref(policy_prefs::kUserPolicyRefreshRate); | 126 prefs_.ClearPref(policy_prefs::kUserPolicyRefreshRate); |
127 EXPECT_EQ(default_refresh_delay, core_.refresh_scheduler()->refresh_delay()); | 127 EXPECT_EQ(default_refresh_delay, core_.refresh_scheduler()->refresh_delay()); |
128 | 128 |
129 EXPECT_EQ(1, core_connected_callback_count_); | 129 EXPECT_EQ(1, core_connected_callback_count_); |
130 EXPECT_EQ(1, refresh_scheduler_started_callback_count_); | 130 EXPECT_EQ(1, refresh_scheduler_started_callback_count_); |
131 EXPECT_EQ(0, core_disconnecting_callback_count_); | 131 EXPECT_EQ(0, core_disconnecting_callback_count_); |
132 EXPECT_EQ(0, bad_callback_count_); | 132 EXPECT_EQ(0, bad_callback_count_); |
133 } | 133 } |
134 | 134 |
135 } // namespace policy | 135 } // namespace policy |
OLD | NEW |