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

Unified Diff: components/cronet/android/test/ssl_certificate_error_job.h

Issue 1239543003: [Cronet] Surface SSL cert error through CronetURLRequestAdapter::OnSSLCertificateError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a test Created 5 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
Index: components/cronet/android/test/ssl_certificate_error_job.h
diff --git a/components/cronet/android/test/ssl_certificate_error_job.h b/components/cronet/android/test/ssl_certificate_error_job.h
new file mode 100644
index 0000000000000000000000000000000000000000..1662c16f7e0389d909d46fc2547c6a5dfc3f2a85
--- /dev/null
+++ b/components/cronet/android/test/ssl_certificate_error_job.h
@@ -0,0 +1,42 @@
+// Copyright 2015 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_CRONET_ANDROID_TEST_SSL_CERTIFICATE_ERROR_JOB_H_
+#define COMPONENTS_CRONET_ANDROID_TEST_SSL_CERTIFICATE_ERROR_JOB_H_
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "net/url_request/url_request_test_job.h"
+#include "url/gurl.h"
+
+namespace cronet {
+
+// SSLCertificateErrorJob simulates a net::ERR_CERT_DATE_INVALID error.
+class SSLCertificateErrorJob : public net::URLRequestTestJob {
mmenke 2015/07/17 19:29:59 Suggest putting this in net/test/url_request, to m
xunjieli 2015/07/17 20:15:21 Done. My initial concern was the use case of this
mmenke 2015/07/17 21:09:18 There are a bunch of browser tests that need to ge
xunjieli 2015/07/20 14:56:20 Acknowledged. I see! Makes sense. Good to know. Th
+ public:
+ SSLCertificateErrorJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate);
+
+ // net::URLRequestTestJob implementation:
+ void Start() override;
+
+ // Adds the testing URLs to the URLRequestFilter.
+ static void AddUrlHandler();
+
+ static GURL GetMockUrl();
+
+ protected:
+ ~SSLCertificateErrorJob() override;
mmenke 2015/07/17 19:29:59 Can make this private, since there are no subclass
xunjieli 2015/07/17 20:15:21 Done.
+
+ private:
+ void NotifyError();
+
+ base::WeakPtrFactory<SSLCertificateErrorJob> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(SSLCertificateErrorJob);
+};
+
+} // namespace cronet
+
+#endif // COMPONENTS_CRONET_ANDROID_TEST_SSL_CERTIFICATE_ERROR_JOB_H_

Powered by Google App Engine
This is Rietveld 408576698