| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // serve any extensions, even if the force-install list policy is set or a load | 193 // serve any extensions, even if the force-install list policy is set or a load |
| 194 // is manually requested. | 194 // is manually requested. |
| 195 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, CacheNotStarted) { | 195 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, CacheNotStarted) { |
| 196 // Set the force-install list policy. | 196 // Set the force-install list policy. |
| 197 SetForceInstallListPolicy(); | 197 SetForceInstallListPolicy(); |
| 198 | 198 |
| 199 // Manually request a load. | 199 // Manually request a load. |
| 200 loader_->StartLoading(); | 200 loader_->StartLoading(); |
| 201 | 201 |
| 202 EXPECT_FALSE(loader_->IsCacheRunning()); | 202 EXPECT_FALSE(loader_->IsCacheRunning()); |
| 203 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
| 203 } | 204 } |
| 204 | 205 |
| 205 // Verifies that the cache can be started and stopped correctly. | 206 // Verifies that the cache can be started and stopped correctly. |
| 206 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, ForceInstallListEmpty) { | 207 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, ForceInstallListEmpty) { |
| 207 // Set an empty force-install list policy. | 208 // Set an empty force-install list policy. |
| 208 store_.NotifyStoreLoaded(); | 209 store_.NotifyStoreLoaded(); |
| 209 | 210 |
| 210 // Start the cache. Verify that the loader announces an empty extension list. | 211 // Start the cache. Verify that the loader announces an empty extension list. |
| 211 EXPECT_CALL(visitor_, OnExternalProviderReady(provider_.get())) | 212 EXPECT_CALL(visitor_, OnExternalProviderReady(provider_.get())) |
| 212 .Times(1); | 213 .Times(1); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 loader_->StopCache(shutdown_run_loop.QuitClosure()); | 312 loader_->StopCache(shutdown_run_loop.QuitClosure()); |
| 312 VerifyAndResetVisitorCallExpectations(); | 313 VerifyAndResetVisitorCallExpectations(); |
| 313 | 314 |
| 314 // Spin the loop until the cache shutdown callback is invoked. Verify that at | 315 // Spin the loop until the cache shutdown callback is invoked. Verify that at |
| 315 // that point, no further file I/O tasks are pending. | 316 // that point, no further file I/O tasks are pending. |
| 316 shutdown_run_loop.Run(); | 317 shutdown_run_loop.Run(); |
| 317 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 318 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
| 318 } | 319 } |
| 319 | 320 |
| 320 } // namespace chromeos | 321 } // namespace chromeos |
| OLD | NEW |