diff options
author | simo@google.com <simo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 16:47:25 +0000 |
---|---|---|
committer | simo@google.com <simo@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-12 16:47:25 +0000 |
commit | 5e61ad9e375347ef4eebac900a5af6572ae2d995 (patch) | |
tree | 30538db94977ced3ba18871e1adecfd9bfe92ed5 /chrome/browser/policy/asynchronous_policy_provider_unittest.cc | |
parent | 6f949cb309ddc3b4ad055101e2e752ed6a8ac39b (diff) | |
download | chromium_src-5e61ad9e375347ef4eebac900a5af6572ae2d995.zip chromium_src-5e61ad9e375347ef4eebac900a5af6572ae2d995.tar.gz chromium_src-5e61ad9e375347ef4eebac900a5af6572ae2d995.tar.bz2 |
ConfigurationPolicyProvider refactoring:
Provide() now fills a PolicyMap with policy values instead of calling Apply on the pref store.
BUG=
TEST=
Review URL: http://codereview.chromium.org/7850016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy/asynchronous_policy_provider_unittest.cc')
-rw-r--r-- | chrome/browser/policy/asynchronous_policy_provider_unittest.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/policy/asynchronous_policy_provider_unittest.cc b/chrome/browser/policy/asynchronous_policy_provider_unittest.cc index 9d186b8..c078bf0 100644 --- a/chrome/browser/policy/asynchronous_policy_provider_unittest.cc +++ b/chrome/browser/policy/asynchronous_policy_provider_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,7 +6,6 @@ #include "chrome/browser/policy/asynchronous_policy_provider.h" #include "chrome/browser/policy/asynchronous_policy_test_base.h" #include "chrome/browser/policy/configuration_policy_pref_store.h" -#include "chrome/browser/policy/mock_configuration_policy_store.h" #include "policy/policy_constants.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -23,11 +22,13 @@ TEST_F(AsynchronousPolicyTestBase, Provide) { DictionaryValue* policies = new DictionaryValue(); policies->SetBoolean(policy::key::kSyncDisabled, true); EXPECT_CALL(*delegate_, Load()).WillOnce(Return(policies)); - EXPECT_CALL(*store_, Apply(policy::kPolicySyncDisabled, _)).Times(1); AsynchronousPolicyProvider provider( ConfigurationPolicyPrefStore::GetChromePolicyDefinitionList(), new AsynchronousPolicyLoader(delegate_.release(), 10)); - provider.Provide(store_.get()); + PolicyMap policy_map; + provider.Provide(&policy_map); + EXPECT_TRUE(policy_map.Get(policy::kPolicySyncDisabled)); + EXPECT_EQ(1U, policy_map.size()); } @@ -49,9 +50,10 @@ TEST_F(AsynchronousPolicyTestBase, ProvideAfterRefresh) { loader); loop_.RunAllPending(); loader->Reload(); - loop_.RunAllPending(); - EXPECT_CALL(*store_, Apply(policy::kPolicyJavascriptEnabled, _)).Times(1); - provider.Provide(store_.get()); + PolicyMap policy_map; + provider.Provide(&policy_map); + EXPECT_TRUE(policy_map.Get(policy::kPolicySyncDisabled)); + EXPECT_EQ(1U, policy_map.size()); } } // namespace policy |