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.
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
10 #include "chrome/browser/ui/autofill/autofill_dialog_types.h"
11 #include "components/autofill/core/browser/dialog_section.h"
12 #include "components/autofill/core/browser/field_types.h"
13 #include "ui/gfx/geometry/size.h"
21 class AutofillDialogView
;
23 // Functionality that helps to test an AutofillDialogView.
24 class AutofillDialogViewTester
{
26 // Gets a AutofillDialogViewTester for |view|.
27 static scoped_ptr
<AutofillDialogViewTester
> For(AutofillDialogView
* view
);
29 virtual ~AutofillDialogViewTester() {}
31 // Simulates the user pressing 'Submit' to accept the dialog.
32 virtual void SubmitForTesting() = 0;
34 // Simulates the user pressing 'Cancel' to abort the dialog.
35 virtual void CancelForTesting() = 0;
37 // Returns the actual contents of the input of |type|.
38 virtual base::string16
GetTextContentsOfInput(ServerFieldType type
) = 0;
40 // Sets the actual contents of the input of |type|.
41 virtual void SetTextContentsOfInput(ServerFieldType type
,
42 const base::string16
& contents
) = 0;
44 // Sets the content of the extra field for a section.
45 virtual void SetTextContentsOfSuggestionInput(DialogSection section
,
46 const base::string16
& text
) = 0;
48 // Simulates a user activation of the input of |type|.
49 virtual void ActivateInput(ServerFieldType type
) = 0;
51 // Get the size of the entire view.
52 virtual gfx::Size
GetSize() const = 0;
54 // Get the web contents used to sign in to Google.
55 virtual content::WebContents
* GetSignInWebContents() = 0;
57 // Whether the overlay is visible.
58 virtual bool IsShowingOverlay() const = 0;
60 // Whether |section| is currently showing.
61 virtual bool IsShowingSection(DialogSection section
) const = 0;
64 } // namespace autofill
66 #endif // CHROME_BROWSER_UI_AUTOFILL_AUTOFILL_DIALOG_VIEW_TESTER_H_