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

Side by Side Diff: components/payments/core/autofill_payment_instrument_unittest.cc

Issue 2851893002: [Payments] Record CanMakePayment metrics on Desktop. (Closed)
Patch Set: Addressed Mathp's comments Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/payments/core/autofill_payment_instrument.h" 5 #include "components/payments/core/autofill_payment_instrument.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/autofill/core/browser/autofill_profile.h" 10 #include "components/autofill/core/browser/autofill_profile.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 return &address_normalizer_; 118 return &address_normalizer_;
119 } 119 }
120 120
121 void CompleteFullCardRequest() { 121 void CompleteFullCardRequest() {
122 full_card_result_delegate_->OnFullCardRequestSucceeded( 122 full_card_result_delegate_->OnFullCardRequestSucceeded(
123 full_card_request_card_, base::ASCIIToUTF16("123")); 123 full_card_request_card_, base::ASCIIToUTF16("123"));
124 } 124 }
125 125
126 autofill::RegionDataLoader* GetRegionDataLoader() override { return nullptr; } 126 autofill::RegionDataLoader* GetRegionDataLoader() override { return nullptr; }
127 127
128 ukm::UkmService* GetUkmService() override { return nullptr; }
129
128 private: 130 private:
129 std::string locale_; 131 std::string locale_;
130 const GURL last_committed_url_; 132 const GURL last_committed_url_;
131 FakeAddressNormalizer address_normalizer_; 133 FakeAddressNormalizer address_normalizer_;
132 134
133 autofill::CreditCard full_card_request_card_; 135 autofill::CreditCard full_card_request_card_;
134 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate> 136 base::WeakPtr<autofill::payments::FullCardRequest::ResultDelegate>
135 full_card_result_delegate_; 137 full_card_result_delegate_;
136 DISALLOW_COPY_AND_ASSIGN(FakePaymentRequestDelegate); 138 DISALLOW_COPY_AND_ASSIGN(FakePaymentRequestDelegate);
137 }; 139 };
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 delegate.CompleteFullCardRequest(); 327 delegate.CompleteFullCardRequest();
326 EXPECT_FALSE(instrument_delegate.WasOnInstrumentDetailsReadyCalled()); 328 EXPECT_FALSE(instrument_delegate.WasOnInstrumentDetailsReadyCalled());
327 EXPECT_FALSE(instrument_delegate.WasOnInstrumentDetailsErrorCalled()); 329 EXPECT_FALSE(instrument_delegate.WasOnInstrumentDetailsErrorCalled());
328 330
329 delegate.GetTestAddressNormalizer()->CompleteAddressNormalization(); 331 delegate.GetTestAddressNormalizer()->CompleteAddressNormalization();
330 EXPECT_TRUE(instrument_delegate.WasOnInstrumentDetailsReadyCalled()); 332 EXPECT_TRUE(instrument_delegate.WasOnInstrumentDetailsReadyCalled());
331 EXPECT_FALSE(instrument_delegate.WasOnInstrumentDetailsErrorCalled()); 333 EXPECT_FALSE(instrument_delegate.WasOnInstrumentDetailsErrorCalled());
332 } 334 }
333 335
334 } // namespace payments 336 } // namespace payments
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698