blob: 84d24e0a1cb269178067c8c8426c198d9ccd7895 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2015 The Chromium Authors
bondd10a45b92015-02-04 23:29:402// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_UITEST_UTIL_H_
6#define CHROME_BROWSER_AUTOFILL_AUTOFILL_UITEST_UTIL_H_
7
8#include <vector>
9
Jan Keitelcce9e842023-08-11 10:32:0410#include "ui/gfx/geometry/rect_f.h"
11
Ian Struiksma606b1b52020-11-18 18:08:3612class Profile;
bondd10a45b92015-02-04 23:29:4013
14namespace autofill {
15
Christoph Schwering6853e972021-07-02 08:27:2216class AutofillExternalDelegate;
bondd10a45b92015-02-04 23:29:4017class AutofillProfile;
sebsge35b762c2018-03-29 20:33:2718class CreditCard;
bondd10a45b92015-02-04 23:29:4019
Ian Struiksma606b1b52020-11-18 18:08:3620void AddTestProfile(Profile* base_profile, const AutofillProfile& profile);
21void SetTestProfile(Profile* base_profile, const AutofillProfile& profile);
22void SetTestProfiles(Profile* base_profile,
23 std::vector<AutofillProfile>* profiles);
24void AddTestCreditCard(Profile* base_profile, const CreditCard& card);
25void AddTestServerCreditCard(Profile* base_profile, const CreditCard& card);
26void AddTestAutofillData(Profile* base_profile,
Yiming Zhou03261c82018-06-19 19:18:5427 const AutofillProfile& profile,
28 const CreditCard& card);
Ian Struiksma606b1b52020-11-18 18:08:3629void WaitForPersonalDataChange(Profile* base_profile);
Dominic Battreb5b59a52021-01-14 12:11:0730void WaitForPersonalDataManagerToBeLoaded(Profile* base_profile);
siyua748ce382019-02-11 22:18:2431
Jan Keitelcce9e842023-08-11 10:32:0432// Displays an Autofill popup with a dummy suggestion for an element at
33// `element_bounds`.
34// Unlike `autofill::test::GenerateTestAutofillPopup()`, this function triggers
Christoph Schwering6853e972021-07-02 08:27:2235// the popup through the `autofill_external_delegate->GetAutofillDriver()`'s
Jan Keitelcce9e842023-08-11 10:32:0436// `AskForValuesToFill()`, instead of the `autofill_external_delegate`'s
37// `OnQuery()` event. This initializes the form's meta data and prepares
Christoph Schwering6853e972021-07-02 08:27:2238// ContentAutofillDriver's and ContentAutofillRouter's state to process events
Jan Keitelcce9e842023-08-11 10:32:0439// such as `AutofillDriver::PopupHidden()` triggered by the popup.
Christoph Schwering6853e972021-07-02 08:27:2240void GenerateTestAutofillPopup(
Jan Keitelcce9e842023-08-11 10:32:0441 AutofillExternalDelegate* autofill_external_delegate,
42 gfx::RectF element_bounds = gfx::RectF(100.0f, 100.0f));
Christoph Schwering6853e972021-07-02 08:27:2243
bondd10a45b92015-02-04 23:29:4044} // namespace autofill
45
46#endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_UITEST_UTIL_H_