summaryrefslogtreecommitdiff
path: root/chromium/components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.cc')
-rw-r--r--chromium/components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.cc37
1 files changed, 37 insertions, 0 deletions
diff --git a/chromium/components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.cc b/chromium/components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.cc
new file mode 100644
index 00000000000..23a9c9ce2bd
--- /dev/null
+++ b/chromium/components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.cc
@@ -0,0 +1,37 @@
+// Copyright 2015 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.
+
+#include "components/password_manager/core/browser/android_affiliation/mock_affiliation_consumer.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+
+namespace password_manager {
+
+MockAffiliationConsumer::MockAffiliationConsumer() {
+ EXPECT_CALL(*this, OnResultCallback(testing::_, testing::_)).Times(0);
+}
+
+MockAffiliationConsumer::~MockAffiliationConsumer() {
+}
+
+void MockAffiliationConsumer::ExpectSuccessWithResult(
+ const AffiliatedFacets& expected_result) {
+ EXPECT_CALL(*this, OnResultCallback(
+ testing::UnorderedElementsAreArray(expected_result),
+ true)).Times(1);
+}
+
+void MockAffiliationConsumer::ExpectFailure() {
+ EXPECT_CALL(*this, OnResultCallback(testing::UnorderedElementsAre(), false))
+ .Times(1);
+}
+
+AffiliationService::ResultCallback
+MockAffiliationConsumer::GetResultCallback() {
+ return base::Bind(&MockAffiliationConsumer::OnResultCallback,
+ base::Unretained(this));
+}
+
+} // namespace password_manager