chromium/chrome/browser/ui/views/autofill/popup/popup_view_views_browsertest.cc

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

#include "chrome/browser/ui/views/autofill/popup/popup_view_views.h"

#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/test/scoped_feature_list.h"
#include "build/buildflag.h"
#include "chrome/browser/ui/autofill/autofill_popup_view.h"
#include "chrome/browser/ui/autofill/mock_autofill_popup_controller.h"
#include "chrome/browser/ui/views/autofill/popup/popup_pixel_test.h"
#include "chrome/browser/ui/views/autofill/popup/popup_row_view.h"
#include "chrome/browser/ui/views/autofill/popup/popup_view_utils.h"
#include "chrome/browser/ui/views/autofill/popup/popup_view_views_test_api.h"
#include "components/autofill/core/browser/filling_product.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/browser/ui/suggestion_type.h"
#include "components/autofill/core/common/aliases.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/test/browser_test.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/render_text.h"

namespace autofill {

namespace {

Bool;
Combine;
Return;
CellIndex;
CellType;

// Creates the typical structure of a Autofill address profile children
// suggestions. This is not suppose to represent perfectly all the suggestions
// added to the submenu. but the goal is to be close enough.
std::vector<Suggestion> CreateTypicalAutofillProfileChildSuggestions() {}

std::vector<Suggestion> CreateAutofillProfileSuggestions() {}

std::vector<Suggestion> CreateCreditCardSuggestions() {}

std::vector<Suggestion> CreatePasswordSuggestions(bool is_deactivated = false) {}

std::vector<Suggestion> CreateWebAuthnSuggestions(bool is_deactivated = false) {}

std::vector<Suggestion> CreatePasswordAndWebAuthnSuggestions(
    bool is_deactivated = false) {}

std::vector<Suggestion> CreateAutocompleteSuggestions() {}

}  // namespace

class PopupViewViewsBrowsertestBase
    : public PopupPixelTest<PopupViewViews, MockAutofillPopupController> {};

class PopupViewViewsBrowsertest : public PopupViewViewsBrowsertestBase {};

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest, InvokeUi_Autocomplete) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest, InvokeUi_AutofillProfile) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_AutofillProfile_Selected_Profile) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_AutofillProfile_Selected_Content_WithSubpoup) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_AutofillProfile_Selected_Control_WithSubpoup) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_AutofillProfile_ChildSuggestions) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_AutofillProfile_Selected_Footer) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_AutofillProfile_MultipleLabels) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest, InvokeUi_CreditCard) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest, InvokeUi_Passwords) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_Passwords_And_WebAuthn) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_Passwords_And_WebAuthn_Deactivated) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_CreditCard_MultipleLabels) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_Passwords_PasswordField) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       InvokeUi_InsecureContext_PaymentDisabled) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       NoScrollingForNonExcessiveHeightRootPopup) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       NoScrollingForNonExcessiveHeightNonRootPopup) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       ScrollingInRootPopupStickyFooter) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       ScrollingInNonRootPopupNonStickyFooter) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest, SearchBarViewProvided) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertest,
                       SearchBarViewNoSuggestionsFound) {}

INSTANTIATE_TEST_SUITE_P();

class PopupViewViewsBrowsertestShowAutocompleteDeleteButton
    : public PopupViewViewsBrowsertestBase {};

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertestShowAutocompleteDeleteButton,
                       InvokeUi_Autocomplete) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertestShowAutocompleteDeleteButton,
                       InvokeUi_AutocompleteWith_Selected_Content) {}

IN_PROC_BROWSER_TEST_P(PopupViewViewsBrowsertestShowAutocompleteDeleteButton,
                       InvokeUi_Autofill_Profile_Selected_Profile) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace autofill