Commit 59be2021 authored by Nela Kaczmarek's avatar Nela Kaczmarek Committed by Commit Bot

Move MockAffiliationFetcherFactory to a new file.

This change moves the implementation of MockAffiliationFetcherFactory from affiliation_service_impl_unittest.cc to mock_affiliation_fetcher_factory.h. This mock will be used in the well_known_change_password_state_unittest.cc.

Bug: 1117045
Change-Id: I4938d4ca32d9baf2837f1769a86e44e5bc2fa642
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2434745Reviewed-by: default avatarJan Wilken Dörrie <jdoerrie@chromium.org>
Commit-Queue: Nela Kaczmarek <nelakaczmarek@google.com>
Cr-Commit-Position: refs/heads/master@{#811790}
parent 9baf76b3
...@@ -498,6 +498,8 @@ static_library("test_support") { ...@@ -498,6 +498,8 @@ static_library("test_support") {
"mock_password_sync_metadata_store.h", "mock_password_sync_metadata_store.h",
"password_manager_test_utils.cc", "password_manager_test_utils.cc",
"password_manager_test_utils.h", "password_manager_test_utils.h",
"site_affiliation/mock_affiliation_fetcher_factory.cc",
"site_affiliation/mock_affiliation_fetcher_factory.h",
"stub_credentials_filter.cc", "stub_credentials_filter.cc",
"stub_credentials_filter.h", "stub_credentials_filter.h",
"stub_form_saver.cc", "stub_form_saver.cc",
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "components/password_manager/core/browser/android_affiliation/affiliation_fetcher.h" #include "components/password_manager/core/browser/android_affiliation/affiliation_fetcher.h"
#include "components/password_manager/core/browser/android_affiliation/mock_affiliation_fetcher.h" #include "components/password_manager/core/browser/android_affiliation/mock_affiliation_fetcher.h"
#include "components/password_manager/core/browser/site_affiliation/affiliation_fetcher_factory.h"
#include "components/password_manager/core/browser/site_affiliation/affiliation_service_impl.h" #include "components/password_manager/core/browser/site_affiliation/affiliation_service_impl.h"
#include "components/password_manager/core/browser/site_affiliation/mock_affiliation_fetcher_factory.h"
#include "components/sync/driver/test_sync_service.h" #include "components/sync/driver/test_sync_service.h"
#include "services/network/test/test_shared_url_loader_factory.h" #include "services/network/test/test_shared_url_loader_factory.h"
...@@ -50,19 +50,6 @@ std::vector<FacetURI> ToFacetsURIs(const std::vector<GURL>& urls) { ...@@ -50,19 +50,6 @@ std::vector<FacetURI> ToFacetsURIs(const std::vector<GURL>& urls) {
} // namespace } // namespace
class MockAffiliationFetcherFactory : public AffiliationFetcherFactory {
public:
MockAffiliationFetcherFactory() = default;
~MockAffiliationFetcherFactory() override = default;
MOCK_METHOD(
std::unique_ptr<AffiliationFetcherInterface>,
CreateInstance,
(scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
AffiliationFetcherDelegate* delegate),
(override));
};
class AffiliationServiceImplTest : public testing::Test { class AffiliationServiceImplTest : public testing::Test {
public: public:
AffiliationServiceImplTest() AffiliationServiceImplTest()
......
// Copyright 2020 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/site_affiliation/mock_affiliation_fetcher_factory.h"
namespace password_manager {
MockAffiliationFetcherFactory::MockAffiliationFetcherFactory() = default;
MockAffiliationFetcherFactory::~MockAffiliationFetcherFactory() = default;
} // namespace password_manager
// Copyright 2020 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_SITE_AFFILIATION_MOCK_AFFILIATION_FETCHER_FACTORY_H_
#define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_MOCK_AFFILIATION_FETCHER_FACTORY_H_
#include "components/password_manager/core/browser/android_affiliation/affiliation_fetcher_interface.h"
#include "components/password_manager/core/browser/site_affiliation/affiliation_fetcher_factory.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace password_manager {
class MockAffiliationFetcherFactory : public AffiliationFetcherFactory {
public:
MockAffiliationFetcherFactory();
~MockAffiliationFetcherFactory() override;
MOCK_METHOD(
std::unique_ptr<AffiliationFetcherInterface>,
CreateInstance,
(scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
AffiliationFetcherDelegate* delegate),
(override));
};
} // namespace password_manager
#endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_SITE_AFFILIATION_MOCK_AFFILIATION_FETCHER_FACTORY_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment