| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 void DeviceLocalAccountExternalPolicyLoaderTest::SetForceInstallListPolicy() { | 177 void DeviceLocalAccountExternalPolicyLoaderTest::SetForceInstallListPolicy() { |
| 178 scoped_ptr<base::ListValue> forcelist(new base::ListValue); | 178 scoped_ptr<base::ListValue> forcelist(new base::ListValue); |
| 179 forcelist->AppendString("invalid"); | 179 forcelist->AppendString("invalid"); |
| 180 forcelist->AppendString(base::StringPrintf( | 180 forcelist->AppendString(base::StringPrintf( |
| 181 "%s;%s", | 181 "%s;%s", |
| 182 kExtensionId, | 182 kExtensionId, |
| 183 extension_urls::GetWebstoreUpdateUrl().spec().c_str())); | 183 extension_urls::GetWebstoreUpdateUrl().spec().c_str())); |
| 184 store_.policy_map_.Set(policy::key::kExtensionInstallForcelist, | 184 store_.policy_map_.Set(policy::key::kExtensionInstallForcelist, |
| 185 policy::POLICY_LEVEL_MANDATORY, | 185 policy::POLICY_LEVEL_MANDATORY, |
| 186 policy::POLICY_SCOPE_USER, | 186 policy::POLICY_SCOPE_USER, |
| 187 policy::POLICY_SOURCE_CLOUD, | |
| 188 forcelist.release(), | 187 forcelist.release(), |
| 189 NULL); | 188 NULL); |
| 190 store_.NotifyStoreLoaded(); | 189 store_.NotifyStoreLoaded(); |
| 191 } | 190 } |
| 192 | 191 |
| 193 // Verifies that when the cache is not explicitly started, the loader does not | 192 // Verifies that when the cache is not explicitly started, the loader does not |
| 194 // 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 |
| 195 // is manually requested. | 194 // is manually requested. |
| 196 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, CacheNotStarted) { | 195 TEST_F(DeviceLocalAccountExternalPolicyLoaderTest, CacheNotStarted) { |
| 197 // Set the force-install list policy. | 196 // Set the force-install list policy. |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 loader_->StopCache(shutdown_run_loop.QuitClosure()); | 312 loader_->StopCache(shutdown_run_loop.QuitClosure()); |
| 314 VerifyAndResetVisitorCallExpectations(); | 313 VerifyAndResetVisitorCallExpectations(); |
| 315 | 314 |
| 316 // 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 |
| 317 // that point, no further file I/O tasks are pending. | 316 // that point, no further file I/O tasks are pending. |
| 318 shutdown_run_loop.Run(); | 317 shutdown_run_loop.Run(); |
| 319 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); | 318 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTesting()); |
| 320 } | 319 } |
| 321 | 320 |
| 322 } // namespace chromeos | 321 } // namespace chromeos |
| OLD | NEW |