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

Unified Diff: net/test/url_request/url_request_mock_data_job.h

Issue 1459993003: [Cronet] Continue UrlRequest with NULL certificate if Client cert is requested. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use UrlRequestMockDataJob for testing. Created 5 years, 1 month 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
Index: net/test/url_request/url_request_mock_data_job.h
diff --git a/net/test/url_request/url_request_mock_data_job.h b/net/test/url_request/url_request_mock_data_job.h
index 14ad665369f641bccc99544ab409810eb59f9868..e1a13c036e31349c64bb85968d7f46aaf470df52 100644
--- a/net/test/url_request/url_request_mock_data_job.h
+++ b/net/test/url_request/url_request_mock_data_job.h
@@ -21,12 +21,15 @@ class URLRequestMockDataJob : public URLRequestJob {
URLRequestMockDataJob(URLRequest* request,
NetworkDelegate* network_delegate,
const std::string& data,
- int data_repeat_count);
+ int data_repeat_count,
+ bool request_client_certificate);
void Start() override;
int ReadRawData(IOBuffer* buf, int buf_size) override;
int GetResponseCode() const override;
void GetResponseInfo(HttpResponseInfo* info) override;
+ void ContinueWithCertificate(X509Certificate* client_cert,
+ SSLPrivateKey* client_private_key) override;
// Adds the testing URLs to the URLRequestFilter.
static void AddUrlHandler();
@@ -38,6 +41,9 @@ class URLRequestMockDataJob : public URLRequestJob {
static GURL GetMockHttpUrl(const std::string& data, int repeat_count);
static GURL GetMockHttpsUrl(const std::string& data, int repeat_count);
+ // Constructs Mock URL which will request client certificate.
xunjieli 2015/11/20 21:04:25 Maybe mention that the response body is the word "
mef 2015/11/20 22:01:23 Done.
+ static GURL GetMockUrlForClientCertificateRequest();
+
// URLRequestFailedJob must be added as a handler for |hostname| for
// the returned URL to return |net_error|.
static GURL GetMockHttpUrlForHostname(const std::string& hostname,
@@ -55,6 +61,7 @@ class URLRequestMockDataJob : public URLRequestJob {
std::string data_;
size_t data_offset_;
+ bool request_client_certificate_;
base::WeakPtrFactory<URLRequestMockDataJob> weak_factory_;
};

Powered by Google App Engine
This is Rietveld 408576698