| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 WalletClientDelegate* delegate); | 24 WalletClientDelegate* delegate); |
| 25 virtual ~MockWalletClient(); | 25 virtual ~MockWalletClient(); |
| 26 | 26 |
| 27 MOCK_METHOD1(GetWalletItems, void(const GURL& source_url)); | 27 MOCK_METHOD1(GetWalletItems, void(const GURL& source_url)); |
| 28 | 28 |
| 29 MOCK_METHOD3(AcceptLegalDocuments, | 29 MOCK_METHOD3(AcceptLegalDocuments, |
| 30 void(const std::vector<WalletItems::LegalDocument*>& documents, | 30 void(const std::vector<WalletItems::LegalDocument*>& documents, |
| 31 const std::string& google_transaction_id, | 31 const std::string& google_transaction_id, |
| 32 const GURL& source_url)); | 32 const GURL& source_url)); |
| 33 | 33 |
| 34 MOCK_METHOD3(AuthenticateInstrument, | 34 MOCK_METHOD2(AuthenticateInstrument, |
| 35 void(const std::string& instrument_id, | 35 void(const std::string& instrument_id, |
| 36 const std::string& card_verification_number, | 36 const std::string& card_verification_number)); |
| 37 const std::string& obfuscated_gaia_id)); | |
| 38 | 37 |
| 39 MOCK_METHOD1(GetFullWallet, | 38 MOCK_METHOD1(GetFullWallet, |
| 40 void(const WalletClient::FullWalletRequest& request)); | 39 void(const WalletClient::FullWalletRequest& request)); |
| 41 | 40 |
| 42 MOCK_METHOD2(SaveAddress, | 41 // Methods with scoped_ptrs can't be mocked but by using the implementation |
| 43 void(const Address& address, const GURL& source_url)); | 42 // below the same effect can be achieved. |
| 43 virtual void SaveToWallet(scoped_ptr<wallet::Instrument> instrument, |
| 44 scoped_ptr<wallet::Address> address, |
| 45 const GURL& source_url) OVERRIDE { |
| 46 SaveToWalletMock(instrument.get(), address.get(), source_url); |
| 47 } |
| 44 | 48 |
| 45 MOCK_METHOD3(SaveInstrument, | 49 MOCK_METHOD3(SaveToWalletMock, |
| 46 void(const Instrument& instrument, | 50 void(Instrument* instrument, |
| 47 const std::string& obfuscated_gaia_id, | 51 Address* address, |
| 48 const GURL& source_url)); | |
| 49 | |
| 50 MOCK_METHOD4(SaveInstrumentAndAddress, | |
| 51 void(const Instrument& instrument, | |
| 52 const Address& address, | |
| 53 const std::string& obfuscated_gaia_id, | |
| 54 const GURL& source_url)); | 52 const GURL& source_url)); |
| 55 | 53 |
| 56 MOCK_METHOD4(SendAutocheckoutStatus, | 54 MOCK_METHOD4(SendAutocheckoutStatus, |
| 57 void(autofill::AutocheckoutStatus status, | 55 void(autofill::AutocheckoutStatus status, |
| 58 const GURL& source_url, | 56 const GURL& source_url, |
| 59 const std::vector<AutocheckoutStatistic>& latency_statistics, | 57 const std::vector<AutocheckoutStatistic>& latency_statistics, |
| 60 const std::string& google_transaction_id)); | 58 const std::string& google_transaction_id)); |
| 61 | 59 |
| 62 MOCK_METHOD2(UpdateAddress, | |
| 63 void(const Address& address, const GURL& source_url)); | |
| 64 | |
| 65 virtual void UpdateInstrument( | |
| 66 const WalletClient::UpdateInstrumentRequest& update_request, | |
| 67 scoped_ptr<Address> billing_address) OVERRIDE { | |
| 68 updated_billing_address_ = billing_address.Pass(); | |
| 69 } | |
| 70 | |
| 71 const Address* updated_billing_address() { | |
| 72 return updated_billing_address_.get(); | |
| 73 } | |
| 74 | |
| 75 private: | 60 private: |
| 76 scoped_ptr<Address> updated_billing_address_; | |
| 77 | |
| 78 DISALLOW_COPY_AND_ASSIGN(MockWalletClient); | 61 DISALLOW_COPY_AND_ASSIGN(MockWalletClient); |
| 79 }; | 62 }; |
| 80 | 63 |
| 81 } // namespace wallet | 64 } // namespace wallet |
| 82 } // namespace autofill | 65 } // namespace autofill |
| 83 | 66 |
| 84 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_ | 67 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_ |
| OLD | NEW |