| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // 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_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_ | |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/strings/string16.h" | |
| 11 #include "chrome/browser/ui/autofill/autofill_dialog_types.h" | |
| 12 #include "components/autofill/core/browser/dialog_section.h" | |
| 13 #include "components/autofill/core/browser/field_types.h" | |
| 14 #include "ui/gfx/geometry/size.h" | |
| 15 | |
| 16 namespace content { | |
| 17 class WebContents; | |
| 18 } | |
| 19 | |
| 20 namespace autofill { | |
| 21 | |
| 22 class AutofillDialogView; | |
| 23 | |
| 24 // Functionality that helps to test an AutofillDialogView. | |
| 25 class AutofillDialogViewTester { | |
| 26 public: | |
| 27 // Gets a AutofillDialogViewTester for |view|. | |
| 28 static std::unique_ptr<AutofillDialogViewTester> For( | |
| 29 AutofillDialogView* view); | |
| 30 | |
| 31 virtual ~AutofillDialogViewTester() {} | |
| 32 | |
| 33 // Simulates the user pressing 'Submit' to accept the dialog. | |
| 34 virtual void SubmitForTesting() = 0; | |
| 35 | |
| 36 // Simulates the user pressing 'Cancel' to abort the dialog. | |
| 37 virtual void CancelForTesting() = 0; | |
| 38 | |
| 39 // Returns the actual contents of the input of |type|. | |
| 40 virtual base::string16 GetTextContentsOfInput(ServerFieldType type) = 0; | |
| 41 | |
| 42 // Sets the actual contents of the input of |type|. | |
| 43 virtual void SetTextContentsOfInput(ServerFieldType type, | |
| 44 const base::string16& contents) = 0; | |
| 45 | |
| 46 // Sets the content of the extra field for a section. | |
| 47 virtual void SetTextContentsOfSuggestionInput(DialogSection section, | |
| 48 const base::string16& text) = 0; | |
| 49 | |
| 50 // Simulates a user activation of the input of |type|. | |
| 51 virtual void ActivateInput(ServerFieldType type) = 0; | |
| 52 | |
| 53 // Get the size of the entire view. | |
| 54 virtual gfx::Size GetSize() const = 0; | |
| 55 | |
| 56 // Whether |section| is currently showing. | |
| 57 virtual bool IsShowingSection(DialogSection section) const = 0; | |
| 58 }; | |
| 59 | |
| 60 } // namespace autofill | |
| 61 | |
| 62 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_ | |
| OLD | NEW |