OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/file_util.h" | |
5 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
6 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
7 #include "chrome/browser/browser_thread.h" | 8 #include "chrome/browser/browser_thread.h" |
8 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
9 #include "chrome/browser/policy/configuration_policy_pref_store.h" | 10 #include "chrome/browser/policy/configuration_policy_pref_store.h" |
11 #include "chrome/browser/policy/device_management_policy_cache.h" | |
10 #include "chrome/browser/policy/device_management_policy_provider.h" | 12 #include "chrome/browser/policy/device_management_policy_provider.h" |
11 #include "chrome/browser/policy/mock_configuration_policy_store.h" | 13 #include "chrome/browser/policy/mock_configuration_policy_store.h" |
12 #include "chrome/browser/policy/mock_device_management_backend.h" | 14 #include "chrome/browser/policy/mock_device_management_backend.h" |
15 #include "chrome/browser/policy/proto/device_management_local.pb.h" | |
Mattias Nissler (ping if slow)
2010/11/26 10:37:45
What do you need this header for?
Jakob Kummerow
2010/11/26 11:07:42
Done.
(Leftover from the earlier ugly workaround m
| |
13 #include "chrome/common/net/gaia/gaia_constants.h" | 16 #include "chrome/common/net/gaia/gaia_constants.h" |
14 #include "chrome/common/notification_service.h" | 17 #include "chrome/common/notification_service.h" |
15 #include "chrome/common/policy_constants.h" | 18 #include "chrome/common/policy_constants.h" |
16 #include "chrome/test/mock_notification_observer.h" | 19 #include "chrome/test/mock_notification_observer.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
18 | 21 |
19 const char kTestToken[] = "device_policy_provider_test_auth_token"; | 22 const char kTestToken[] = "device_policy_provider_test_auth_token"; |
20 | 23 |
21 namespace policy { | 24 namespace policy { |
22 | 25 |
23 using ::testing::_; | 26 using ::testing::_; |
24 using ::testing::InSequence; | 27 using ::testing::InSequence; |
25 using ::testing::Mock; | 28 using ::testing::Mock; |
26 | 29 |
27 class DeviceManagementPolicyProviderTest : public testing::Test { | 30 class DeviceManagementPolicyProviderTest : public testing::Test { |
28 public: | 31 public: |
29 DeviceManagementPolicyProviderTest() | 32 DeviceManagementPolicyProviderTest() |
30 : ui_thread_(BrowserThread::UI, &loop_), | 33 : ui_thread_(BrowserThread::UI, &loop_), |
31 file_thread_(BrowserThread::FILE, &loop_) {} | 34 file_thread_(BrowserThread::FILE, &loop_) {} |
32 | 35 |
33 virtual ~DeviceManagementPolicyProviderTest() {} | 36 virtual ~DeviceManagementPolicyProviderTest() {} |
34 | 37 |
35 virtual void SetUp() { | 38 virtual void SetUp() { |
36 EXPECT_TRUE(storage_dir_.CreateUniqueTempDir()); | 39 EXPECT_TRUE(storage_dir_.CreateUniqueTempDir()); |
37 CreateNewBackend(); | 40 device_management_dir_ = |
41 DeviceManagementPolicyProvider::GetOrCreateDeviceManagementDir( | |
42 storage_dir_.path()); | |
38 CreateNewProvider(); | 43 CreateNewProvider(); |
39 } | 44 EXPECT_TRUE(provider_->WaitingForInitialPolicies()); |
40 | 45 loop_.RunAllPending(); |
41 void CreateNewBackend() { | |
42 backend_ = new MockDeviceManagementBackend; | |
43 } | 46 } |
44 | 47 |
45 void CreateNewProvider() { | 48 void CreateNewProvider() { |
49 backend_ = new MockDeviceManagementBackend; | |
46 token_service_.reset(new TokenService); | 50 token_service_.reset(new TokenService); |
47 provider_.reset(new DeviceManagementPolicyProvider( | 51 provider_.reset(new DeviceManagementPolicyProvider( |
48 ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), | 52 ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), |
49 backend_, | 53 backend_, |
50 token_service_.get(), | 54 token_service_.get(), |
51 storage_dir_.path())); | 55 storage_dir_.path())); |
52 loop_.RunAllPending(); | 56 } |
57 | |
58 void CreateNewProvider(int64 policy_refresh_rate_ms, | |
59 int64 policy_refresh_max_earlier_ms, | |
60 int64 policy_refresh_error_delay_ms, | |
61 int64 token_fetch_error_delay_ms, | |
62 int64 unmanaged_device_refresh_rate_ms) { | |
63 backend_ = new MockDeviceManagementBackend; | |
64 token_service_.reset(new TokenService); | |
65 provider_.reset(new DeviceManagementPolicyProvider( | |
66 ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), | |
67 backend_, | |
68 token_service_.get(), | |
69 storage_dir_.path(), | |
70 policy_refresh_rate_ms, | |
71 policy_refresh_max_earlier_ms, | |
72 policy_refresh_error_delay_ms, | |
73 token_fetch_error_delay_ms, | |
74 unmanaged_device_refresh_rate_ms)); | |
53 } | 75 } |
54 | 76 |
55 void SimulateSuccessfulLoginAndRunPending() { | 77 void SimulateSuccessfulLoginAndRunPending() { |
56 loop_.RunAllPending(); | 78 loop_.RunAllPending(); |
57 token_service_->IssueAuthTokenForTest( | 79 token_service_->IssueAuthTokenForTest( |
58 GaiaConstants::kDeviceManagementService, kTestToken); | 80 GaiaConstants::kDeviceManagementService, kTestToken); |
59 loop_.RunAllPending(); | 81 loop_.RunAllPending(); |
60 } | 82 } |
61 | 83 |
62 void SimulateSuccessfulInitialPolicyFetch() { | 84 void SimulateSuccessfulInitialPolicyFetch() { |
63 MockConfigurationPolicyStore store; | 85 MockConfigurationPolicyStore store; |
64 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | 86 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( |
65 MockDeviceManagementBackendSucceedRegister()); | 87 MockDeviceManagementBackendSucceedRegister()); |
66 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 88 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
67 MockDeviceManagementBackendSucceedBooleanPolicy( | 89 MockDeviceManagementBackendSucceedBooleanPolicy( |
68 key::kDisableSpdy, true)); | 90 key::kDisableSpdy, true)); |
69 SimulateSuccessfulLoginAndRunPending(); | 91 SimulateSuccessfulLoginAndRunPending(); |
92 EXPECT_FALSE(provider_->WaitingForInitialPolicies()); | |
70 EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(1); | 93 EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(1); |
71 provider_->Provide(&store); | 94 provider_->Provide(&store); |
72 ASSERT_EQ(1U, store.policy_map().size()); | 95 ASSERT_EQ(1U, store.policy_map().size()); |
73 Mock::VerifyAndClearExpectations(backend_); | 96 Mock::VerifyAndClearExpectations(backend_); |
74 Mock::VerifyAndClearExpectations(&store); | 97 Mock::VerifyAndClearExpectations(&store); |
75 } | 98 } |
76 | 99 |
77 virtual void TearDown() { | 100 virtual void TearDown() { |
78 loop_.RunAllPending(); | 101 loop_.RunAllPending(); |
79 } | 102 } |
80 | 103 |
81 MockDeviceManagementBackend* backend_; // weak | 104 MockDeviceManagementBackend* backend_; // weak |
82 scoped_ptr<DeviceManagementPolicyProvider> provider_; | 105 scoped_ptr<DeviceManagementPolicyProvider> provider_; |
83 | 106 |
84 protected: | 107 protected: |
85 void SetRefreshDelays(DeviceManagementPolicyProvider* provider, | 108 DeviceManagementPolicyCache* cache(DeviceManagementPolicyProvider* provider) { |
86 int64 policy_refresh_rate_ms, | 109 return provider->cache_.get(); |
87 int64 policy_refresh_max_earlier_ms, | |
88 int64 policy_refresh_error_delay_ms, | |
89 int64 token_fetch_error_delay_ms) { | |
90 provider->set_policy_refresh_rate_ms(policy_refresh_rate_ms); | |
91 provider->set_policy_refresh_max_earlier_ms(policy_refresh_max_earlier_ms); | |
92 provider->set_policy_refresh_error_delay_ms(policy_refresh_error_delay_ms); | |
93 provider->set_token_fetch_error_delay_ms(token_fetch_error_delay_ms); | |
94 } | 110 } |
95 | 111 |
112 MessageLoop loop_; | |
113 ScopedTempDir storage_dir_; | |
114 FilePath device_management_dir_; | |
115 | |
96 private: | 116 private: |
97 MessageLoop loop_; | |
98 BrowserThread ui_thread_; | 117 BrowserThread ui_thread_; |
99 BrowserThread file_thread_; | 118 BrowserThread file_thread_; |
100 ScopedTempDir storage_dir_; | |
101 scoped_ptr<TokenService> token_service_; | 119 scoped_ptr<TokenService> token_service_; |
102 | 120 |
103 DISALLOW_COPY_AND_ASSIGN(DeviceManagementPolicyProviderTest); | 121 DISALLOW_COPY_AND_ASSIGN(DeviceManagementPolicyProviderTest); |
104 }; | 122 }; |
105 | 123 |
106 // If there's no login and no previously-fetched policy, the provider should | 124 // If there's no login and no previously-fetched policy, the provider should |
107 // provide an empty policy. | 125 // provide an empty policy. |
108 TEST_F(DeviceManagementPolicyProviderTest, InitialProvideNoLogin) { | 126 TEST_F(DeviceManagementPolicyProviderTest, InitialProvideNoLogin) { |
109 MockConfigurationPolicyStore store; | 127 MockConfigurationPolicyStore store; |
110 EXPECT_CALL(store, Apply(_, _)).Times(0); | 128 EXPECT_CALL(store, Apply(_, _)).Times(0); |
111 provider_->Provide(&store); | 129 provider_->Provide(&store); |
112 EXPECT_TRUE(store.policy_map().empty()); | 130 EXPECT_TRUE(store.policy_map().empty()); |
131 EXPECT_TRUE(provider_->WaitingForInitialPolicies()); | |
113 } | 132 } |
114 | 133 |
115 // If the login is successful and there's no previously-fetched policy, the | 134 // If the login is successful and there's no previously-fetched policy, the |
116 // policy should be fetched from the server and should be available the first | 135 // policy should be fetched from the server and should be available the first |
117 // time the Provide method is called. | 136 // time the Provide method is called. |
118 TEST_F(DeviceManagementPolicyProviderTest, InitialProvideWithLogin) { | 137 TEST_F(DeviceManagementPolicyProviderTest, InitialProvideWithLogin) { |
138 EXPECT_TRUE(provider_->WaitingForInitialPolicies()); | |
119 SimulateSuccessfulInitialPolicyFetch(); | 139 SimulateSuccessfulInitialPolicyFetch(); |
120 } | 140 } |
121 | 141 |
122 // If the login succeed but the device management backend is unreachable, | 142 // If the login succeed but the device management backend is unreachable, |
123 // there should be no policy provided if there's no previously-fetched policy, | 143 // there should be no policy provided if there's no previously-fetched policy, |
124 TEST_F(DeviceManagementPolicyProviderTest, EmptyProvideWithFailedBackend) { | 144 TEST_F(DeviceManagementPolicyProviderTest, EmptyProvideWithFailedBackend) { |
125 MockConfigurationPolicyStore store; | 145 MockConfigurationPolicyStore store; |
126 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | 146 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( |
127 MockDeviceManagementBackendFailRegister( | 147 MockDeviceManagementBackendFailRegister( |
128 DeviceManagementBackend::kErrorRequestFailed)); | 148 DeviceManagementBackend::kErrorRequestFailed)); |
129 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).Times(0); | 149 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).Times(0); |
130 SimulateSuccessfulLoginAndRunPending(); | 150 SimulateSuccessfulLoginAndRunPending(); |
131 EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(0); | 151 EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(0); |
132 provider_->Provide(&store); | 152 provider_->Provide(&store); |
133 EXPECT_TRUE(store.policy_map().empty()); | 153 EXPECT_TRUE(store.policy_map().empty()); |
134 } | 154 } |
135 | 155 |
136 // If a policy has been fetched previously, if should be available even before | 156 // If a policy has been fetched previously, if should be available even before |
137 // the login succeeds or the device management backend is available. | 157 // the login succeeds or the device management backend is available. |
138 TEST_F(DeviceManagementPolicyProviderTest, SecondProvide) { | 158 TEST_F(DeviceManagementPolicyProviderTest, SecondProvide) { |
139 // Pre-fetch and persist a policy | 159 // Pre-fetch and persist a policy |
140 SimulateSuccessfulInitialPolicyFetch(); | 160 SimulateSuccessfulInitialPolicyFetch(); |
141 | 161 |
142 // Simulate a app relaunch by constructing a new provider. Policy should be | 162 // Simulate a app relaunch by constructing a new provider. Policy should be |
143 // refreshed (since that might be the purpose of the app relaunch). | 163 // refreshed (since that might be the purpose of the app relaunch). |
144 CreateNewBackend(); | 164 CreateNewProvider(); |
145 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 165 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
146 MockDeviceManagementBackendSucceedBooleanPolicy( | 166 MockDeviceManagementBackendSucceedBooleanPolicy( |
147 key::kDisableSpdy, true)); | 167 key::kDisableSpdy, true)); |
148 CreateNewProvider(); | 168 loop_.RunAllPending(); |
149 Mock::VerifyAndClearExpectations(backend_); | 169 Mock::VerifyAndClearExpectations(backend_); |
150 | 170 |
151 // Simulate another app relaunch, this time against a failing backend. | 171 // Simulate another app relaunch, this time against a failing backend. |
152 // Cached policy should still be available. | 172 // Cached policy should still be available. |
153 CreateNewBackend(); | |
154 MockConfigurationPolicyStore store; | 173 MockConfigurationPolicyStore store; |
174 CreateNewProvider(); | |
155 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 175 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
156 MockDeviceManagementBackendFailPolicy( | 176 MockDeviceManagementBackendFailPolicy( |
157 DeviceManagementBackend::kErrorRequestFailed)); | 177 DeviceManagementBackend::kErrorRequestFailed)); |
158 CreateNewProvider(); | 178 loop_.RunAllPending(); |
159 SimulateSuccessfulLoginAndRunPending(); | 179 SimulateSuccessfulLoginAndRunPending(); |
160 EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(1); | 180 EXPECT_CALL(store, Apply(kPolicyDisableSpdy, _)).Times(1); |
161 provider_->Provide(&store); | 181 provider_->Provide(&store); |
162 ASSERT_EQ(1U, store.policy_map().size()); | 182 ASSERT_EQ(1U, store.policy_map().size()); |
163 } | 183 } |
164 | 184 |
165 // When policy is successfully fetched from the device management server, it | 185 // When policy is successfully fetched from the device management server, it |
166 // should force a policy refresh. | 186 // should force a policy refresh. |
167 TEST_F(DeviceManagementPolicyProviderTest, FetchTriggersRefresh) { | 187 TEST_F(DeviceManagementPolicyProviderTest, FetchTriggersRefresh) { |
168 MockNotificationObserver observer; | 188 MockNotificationObserver observer; |
169 NotificationRegistrar registrar; | 189 NotificationRegistrar registrar; |
170 registrar.Add(&observer, | 190 registrar.Add(&observer, |
171 NotificationType::POLICY_CHANGED, | 191 NotificationType::POLICY_CHANGED, |
172 NotificationService::AllSources()); | 192 NotificationService::AllSources()); |
173 EXPECT_CALL(observer, Observe(_, _, _)).Times(1); | 193 EXPECT_CALL(observer, Observe(_, _, _)).Times(1); |
174 SimulateSuccessfulInitialPolicyFetch(); | 194 SimulateSuccessfulInitialPolicyFetch(); |
175 } | 195 } |
176 | 196 |
177 TEST_F(DeviceManagementPolicyProviderTest, ErrorCausesNewRequest) { | 197 TEST_F(DeviceManagementPolicyProviderTest, ErrorCausesNewRequest) { |
178 InSequence s; | 198 InSequence s; |
179 SetRefreshDelays(provider_.get(), 1000 * 1000, 0, 0, 0); | 199 CreateNewProvider(1000 * 1000, 0, 0, 0, 0); |
180 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | 200 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( |
181 MockDeviceManagementBackendFailRegister( | 201 MockDeviceManagementBackendFailRegister( |
182 DeviceManagementBackend::kErrorRequestFailed)); | 202 DeviceManagementBackend::kErrorRequestFailed)); |
183 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | 203 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( |
184 MockDeviceManagementBackendSucceedRegister()); | 204 MockDeviceManagementBackendSucceedRegister()); |
185 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 205 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
186 MockDeviceManagementBackendFailPolicy( | 206 MockDeviceManagementBackendFailPolicy( |
187 DeviceManagementBackend::kErrorRequestFailed)); | 207 DeviceManagementBackend::kErrorRequestFailed)); |
188 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 208 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
189 MockDeviceManagementBackendFailPolicy( | 209 MockDeviceManagementBackendFailPolicy( |
190 DeviceManagementBackend::kErrorRequestFailed)); | 210 DeviceManagementBackend::kErrorRequestFailed)); |
191 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 211 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
192 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); | 212 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); |
193 SimulateSuccessfulLoginAndRunPending(); | 213 SimulateSuccessfulLoginAndRunPending(); |
194 } | 214 } |
195 | 215 |
196 TEST_F(DeviceManagementPolicyProviderTest, RefreshPolicies) { | 216 TEST_F(DeviceManagementPolicyProviderTest, RefreshPolicies) { |
197 InSequence s; | 217 InSequence s; |
198 SetRefreshDelays(provider_.get(), 0, 0, 1000 * 1000, 1000); | 218 CreateNewProvider(0, 0, 1000 * 1000, 1000, 0); |
199 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | 219 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( |
200 MockDeviceManagementBackendSucceedRegister()); | 220 MockDeviceManagementBackendSucceedRegister()); |
201 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 221 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
202 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); | 222 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); |
203 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 223 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
204 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); | 224 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); |
205 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 225 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
206 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); | 226 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); |
207 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | 227 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( |
208 MockDeviceManagementBackendFailPolicy( | 228 MockDeviceManagementBackendFailPolicy( |
209 DeviceManagementBackend::kErrorRequestFailed)); | 229 DeviceManagementBackend::kErrorRequestFailed)); |
210 SimulateSuccessfulLoginAndRunPending(); | 230 SimulateSuccessfulLoginAndRunPending(); |
211 } | 231 } |
212 | 232 |
233 // This test tests three things (see numbered comments below): | |
234 TEST_F(DeviceManagementPolicyProviderTest, UnmanagedDevice) { | |
235 InSequence s; | |
236 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | |
237 MockDeviceManagementBackendFailRegister( | |
238 DeviceManagementBackend::kErrorServiceManagementNotSupported)); | |
239 SimulateSuccessfulLoginAndRunPending(); | |
240 // (1) The provider's DMPolicyCache should know that the device is not | |
241 // managed. | |
242 EXPECT_TRUE(cache(provider_.get())->is_device_unmanaged()); | |
243 // (2) On restart, the provider should detect that this is not the first | |
244 // login. | |
245 CreateNewProvider(1000*1000, 0, 0, 0, 0); | |
246 EXPECT_FALSE(provider_->WaitingForInitialPolicies()); | |
247 EXPECT_CALL(*backend_, ProcessRegisterRequest(_, _, _, _)).WillOnce( | |
248 MockDeviceManagementBackendSucceedRegister()); | |
249 EXPECT_CALL(*backend_, ProcessPolicyRequest(_, _, _, _)).WillOnce( | |
250 MockDeviceManagementBackendSucceedBooleanPolicy(key::kDisableSpdy, true)); | |
251 SimulateSuccessfulLoginAndRunPending(); | |
252 // (3) Since the backend call this time returned a device id, the "unmanaged" | |
253 // marker should have been deleted. | |
254 EXPECT_FALSE(cache(provider_.get())->is_device_unmanaged()); | |
255 } | |
256 | |
213 } // namespace policy | 257 } // namespace policy |
OLD | NEW |