OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_TEST_WALLET_CLIENT_H_ | |
6 #define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_TEST_WALLET_CLIENT_H_ | |
7 | |
8 #include "components/autofill/content/browser/wallet/instrument.h" | |
9 #include "components/autofill/content/browser/wallet/wallet_client.h" | |
10 #include "testing/gmock/include/gmock/gmock.h" | |
11 | |
12 namespace autofill { | |
13 namespace wallet { | |
14 | |
15 class TestWalletClient : public WalletClient { | |
Ilya Sherman
2013/07/11 01:06:30
nit: This class should probably be named "MockWall
Ilya Sherman
2013/07/11 01:06:30
nit: Might be nice to document this class, includi
Dan Beam
2013/07/11 01:29:36
Done.
Dan Beam
2013/07/11 01:29:36
Done.
| |
16 public: | |
17 TestWalletClient(net::URLRequestContextGetter* context, | |
18 WalletClientDelegate* delegate); | |
19 virtual ~TestWalletClient(); | |
20 | |
21 MOCK_METHOD1(GetWalletItems, void(const GURL& source_url)); | |
22 | |
23 MOCK_METHOD3(AcceptLegalDocuments, | |
24 void(const std::vector<WalletItems::LegalDocument*>& documents, | |
25 const std::string& google_transaction_id, | |
26 const GURL& source_url)); | |
27 | |
28 MOCK_METHOD3(AuthenticateInstrument, | |
29 void(const std::string& instrument_id, | |
30 const std::string& card_verification_number, | |
31 const std::string& obfuscated_gaia_id)); | |
32 | |
33 MOCK_METHOD1(GetFullWallet, | |
34 void(const WalletClient::FullWalletRequest& request)); | |
35 | |
36 MOCK_METHOD2(SaveAddress, | |
37 void(const Address& address, const GURL& source_url)); | |
38 | |
39 MOCK_METHOD3(SaveInstrument, | |
40 void(const Instrument& instrument, | |
41 const std::string& obfuscated_gaia_id, | |
42 const GURL& source_url)); | |
43 | |
44 MOCK_METHOD4(SaveInstrumentAndAddress, | |
45 void(const Instrument& instrument, | |
46 const Address& address, | |
47 const std::string& obfuscated_gaia_id, | |
48 const GURL& source_url)); | |
49 | |
50 MOCK_METHOD4(SendAutocheckoutStatus, | |
51 void(autofill::AutocheckoutStatus status, | |
52 const GURL& source_url, | |
53 const std::vector<AutocheckoutStatistic>& latency_statistics, | |
54 const std::string& google_transaction_id)); | |
55 | |
56 MOCK_METHOD2(UpdateAddress, | |
57 void(const Address& address, const GURL& source_url)); | |
58 | |
59 virtual void UpdateInstrument( | |
60 const WalletClient::UpdateInstrumentRequest& update_request, | |
61 scoped_ptr<Address> billing_address) { | |
Ilya Sherman
2013/07/11 01:06:30
nit: OVERRIDE
Dan Beam
2013/07/11 01:29:36
Done.
| |
62 updated_billing_address_ = billing_address.Pass(); | |
63 } | |
64 | |
65 const Address* updated_billing_address() { | |
66 return updated_billing_address_.get(); | |
67 } | |
68 | |
69 private: | |
70 scoped_ptr<Address> updated_billing_address_; | |
71 | |
72 DISALLOW_COPY_AND_ASSIGN(TestWalletClient); | |
73 }; | |
74 | |
75 } // namespace wallet | |
76 } // namespace autofill | |
77 | |
78 #endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_TEST_WALLET_CLIENT_H_ | |
OLD | NEW |