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

Unified Diff: components/payments/content/payment_response_helper_unittest.cc

Issue 2832003003: Revert of [Payments] Normalize Shipping Address sent to merchant on Desktop. (Closed)
Patch Set: Created 3 years, 8 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: components/payments/content/payment_response_helper_unittest.cc
diff --git a/components/payments/content/payment_response_helper_unittest.cc b/components/payments/content/payment_response_helper_unittest.cc
index 7c94919ec37ab78cc34f6e3b670c337fdb7f6786..ed9757c551825cfb04a5c2f4d5eca236824d3811 100644
--- a/components/payments/content/payment_response_helper_unittest.cc
+++ b/components/payments/content/payment_response_helper_unittest.cc
@@ -23,25 +23,6 @@
namespace payments {
-class FakeAddressNormalizer : public AddressNormalizer {
- public:
- FakeAddressNormalizer() : AddressNormalizer(nullptr, nullptr) {}
-
- void LoadRulesForRegion(const std::string& region_code) override {}
-
- bool AreRulesLoadedForRegion(const std::string& region_code) override {
- return true;
- }
-
- void StartAddressNormalization(
- const autofill::AutofillProfile& profile,
- const std::string& region_code,
- int timeout_seconds,
- AddressNormalizer::Delegate* requester) override {
- requester->OnAddressNormalized(profile);
- }
-};
-
class FakePaymentRequestDelegate : public PaymentRequestDelegate {
public:
FakePaymentRequestDelegate(
@@ -77,7 +58,7 @@
base::ASCIIToUTF16("123"));
}
- std::unique_ptr<::i18n::addressinput::Source> GetAddressInputSource()
+ std::unique_ptr<const ::i18n::addressinput::Source> GetAddressInputSource()
override {
return nullptr;
}
@@ -85,17 +66,12 @@
std::unique_ptr<::i18n::addressinput::Storage> GetAddressInputStorage()
override {
return nullptr;
- }
-
- AddressNormalizer* GetAddressNormalizer() override {
- return &address_normalizer_;
}
private:
autofill::PersonalDataManager* personal_data_manager_;
std::string locale_;
const GURL last_committed_url_;
- FakeAddressNormalizer address_normalizer_;
DISALLOW_COPY_AND_ASSIGN(FakePaymentRequestDelegate);
};
@@ -164,9 +140,6 @@
const mojom::PaymentResponsePtr& response() { return payment_response_; }
autofill::AutofillProfile* test_address() { return &address_; }
PaymentInstrument* test_instrument() { return autofill_instrument_.get(); }
- PaymentRequestDelegate* test_payment_request_delegate() {
- return &payment_request_delegate_;
- }
private:
std::unique_ptr<PaymentRequestSpec> spec_;
@@ -189,8 +162,7 @@
// "visa" is specified directly in the supportedMethods so it is returned
// as the method name.
PaymentResponseHelper helper("en-US", spec(), test_instrument(),
- test_payment_request_delegate(), test_address(),
- test_address(), this);
+ test_address(), test_address(), this);
EXPECT_EQ("visa", response()->method_name);
EXPECT_EQ(
"{\"billingAddress\":"
@@ -226,8 +198,7 @@
// TODO(mathp): Currently synchronous, when async will need a RunLoop.
// "basic-card" is specified so it is returned as the method name.
PaymentResponseHelper helper("en-US", spec(), test_instrument(),
- test_payment_request_delegate(), test_address(),
- test_address(), this);
+ test_address(), test_address(), this);
EXPECT_EQ("basic-card", response()->method_name);
EXPECT_EQ(
"{\"billingAddress\":"
@@ -264,8 +235,7 @@
GetMethodDataForVisa());
PaymentResponseHelper helper("en-US", spec(), test_instrument(),
- test_payment_request_delegate(), test_address(),
- test_address(), this);
+ test_address(), test_address(), this);
// Check that all the expected values were set.
EXPECT_EQ("US", response()->shipping_address->country);
@@ -293,8 +263,7 @@
RecreateSpecWithOptions(std::move(options));
PaymentResponseHelper helper("en-US", spec(), test_instrument(),
- test_payment_request_delegate(), test_address(),
- test_address(), this);
+ test_address(), test_address(), this);
// Check that all the expected values were set.
EXPECT_EQ("John H. Doe", response()->payer_name.value());
@@ -311,8 +280,7 @@
RecreateSpecWithOptions(std::move(options));
PaymentResponseHelper helper("en-US", spec(), test_instrument(),
- test_payment_request_delegate(), test_address(),
- test_address(), this);
+ test_address(), test_address(), this);
// Check that the name was set, but not the other values.
EXPECT_EQ("John H. Doe", response()->payer_name.value());
@@ -332,8 +300,7 @@
RecreateSpecWithOptions(std::move(options));
PaymentResponseHelper helper("en-US", spec(), test_instrument(),
- test_payment_request_delegate(), test_address(),
- test_address(), this);
+ test_address(), test_address(), this);
// Check that the phone was formatted.
EXPECT_EQ("+15151231234", response()->payer_phone.value());
« no previous file with comments | « components/payments/content/payment_response_helper.cc ('k') | components/payments/core/address_normalizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698