OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/device_local_account_external_polic
y_loader.h" | 5 #include "chrome/browser/chromeos/extensions/device_local_account_external_polic
y_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 kExtensionId, | 171 kExtensionId, |
172 extension_urls::GetWebstoreUpdateUrl().spec().c_str())); | 172 extension_urls::GetWebstoreUpdateUrl().spec().c_str())); |
173 store_.policy_map_.Set(policy::key::kExtensionInstallForcelist, | 173 store_.policy_map_.Set(policy::key::kExtensionInstallForcelist, |
174 policy::POLICY_LEVEL_MANDATORY, | 174 policy::POLICY_LEVEL_MANDATORY, |
175 policy::POLICY_SCOPE_USER, | 175 policy::POLICY_SCOPE_USER, |
176 forcelist.release(), | 176 forcelist.release(), |
177 NULL); | 177 NULL); |
178 store_.NotifyStoreLoaded(); | 178 store_.NotifyStoreLoaded(); |
179 } | 179 } |
180 | 180 |
181 #if defined(OS_CHROMEOS) | |
182 // crbug.com/422884 | |
183 #define MAYBE_CacheNotStarted DISABLED_CacheNotStarted | |
184 #else | |
185 #define MAYBE_CacheNotStarted CacheNotStarted | |
186 #endif | |
187 | |
188 // Verifies that when the cache is not explicitly started, the loader does not | 181 // Verifies that when the cache is not explicitly started, the loader does not |
189 // serve any extensions, even if the force-install list policy is set or a load | 182 // serve any extensions, even if the force-install list policy is set or a load |
190 // is manually requested. | 183 // is manually requested. |
191 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, MAYBE_CacheNotStarted) { | 184 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, CacheNotStarted) { |
192 // Set the force-install list policy. | 185 // Set the force-install list policy. |
193 SetForceInstallListPolicy(); | 186 SetForceInstallListPolicy(); |
194 | 187 |
195 // Manually request a load. | 188 // Manually request a load. |
196 loader_->StartLoading(); | 189 loader_->StartLoading(); |
197 | 190 |
198 EXPECT_FALSE(loader_->IsCacheRunning()); | 191 EXPECT_FALSE(loader_->IsCacheRunning()); |
199 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 192 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
200 } | 193 } |
201 | 194 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 loader_->StopCache(shutdown_run_loop.QuitClosure()); | 300 loader_->StopCache(shutdown_run_loop.QuitClosure()); |
308 VerifyAndResetVisitorCallExpectations(); | 301 VerifyAndResetVisitorCallExpectations(); |
309 | 302 |
310 // Spin the loop until the cache shutdown callback is invoked. Verify that at | 303 // Spin the loop until the cache shutdown callback is invoked. Verify that at |
311 // that point, no further file I/O tasks are pending. | 304 // that point, no further file I/O tasks are pending. |
312 shutdown_run_loop.Run(); | 305 shutdown_run_loop.Run(); |
313 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 306 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
314 } | 307 } |
315 | 308 |
316 } // namespace chromeos | 309 } // namespace chromeos |
OLD | NEW |