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

Unified Diff: components/password_manager/core/browser/mock_affiliation_consumer.h

Issue 868253005: AffiliationBackend: Implement the better part of on-demand fetching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tidy up NULL time related issues. Created 5 years, 11 months 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: components/password_manager/core/browser/mock_affiliation_consumer.h
diff --git a/components/password_manager/core/browser/mock_affiliation_consumer.h b/components/password_manager/core/browser/mock_affiliation_consumer.h
new file mode 100644
index 0000000000000000000000000000000000000000..146e299521873e7dba917876bbec05861eba7d40
--- /dev/null
+++ b/components/password_manager/core/browser/mock_affiliation_consumer.h
@@ -0,0 +1,39 @@
+// 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.
+
+#ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_MOCK_AFFILIATION_CONSUMER_H_
+#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_MOCK_AFFILIATION_CONSUMER_H_
+
+#include "base/macros.h"
+#include "components/password_manager/core/browser/affiliation_service.h"
+#include "components/password_manager/core/browser/affiliation_utils.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace password_manager {
+
+// A mock consumer of AffiliationService::GetAffiliations().
+class MockAffiliationConsumer {
+ public:
+ MockAffiliationConsumer();
+ ~MockAffiliationConsumer();
+
+ // Expects that the result callback will be called exactly once and that it
+ // will indicate success and return |expected_result|.
+ void ExpectSuccessWithResult(const AffiliatedFacets& expected_result);
+
+ // Expects that the result callback will be called exactly once and that it
+ // will indicate a failed lookup.
+ void ExpectFailure();
+
+ AffiliationService::ResultCallback GetResultCallback();
+
+ private:
+ MOCK_METHOD2(OnResultCallback, void(const AffiliatedFacets&, bool));
+
+ DISALLOW_COPY_AND_ASSIGN(MockAffiliationConsumer);
+};
+
+} // namespace password_manager
+
+#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_MOCK_AFFILIATION_CONSUMER_H_

Powered by Google App Engine
This is Rietveld 408576698