summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_client_auth_requestor_mock.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ssl/ssl_client_auth_requestor_mock.h')
-rw-r--r--chrome/browser/ssl/ssl_client_auth_requestor_mock.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/chrome/browser/ssl/ssl_client_auth_requestor_mock.h b/chrome/browser/ssl/ssl_client_auth_requestor_mock.h
new file mode 100644
index 0000000..fb487a4
--- /dev/null
+++ b/chrome/browser/ssl/ssl_client_auth_requestor_mock.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 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 CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_
+#define CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+#include "net/http/http_transaction_factory.h"
+#include "net/url_request/url_request.h"
+#include "net/url_request/url_request_context.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace net {
+class SSLCertRequestInfo;
+class X509Certificate;
+}
+
+class SSLClientAuthRequestorMock
+ : public base::RefCountedThreadSafe<SSLClientAuthRequestorMock> {
+ public:
+ SSLClientAuthRequestorMock(
+ net::URLRequest* request,
+ net::SSLCertRequestInfo* cert_request_info)
+ : cert_request_info_(cert_request_info),
+ http_network_session_(
+ request->context()->http_transaction_factory()->GetSession()) {
+ }
+ // NOTE: we need a vtable or else gmock blows up.
+ virtual ~SSLClientAuthRequestorMock() {
+ }
+
+ MOCK_METHOD1(CertificateSelected, void(net::X509Certificate* cert));
+
+ net::SSLCertRequestInfo* cert_request_info_;
+ net::HttpNetworkSession* http_network_session_;
+};
+
+#endif // CHROME_BROWSER_SSL_SSL_CLIENT_AUTH_REQUESTOR_MOCK_H_