#include "components/autofill/core/browser/test_browser_autofill_manager.h"
#include "base/check_deref.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/browser_autofill_manager_test_api.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/browser/form_structure_test_api.h"
#include "components/autofill/core/browser/mock_single_field_form_fill_router.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
#include "components/autofill/core/browser/test_autofill_manager_waiter.h"
#include "components/autofill/core/browser/test_form_filler.h"
#include "components/autofill/core/browser/test_personal_data_manager.h"
#include "components/autofill/core/browser/ui/suggestion.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_prefs.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
TestBrowserAutofillManager::TestBrowserAutofillManager(AutofillDriver* driver)
: … { … }
TestBrowserAutofillManager::~TestBrowserAutofillManager() = default;
void TestBrowserAutofillManager::OnLanguageDetermined(
const translate::LanguageDetectionDetails& details) { … }
void TestBrowserAutofillManager::OnFormsSeen(
const std::vector<FormData>& updated_forms,
const std::vector<FormGlobalId>& removed_forms) { … }
void TestBrowserAutofillManager::OnTextFieldDidChange(
const FormData& form,
const FieldGlobalId& field_id,
const base::TimeTicks timestamp) { … }
void TestBrowserAutofillManager::OnDidFillAutofillFormData(
const FormData& form,
const base::TimeTicks timestamp) { … }
void TestBrowserAutofillManager::OnAskForValuesToFill(
const FormData& form,
const FieldGlobalId& field_id,
const gfx::Rect& caret_bounds,
AutofillSuggestionTriggerSource trigger_source) { … }
void TestBrowserAutofillManager::OnJavaScriptChangedAutofilledValue(
const FormData& form,
const FieldGlobalId& field_id,
const std::u16string& old_value,
bool formatting_only) { … }
void TestBrowserAutofillManager::OnFormSubmitted(
const FormData& form,
const bool known_success,
const mojom::SubmissionSource source) { … }
bool TestBrowserAutofillManager::IsAutofillProfileEnabled() const { … }
bool TestBrowserAutofillManager::IsAutofillPaymentMethodsEnabled() const { … }
void TestBrowserAutofillManager::UploadVotesAndLogQuality(
std::unique_ptr<FormStructure> submitted_form,
base::TimeTicks interaction_time,
base::TimeTicks submission_time,
bool observed_submission,
const ukm::SourceId source_id) { … }
void TestBrowserAutofillManager::StoreUploadVotesAndLogQualityCallback(
FormSignature form_signature,
base::OnceClosure callback) { … }
const gfx::Image& TestBrowserAutofillManager::GetCardImage(
const CreditCard& credit_card) { … }
bool TestBrowserAutofillManager::MaybeStartVoteUploadProcess(
std::unique_ptr<FormStructure> form_structure,
bool observed_submission) { … }
void TestBrowserAutofillManager::AddSeenForm(
const FormData& form,
const std::vector<FieldType>& heuristic_types,
const std::vector<FieldType>& server_types,
bool preserve_values_in_form_structure) { … }
void TestBrowserAutofillManager::AddSeenForm(
const FormData& form,
const std::vector<std::vector<std::pair<HeuristicSource, FieldType>>>&
heuristic_types,
const std::vector<FieldType>& server_types,
bool preserve_values_in_form_structure) { … }
void TestBrowserAutofillManager::AddSeenFormStructure(
std::unique_ptr<FormStructure> form_structure) { … }
void TestBrowserAutofillManager::ClearFormStructures() { … }
const std::string TestBrowserAutofillManager::GetSubmittedFormSignature() { … }
void TestBrowserAutofillManager::OnAskForValuesToFillTest(
const FormData& form,
const FieldGlobalId& field_id,
AutofillSuggestionTriggerSource trigger_source) { … }
void TestBrowserAutofillManager::SetAutofillProfileEnabled(
TestAutofillClient& client,
bool autofill_profile_enabled) { … }
void TestBrowserAutofillManager::SetAutofillPaymentMethodsEnabled(
TestAutofillClient& client,
bool autofill_payment_methods_enabled) { … }
void TestBrowserAutofillManager::SetExpectedSubmittedFieldTypes(
const std::vector<FieldTypeSet>& expected_types) { … }
void TestBrowserAutofillManager::SetExpectedObservedSubmission(bool expected) { … }
}