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

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

Issue 2953443002: Revert of Reland: Move the files related to Android <-> Web credentials to a separate folder. (Closed)
Patch Set: Created 3 years, 6 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_affiliated_match_helper.h
diff --git a/components/password_manager/core/browser/mock_affiliated_match_helper.h b/components/password_manager/core/browser/mock_affiliated_match_helper.h
new file mode 100644
index 0000000000000000000000000000000000000000..cd843ce9dd4e2a89bef24498c9b28b2ff5e5acf3
--- /dev/null
+++ b/components/password_manager/core/browser/mock_affiliated_match_helper.h
@@ -0,0 +1,64 @@
+// 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_AFFILIATED_MATCH_HELPER_H_
+#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_MOCK_AFFILIATED_MATCH_HELPER_H_
+
+#include "base/macros.h"
+#include "components/password_manager/core/browser/affiliated_match_helper.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace autofill {
+struct PasswordForm;
+}
+
+namespace password_manager {
+
+class MockAffiliatedMatchHelper : public AffiliatedMatchHelper {
+ public:
+ MockAffiliatedMatchHelper();
+ ~MockAffiliatedMatchHelper() override;
+
+ // Expects GetAffiliatedAndroidRealms() to be called with the
+ // |expected_observed_form|, and will cause the result callback supplied to
+ // GetAffiliatedAndroidRealms() to be invoked with |results_to_return|.
+ void ExpectCallToGetAffiliatedAndroidRealms(
+ const PasswordStore::FormDigest& expected_observed_form,
+ const std::vector<std::string>& results_to_return);
+
+ // Expects GetAffiliatedWebRealms() to be called with the
+ // |expected_android_form|, and will cause the result callback supplied to
+ // GetAffiliatedWebRealms() to be invoked with |results_to_return|.
+ void ExpectCallToGetAffiliatedWebRealms(
+ const PasswordStore::FormDigest& expected_android_form,
+ const std::vector<std::string>& results_to_return);
+
+ void ExpectCallToInjectAffiliatedWebRealms(
+ const std::vector<std::string>& results_to_inject);
+
+ private:
+ MOCK_METHOD1(OnGetAffiliatedAndroidRealmsCalled,
+ std::vector<std::string>(const PasswordStore::FormDigest&));
+ MOCK_METHOD1(OnGetAffiliatedWebRealmsCalled,
+ std::vector<std::string>(const PasswordStore::FormDigest&));
+ MOCK_METHOD0(OnInjectAffiliatedWebRealmsCalled, std::vector<std::string>());
+
+ void GetAffiliatedAndroidRealms(
+ const PasswordStore::FormDigest& observed_form,
+ const AffiliatedRealmsCallback& result_callback) override;
+ void GetAffiliatedWebRealms(
+ const PasswordStore::FormDigest& android_form,
+ const AffiliatedRealmsCallback& result_callback) override;
+
+ void InjectAffiliatedWebRealms(
+ std::vector<std::unique_ptr<autofill::PasswordForm>> forms,
+ const PasswordFormsCallback& result_callback) override;
+
+ DISALLOW_COPY_AND_ASSIGN(MockAffiliatedMatchHelper);
+};
+
+} // namespace password_manager
+
+#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_MOCK_AFFILIATED_MATCH_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698