Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc

Issue 21692002: Rename AutofillDialogController to AutofillDialogViewDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
deleted file mode 100644
index 371808695f49aa46f95918544d2d93f1bbb9d5e5..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/autofill/mock_autofill_dialog_controller.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// 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 gmock.
-#include "grit/generated_resources.h"
-#include "ui/gfx/rect.h" // Only needed because gmock needs complete types.
-
-namespace autofill {
-
-MockAutofillDialogController::MockAutofillDialogController() {
- using testing::DefaultValue;
- using testing::_;
- using testing::Return;
- using testing::ReturnRef;
-
- // N.B. Setting DefaultValue in the ctor and deleting it in the dtor will
- // only work if this Mock is not used together with other mock code that
- // sets different defaults. If tests utilizing the MockController start
- // breaking because of this, use ON_CALL instead.
- DefaultValue<const DetailInputs&>::Set(default_inputs_);
- DefaultValue<string16>::Set(string16());
- DefaultValue<ValidityData>::Set(ValidityData());
- DefaultValue<DialogSignedInState>::Set(REQUIRES_RESPONSE);
- DefaultValue<gfx::Image>::Set(gfx::Image());
- DefaultValue<SuggestionState>::Set(SuggestionState(string16(),
- gfx::Font::NORMAL,
- gfx::Image(),
- string16(),
- gfx::Image()));
-
- // SECTION_CC *must* have a CREDIT_CARD_VERIFICATION_CODE field.
- const DetailInput kCreditCardInputs[] = {
- { 2, CREDIT_CARD_VERIFICATION_CODE, IDS_AUTOFILL_DIALOG_PLACEHOLDER_CVC }
- };
- cc_default_inputs_.push_back(kCreditCardInputs[0]);
- ON_CALL(*this, RequestedFieldsForSection(SECTION_CC))
- .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(_)).WillByDefault(Return(true));
- ON_CALL(*this, SectionIsActive(SECTION_CC_BILLING))
- .WillByDefault(Return(false));
-}
-
-MockAutofillDialogController::~MockAutofillDialogController() {
- using testing::DefaultValue;
-
- DefaultValue<SuggestionState>::Clear();
- DefaultValue<gfx::Image>::Clear();
- DefaultValue<DialogSignedInState>::Clear();
- DefaultValue<ValidityData>::Clear();
- DefaultValue<string16>::Clear();
- DefaultValue<const DetailInputs&>::Clear();
-}
-
-} // namespace autofill

Powered by Google App Engine
This is Rietveld 408576698