OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/policy/device_cloud_policy_initializer.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_initializer.h" |
6 | 6 |
7 #include "base/prefs/testing_pref_service.h" | |
8 #include "base/values.h" | 7 #include "base/values.h" |
9 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 8 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
10 #include "chrome/browser/chromeos/policy/server_backed_device_state.h" | 9 #include "chrome/browser/chromeos/policy/server_backed_device_state.h" |
11 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" | 10 #include "chrome/browser/chromeos/policy/stub_enterprise_install_attributes.h" |
12 #include "chrome/browser/prefs/browser_prefs.h" | 11 #include "chrome/browser/prefs/browser_prefs.h" |
13 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
14 #include "chromeos/system/fake_statistics_provider.h" | 13 #include "chromeos/system/fake_statistics_provider.h" |
15 #include "chromeos/system/statistics_provider.h" | 14 #include "chromeos/system/statistics_provider.h" |
| 15 #include "components/prefs/testing_pref_service.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace policy { | 18 namespace policy { |
19 | 19 |
20 class DeviceCloudPolicyInitializerTest : public testing::Test { | 20 class DeviceCloudPolicyInitializerTest : public testing::Test { |
21 protected: | 21 protected: |
22 DeviceCloudPolicyInitializerTest() | 22 DeviceCloudPolicyInitializerTest() |
23 : device_cloud_policy_initializer_( | 23 : device_cloud_policy_initializer_( |
24 &local_state_, | 24 &local_state_, |
25 nullptr, | 25 nullptr, |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 EXPECT_EQ("example.com", config.management_domain); | 131 EXPECT_EQ("example.com", config.management_domain); |
132 | 132 |
133 // If enrollment recovery is on, this is signaled in |config.mode|. | 133 // If enrollment recovery is on, this is signaled in |config.mode|. |
134 local_state_.SetBoolean(prefs::kEnrollmentRecoveryRequired, true); | 134 local_state_.SetBoolean(prefs::kEnrollmentRecoveryRequired, true); |
135 config = device_cloud_policy_initializer_.GetPrescribedEnrollmentConfig(); | 135 config = device_cloud_policy_initializer_.GetPrescribedEnrollmentConfig(); |
136 EXPECT_EQ(EnrollmentConfig::MODE_RECOVERY, config.mode); | 136 EXPECT_EQ(EnrollmentConfig::MODE_RECOVERY, config.mode); |
137 EXPECT_EQ("example.com", config.management_domain); | 137 EXPECT_EQ("example.com", config.management_domain); |
138 } | 138 } |
139 | 139 |
140 } // namespace policy | 140 } // namespace policy |
OLD | NEW |