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

Unified Diff: components/autofill/content/browser/wallet/mock_wallet_client.h

Issue 18888003: Disabling wallet and mocking out more of WalletClient while testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: isherman@ review Created 7 years, 5 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
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/content/browser/wallet/mock_wallet_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/browser/wallet/mock_wallet_client.h
diff --git a/components/autofill/content/browser/wallet/mock_wallet_client.h b/components/autofill/content/browser/wallet/mock_wallet_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..477fbacd98b0439a39b662e5a80705346f4250fc
--- /dev/null
+++ b/components/autofill/content/browser/wallet/mock_wallet_client.h
@@ -0,0 +1,84 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_
+#define COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/autofill/content/browser/wallet/instrument.h"
+#include "components/autofill/content/browser/wallet/wallet_address.h"
+#include "components/autofill/content/browser/wallet/wallet_client.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace autofill {
+namespace wallet {
+
+// A mock version of WalletClient that never issues real requests, just records
+// mock calls to each entry point.
+class MockWalletClient : public WalletClient {
+ public:
+ MockWalletClient(net::URLRequestContextGetter* context,
+ WalletClientDelegate* delegate);
+ virtual ~MockWalletClient();
+
+ MOCK_METHOD1(GetWalletItems, void(const GURL& source_url));
+
+ MOCK_METHOD3(AcceptLegalDocuments,
+ void(const std::vector<WalletItems::LegalDocument*>& documents,
+ const std::string& google_transaction_id,
+ const GURL& source_url));
+
+ MOCK_METHOD3(AuthenticateInstrument,
+ void(const std::string& instrument_id,
+ const std::string& card_verification_number,
+ const std::string& obfuscated_gaia_id));
+
+ MOCK_METHOD1(GetFullWallet,
+ void(const WalletClient::FullWalletRequest& request));
+
+ MOCK_METHOD2(SaveAddress,
+ void(const Address& address, const GURL& source_url));
+
+ MOCK_METHOD3(SaveInstrument,
+ void(const Instrument& instrument,
+ const std::string& obfuscated_gaia_id,
+ const GURL& source_url));
+
+ MOCK_METHOD4(SaveInstrumentAndAddress,
+ void(const Instrument& instrument,
+ const Address& address,
+ const std::string& obfuscated_gaia_id,
+ const GURL& source_url));
+
+ MOCK_METHOD4(SendAutocheckoutStatus,
+ void(autofill::AutocheckoutStatus status,
+ const GURL& source_url,
+ const std::vector<AutocheckoutStatistic>& latency_statistics,
+ const std::string& google_transaction_id));
+
+ MOCK_METHOD2(UpdateAddress,
+ void(const Address& address, const GURL& source_url));
+
+ virtual void UpdateInstrument(
+ const WalletClient::UpdateInstrumentRequest& update_request,
+ scoped_ptr<Address> billing_address) OVERRIDE {
+ updated_billing_address_ = billing_address.Pass();
+ }
+
+ const Address* updated_billing_address() {
+ return updated_billing_address_.get();
+ }
+
+ private:
+ scoped_ptr<Address> updated_billing_address_;
+
+ DISALLOW_COPY_AND_ASSIGN(MockWalletClient);
+};
+
+} // namespace wallet
+} // namespace autofill
+
+#endif // COMPONENTS_AUTOFILL_CONTENT_BROWSER_WALLET_MOCK_WALLET_CLIENT_H_
« no previous file with comments | « components/autofill.gypi ('k') | components/autofill/content/browser/wallet/mock_wallet_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698