chromium/components/plus_addresses/affiliations/plus_address_affiliation_source_adapter_unittest.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/plus_addresses/affiliations/plus_address_affiliation_source_adapter.h"

#include <memory>

#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "components/affiliations/core/browser/mock_affiliation_service.h"
#include "components/affiliations/core/browser/mock_affiliation_source.h"
#include "components/plus_addresses/mock_plus_address_http_client.h"
#include "components/plus_addresses/plus_address_http_client.h"
#include "components/plus_addresses/plus_address_service.h"
#include "components/plus_addresses/plus_address_test_environment.h"
#include "components/plus_addresses/plus_address_test_utils.h"
#include "components/plus_addresses/plus_address_types.h"
#include "components/plus_addresses/settings/fake_plus_address_setting_service.h"
#include "components/signin/public/identity_manager/identity_test_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

namespace plus_addresses {

namespace {

FacetURI;
MockAffiliationSourceObserver;
AssertionFailure;
AssertionSuccess;
ElementsAre;
NiceMock;
UnorderedElementsAreArray;

}  // namespace

class PlusAddressAffiliationSourceAdapterTest : public testing::Test {};

// Verifies that no facets are returned when no plus addresses are registered.
TEST_F(PlusAddressAffiliationSourceAdapterTest, TestGetFacetsEmpty) {}

// Verifies that facets for plus addresses are available via GetFacets.
TEST_F(PlusAddressAffiliationSourceAdapterTest, TestGetFacets) {}

// Verifies that updates (e.g. add or remove) of valid facets are communicated
// to the affiliation source observer.
TEST_F(PlusAddressAffiliationSourceAdapterTest, OnPlusAddressesChanged) {}

// Verifies that the adapter keeps functioning if the service is destroyed.
TEST_F(PlusAddressAffiliationSourceAdapterTest,
       TestPlusAddressServiceDestroyed) {}

}  // namespace plus_addresses