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

Unified Diff: chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc

Issue 1780443002: Cleanup: roll AutofillCCInfoBarDelegate into AutofillSaveCardInfoBarDelegateMobile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pay_mac_bubble_default
Patch Set: Make overriden methods public. Created 4 years, 9 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/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate_unittest.cc b/chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
similarity index 75%
rename from chrome/browser/autofill/autofill_cc_infobar_delegate_unittest.cc
rename to chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
index 73f33b62a323bf26a419c2541deecbc0cec561ef..dc8d076640fb997365a30ba38181cb906093093b 100644
--- a/chrome/browser/autofill/autofill_cc_infobar_delegate_unittest.cc
+++ b/chrome/browser/autofill/autofill_save_card_infobar_delegate_mobile_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "components/autofill/core/browser/autofill_cc_infobar_delegate.h"
+#include "components/autofill/core/browser/autofill_save_card_infobar_delegate_mobile.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -13,6 +13,7 @@
#include "chrome/test/base/testing_profile.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/personal_data_manager.h"
+#include "components/infobars/core/confirm_infobar_delegate.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -42,10 +43,11 @@ class TestPersonalDataManager : public PersonalDataManager {
} // namespace
-class AutofillCCInfobarDelegateTest : public ChromeRenderViewHostTestHarness {
+class AutofillSaveCardInfoBarDelegateMobileTest
+ : public ChromeRenderViewHostTestHarness {
public:
- AutofillCCInfobarDelegateTest();
- ~AutofillCCInfobarDelegateTest() override;
+ AutofillSaveCardInfoBarDelegateMobileTest();
+ ~AutofillSaveCardInfoBarDelegateMobileTest() override;
void SetUp() override;
void TearDown() override;
@@ -56,20 +58,18 @@ class AutofillCCInfobarDelegateTest : public ChromeRenderViewHostTestHarness {
scoped_ptr<TestPersonalDataManager> personal_data_;
private:
- DISALLOW_COPY_AND_ASSIGN(AutofillCCInfobarDelegateTest);
+ DISALLOW_COPY_AND_ASSIGN(AutofillSaveCardInfoBarDelegateMobileTest);
};
-AutofillCCInfobarDelegateTest::AutofillCCInfobarDelegateTest() {
-}
+AutofillSaveCardInfoBarDelegateMobileTest::
+ AutofillSaveCardInfoBarDelegateMobileTest() {}
-AutofillCCInfobarDelegateTest::~AutofillCCInfobarDelegateTest() {}
+AutofillSaveCardInfoBarDelegateMobileTest::
+ ~AutofillSaveCardInfoBarDelegateMobileTest() {}
-void AutofillCCInfobarDelegateTest::SetUp() {
+void AutofillSaveCardInfoBarDelegateMobileTest::SetUp() {
ChromeRenderViewHostTestHarness::SetUp();
- // Ensure Mac OS X does not pop up a modal dialog for the Address Book.
- test::DisableSystemServices(profile()->GetPrefs());
-
PersonalDataManagerFactory::GetInstance()->SetTestingFactory(profile(), NULL);
ChromeAutofillClient::CreateForWebContents(web_contents());
@@ -81,26 +81,29 @@ void AutofillCCInfobarDelegateTest::SetUp() {
personal_data_->SetPrefService(profile()->GetPrefs());
}
-void AutofillCCInfobarDelegateTest::TearDown() {
+void AutofillSaveCardInfoBarDelegateMobileTest::TearDown() {
personal_data_.reset();
ChromeRenderViewHostTestHarness::TearDown();
}
scoped_ptr<ConfirmInfoBarDelegate>
-AutofillCCInfobarDelegateTest::CreateDelegate() {
+AutofillSaveCardInfoBarDelegateMobileTest::CreateDelegate() {
base::HistogramTester histogram_tester;
CreditCard credit_card;
- scoped_ptr<ConfirmInfoBarDelegate> delegate(AutofillCCInfoBarDelegate::Create(
- base::Bind(
- base::IgnoreResult(&TestPersonalDataManager::SaveImportedCreditCard),
- base::Unretained(personal_data_.get()), credit_card)));
+ scoped_ptr<base::DictionaryValue> legal_message;
+ scoped_ptr<ConfirmInfoBarDelegate> delegate(
+ new AutofillSaveCardInfoBarDelegateMobile(
+ false, credit_card, std::move(legal_message),
+ base::Bind(base::IgnoreResult(
+ &TestPersonalDataManager::SaveImportedCreditCard),
+ base::Unretained(personal_data_.get()), credit_card)));
histogram_tester.ExpectUniqueSample("Autofill.CreditCardInfoBar",
AutofillMetrics::INFOBAR_SHOWN, 1);
return delegate;
}
// Test that credit card infobar metrics are logged correctly.
-TEST_F(AutofillCCInfobarDelegateTest, Metrics) {
+TEST_F(AutofillSaveCardInfoBarDelegateMobileTest, Metrics) {
::testing::InSequence dummy;
// Accept the infobar.
« no previous file with comments | « chrome/browser/autofill/autofill_cc_infobar_delegate_unittest.cc ('k') | chrome/browser/ui/autofill/chrome_autofill_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698