Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Unified Diff: chrome/browser/policy/asynchronous_policy_provider_unittest.cc

Issue 6091002: Refactor the windows policy provider to use AsynchronousPolicyProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows tests Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/asynchronous_policy_provider_unittest.cc
diff --git a/chrome/browser/policy/asynchronous_policy_provider_unittest.cc b/chrome/browser/policy/asynchronous_policy_provider_unittest.cc
index 64306ebcf67bce9a25c9c02f1ab3e4c37b86d189..c6aee704051652bdf9e8da49f6d4fefac0a2cfb5 100644
--- a/chrome/browser/policy/asynchronous_policy_provider_unittest.cc
+++ b/chrome/browser/policy/asynchronous_policy_provider_unittest.cc
@@ -17,6 +17,7 @@ using ::testing::Return;
namespace policy {
+// Creating the provider should provide initial policy.
TEST_F(AsynchronousPolicyTestBase, Provide) {
InSequence s;
DictionaryValue* policies = new DictionaryValue();
@@ -25,10 +26,12 @@ TEST_F(AsynchronousPolicyTestBase, Provide) {
EXPECT_CALL(*store_, Apply(policy::kPolicySyncDisabled, _)).Times(1);
AsynchronousPolicyProvider provider(
ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(),
- new AsynchronousPolicyLoader(delegate_.release()));
+ new AsynchronousPolicyLoader(delegate_.release(), 10));
provider.Provide(store_.get());
}
+
+// Trigger a refresh manually and ensure that policy gets reloaded.
TEST_F(AsynchronousPolicyTestBase, ProvideAfterRefresh) {
InSequence s;
DictionaryValue* original_policies = new DictionaryValue();
@@ -39,8 +42,8 @@ TEST_F(AsynchronousPolicyTestBase, ProvideAfterRefresh) {
policy::key::kJavascriptEnabled,
true);
EXPECT_CALL(*delegate_, Load()).WillOnce(Return(refresh_policies));
- AsynchronousPolicyLoader* loader = new AsynchronousPolicyLoader(
- delegate_.release());
+ AsynchronousPolicyLoader* loader =
+ new AsynchronousPolicyLoader(delegate_.release(), 10);
AsynchronousPolicyProvider provider(
ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(),
loader);
« no previous file with comments | « chrome/browser/policy/asynchronous_policy_loader_unittest.cc ('k') | chrome/browser/policy/configuration_policy_loader_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698