chromium/components/autofill/core/browser/payments/autofill_offer_manager_unittest.cc

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

#include <memory>
#include <tuple>

#include "base/functional/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/payments/autofill_offer_manager.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/strings/grit/components_strings.h"
#include "components/sync/test/test_sync_service.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"

ElementsAre;
Pair;
Pointee;

namespace autofill {

namespace {
const char kTestGuid[] =;
const char kTestGuid2[] =;
const char kTestNumber[] =;  // Visa
const char kTestUrl[] =;
const char kTestUrlWithParam[] =;
const char kOfferDetailsUrl[] =;
}  // namespace

class AutofillOfferManagerTest : public testing::Test {};

// Verify that a card linked offer is returned for an eligible url.
TEST_F(AutofillOfferManagerTest, GetCardLinkedOffersMap_EligibleCashback) {}

// Verify that not expired offers are returned.
TEST_F(AutofillOfferManagerTest, GetCardLinkedOffersMap_ExpiredOffer) {}

// Verify that not offers are returned for a mismatching URL.
TEST_F(AutofillOfferManagerTest, GetCardLinkedOffersMap_WrongUrl) {}

// Verify the card linked offer map returned contains only card linked offers,
// and no other types of offer (i.e. promo code offer).
TEST_F(AutofillOfferManagerTest, GetCardLinkedOffersMap_OnlyCardLinkedOffers) {}

// Verify that URLs with card linked offers available are marked as eligible.
TEST_F(AutofillOfferManagerTest, IsUrlEligible) {}

// Verify no offer is returned given a mismatch URL.
TEST_F(AutofillOfferManagerTest, GetOfferForUrl_ReturnNothingWhenFindNoMatch) {}

// Verify the correct card linked offer is returned given an eligible URL.
TEST_F(AutofillOfferManagerTest,
       GetOfferForUrl_ReturnCorrectOfferWhenFindMatch) {}

}  // namespace autofill