Index: chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc |
diff --git a/chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc b/chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc |
index f1295673d8998b8f2271070cd959a9406e584fcb..a1736c8a3ca3d27c2ed507eb82abc0a59ee3393b 100644 |
--- a/chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc |
+++ b/chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc |
@@ -3,15 +3,18 @@ |
// found in the LICENSE file. |
#include "chrome/browser/ui/autofill/mock_autofill_dialog_controller.h" |
+#include "content/public/browser/native_web_keyboard_event.h" // For gtest. |
Ilya Sherman
2013/07/16 21:21:56
I'm confused... you're not using gtest in this fil
groby-ooo-7-16
2013/07/16 23:05:07
Done.
|
#include "grit/generated_resources.h" |
#include "testing/gmock/include/gmock/gmock.h" |
Ilya Sherman
2013/07/16 21:21:56
nit: Already included in the header.
groby-ooo-7-16
2013/07/16 23:05:07
Done.
|
+#include "ui/gfx/rect.h" // Only needed because gtest needs complete types. |
Ilya Sherman
2013/07/16 21:21:56
Ditto
groby-ooo-7-16
2013/07/16 23:05:07
Done.
|
namespace autofill { |
+using namespace testing; |
Ilya Sherman
2013/07/16 21:21:56
nit: "using namespace" is disallowed by the style
groby-ooo-7-16
2013/07/16 23:05:07
Done. TMYK.
|
+ |
MockAutofillDialogController::MockAutofillDialogController() { |
- testing::DefaultValue<const DetailInputs&>::Set(default_inputs_); |
- testing::DefaultValue<ui::ComboboxModel*>::Set(NULL); |
- testing::DefaultValue<ValidityData>::Set(ValidityData()); |
+ DefaultValue<const DetailInputs&>::Set(default_inputs_); |
+ DefaultValue<DialogSignedInState>::Set(REQUIRES_RESPONSE); |
// SECTION_CC *must* have a CREDIT_CARD_VERIFICATION_CODE field. |
const DetailInput kCreditCardInputs[] = { |
@@ -19,176 +22,22 @@ MockAutofillDialogController::MockAutofillDialogController() { |
}; |
cc_default_inputs_.push_back(kCreditCardInputs[0]); |
ON_CALL(*this, RequestedFieldsForSection(SECTION_CC)) |
- .WillByDefault(testing::ReturnRef(cc_default_inputs_)); |
+ .WillByDefault(ReturnRef(cc_default_inputs_)); |
+ |
+ ON_CALL(*this, GetDialogButtons()) |
+ .WillByDefault(Return(ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL)); |
+ ON_CALL(*this, LegalDocumentLinks()).WillByDefault(ReturnRef(range_)); |
// Activate all sections but CC_BILLING - default for the real |
// controller implementation, too. |
- ON_CALL(*this, SectionIsActive(testing::_)) |
- .WillByDefault(testing::Return(true)); |
+ ON_CALL(*this, SectionIsActive(_)).WillByDefault(Return(true)); |
ON_CALL(*this, SectionIsActive(SECTION_CC_BILLING)) |
- .WillByDefault(testing::Return(false)); |
+ .WillByDefault(Return(false)); |
} |
MockAutofillDialogController::~MockAutofillDialogController() { |
- testing::DefaultValue<ValidityData>::Clear(); |
- testing::DefaultValue<ui::ComboboxModel*>::Clear(); |
- testing::DefaultValue<const DetailInputs&>::Clear(); |
-} |
- |
-string16 MockAutofillDialogController::DialogTitle() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::AccountChooserText() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::SignInLinkText() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::EditSuggestionText() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::CancelButtonText() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::ConfirmButtonText() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::SaveLocallyText() const { |
- return string16(); |
-} |
- |
-string16 MockAutofillDialogController::LegalDocumentsText() { |
- return string16(); |
-} |
- |
-DialogSignedInState MockAutofillDialogController::SignedInState() const { |
- return REQUIRES_RESPONSE; |
-} |
- |
-bool MockAutofillDialogController::ShouldShowSpinner() const { |
- return false; |
-} |
- |
-bool MockAutofillDialogController::ShouldOfferToSaveInChrome() const { |
- return false; |
-} |
- |
-gfx::Image MockAutofillDialogController::AccountChooserImage() { |
- return gfx::Image(); |
-} |
- |
-bool MockAutofillDialogController::ShouldShowDetailArea() const { |
- return false; |
-} |
- |
-bool MockAutofillDialogController::ShouldShowProgressBar() const { |
- return false; |
-} |
- |
-int MockAutofillDialogController::GetDialogButtons() const { |
- return ui::DIALOG_BUTTON_OK | ui::DIALOG_BUTTON_CANCEL; |
-} |
- |
-bool MockAutofillDialogController::IsDialogButtonEnabled( |
- ui::DialogButton button) const { |
- return false; |
-} |
- |
-DialogOverlayState MockAutofillDialogController::GetDialogOverlay() const { |
- return DialogOverlayState(); |
-} |
- |
-const std::vector<ui::Range>& |
- MockAutofillDialogController::LegalDocumentLinks() { |
- return range_; |
-} |
- |
-string16 MockAutofillDialogController::LabelForSection( |
- DialogSection section) const { |
- return string16(); |
-} |
- |
-SuggestionState MockAutofillDialogController::SuggestionStateForSection( |
- DialogSection section) { |
- return SuggestionState(string16(), |
- gfx::Font::NORMAL, |
- gfx::Image(), |
- string16(), |
- gfx::Image()); |
-} |
- |
-void MockAutofillDialogController::EditClickedForSection( |
- DialogSection section) {} |
- |
-void MockAutofillDialogController::EditCancelledForSection( |
- DialogSection section) {} |
- |
-gfx::Image MockAutofillDialogController::IconForField( |
- AutofillFieldType type, const string16& user_input) const { |
- return gfx::Image(); |
-} |
- |
-string16 MockAutofillDialogController::InputValidityMessage( |
- DialogSection section, |
- AutofillFieldType type, |
- const string16& value) { |
- return string16(); |
-} |
- |
-void MockAutofillDialogController::UserEditedOrActivatedInput( |
- DialogSection section, |
- const DetailInput* input, |
- gfx::NativeView parent_view, |
- const gfx::Rect& content_bounds, |
- const string16& field_contents, |
- bool was_edit) {} |
- |
-bool MockAutofillDialogController::HandleKeyPressEventInInput( |
- const content::NativeWebKeyboardEvent& event) { |
- return false; |
-} |
- |
-void MockAutofillDialogController::FocusMoved() {} |
- |
-gfx::Image MockAutofillDialogController::SplashPageImage() const { |
- return gfx::Image(); |
-} |
- |
-void MockAutofillDialogController::ViewClosed() {} |
- |
-std::vector<DialogNotification> MockAutofillDialogController:: |
- CurrentNotifications() { |
- return std::vector<DialogNotification>(); |
-} |
- |
-std::vector<DialogAutocheckoutStep> MockAutofillDialogController:: |
- CurrentAutocheckoutSteps() const { |
- return std::vector<DialogAutocheckoutStep>(); |
-} |
- |
-void MockAutofillDialogController::SignInLinkClicked() {} |
- |
-void MockAutofillDialogController::NotificationCheckboxStateChanged( |
- DialogNotification::Type type, |
- bool checked) {} |
- |
-void MockAutofillDialogController::LegalDocumentLinkClicked( |
- const ui::Range& range) {} |
- |
-void MockAutofillDialogController::OverlayButtonPressed() {} |
- |
-void MockAutofillDialogController::OnCancel() {} |
- |
-void MockAutofillDialogController::OnAccept() {} |
- |
-content::WebContents* MockAutofillDialogController::web_contents() { |
- return NULL; |
+ DefaultValue<DialogSignedInState>::Clear(); |
+ DefaultValue<const DetailInputs&>::Clear(); |
} |
} // namespace autofill |