summaryrefslogtreecommitdiffstats
path: root/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/policy/asynchronous_policy_loader_unittest.cc')
-rw-r--r--chrome/browser/policy/asynchronous_policy_loader_unittest.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/policy/asynchronous_policy_loader_unittest.cc b/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
index 44ab3c2..5163f61 100644
--- a/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
+++ b/chrome/browser/policy/asynchronous_policy_loader_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/bind.h"
+#include "base/callback.h"
#include "chrome/browser/policy/asynchronous_policy_loader.h"
#include "chrome/browser/policy/asynchronous_policy_provider.h"
#include "chrome/browser/policy/asynchronous_policy_test_base.h"
@@ -14,6 +16,13 @@ using ::testing::Return;
namespace policy {
+namespace {
+
+void IgnoreCallback() {
+}
+
+} // namespace
+
class MockConfigurationPolicyObserver
: public ConfigurationPolicyProvider::Observer {
public:
@@ -29,9 +38,11 @@ class AsynchronousPolicyLoaderTest : public AsynchronousPolicyTestBase {
virtual void SetUp() {
AsynchronousPolicyTestBase::SetUp();
mock_provider_.reset(new MockConfigurationPolicyProvider());
+ ignore_callback_ = base::Bind(&IgnoreCallback);
}
protected:
+ base::Closure ignore_callback_;
scoped_ptr<MockConfigurationPolicyProvider> mock_provider_;
private:
@@ -58,7 +69,7 @@ TEST_F(AsynchronousPolicyLoaderTest, InitialLoad) {
EXPECT_CALL(*delegate_, Load()).WillOnce(Return(template_dict));
scoped_refptr<AsynchronousPolicyLoader> loader =
new AsynchronousPolicyLoader(delegate_.release(), 10);
- loader->Init();
+ loader->Init(ignore_callback_);
const DictionaryValue* loaded_dict(loader->policy());
EXPECT_TRUE(loaded_dict->Equals(template_dict));
}
@@ -73,7 +84,7 @@ TEST_F(AsynchronousPolicyLoaderTest, InitialLoadWithFallback) {
CreateSequencedTestDictionary(&dictionary_number));
scoped_refptr<AsynchronousPolicyLoader> loader =
new AsynchronousPolicyLoader(delegate_.release(), 10);
- loader->Init();
+ loader->Init(ignore_callback_);
loop_.RunAllPending();
loader->Reload();
loop_.RunAllPending();
@@ -91,7 +102,7 @@ TEST_F(AsynchronousPolicyLoaderTest, Stop) {
EXPECT_CALL(*delegate_, Load()).Times(1);
scoped_refptr<AsynchronousPolicyLoader> loader =
new AsynchronousPolicyLoader(delegate_.release(), 10);
- loader->Init();
+ loader->Init(ignore_callback_);
loop_.RunAllPending();
loader->Stop();
loop_.RunAllPending();