OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_PAYMENTS_CORE_TEST_ADDRESS_NORMALIZER_H_ |
| 6 #define COMPONENTS_PAYMENTS_CORE_TEST_ADDRESS_NORMALIZER_H_ |
| 7 |
| 8 #include "components/payments/core/address_normalizer.h" |
| 9 |
| 10 #include "components/autofill/core/browser/autofill_profile.h" |
| 11 |
| 12 namespace payments { |
| 13 |
| 14 // A simpler version of the address normalizer to be used in tests. Can be set |
| 15 // to normalize instantaneously or to wait for a call. |
| 16 class TestAddressNormalizer : public AddressNormalizer { |
| 17 public: |
| 18 TestAddressNormalizer() {} |
| 19 |
| 20 void LoadRulesForRegion(const std::string& region_code) override {} |
| 21 |
| 22 bool AreRulesLoadedForRegion(const std::string& region_code) override; |
| 23 |
| 24 void StartAddressNormalization( |
| 25 const autofill::AutofillProfile& profile, |
| 26 const std::string& region_code, |
| 27 int timeout_seconds, |
| 28 AddressNormalizer::Delegate* requester) override; |
| 29 |
| 30 void OnAddressValidationRulesLoaded(const std::string& region_code, |
| 31 bool success) override {} |
| 32 |
| 33 void DelayNormalization(); |
| 34 |
| 35 void CompleteAddressNormalization(); |
| 36 |
| 37 private: |
| 38 autofill::AutofillProfile profile_; |
| 39 AddressNormalizer::Delegate* requester_; |
| 40 |
| 41 bool instantaneous_normalization_ = true; |
| 42 }; |
| 43 |
| 44 } // namespace payments |
| 45 |
| 46 #endif // COMPONENTS_PAYMENTS_CORE_TEST_ADDRESS_NORMALIZER_H_ |
OLD | NEW |