Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / net / test / url_request / ssl_certificate_error_job.h
blobb3b372e8b004c9cf0e4b4054db3e1dd7b359c9ed
1 // Copyright 2015 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.
5 #ifndef NET_TEST_URL_REQUEST_SSL_CERTIFICATE_ERROR_JOB_H_
6 #define NET_TEST_URL_REQUEST_SSL_CERTIFICATE_ERROR_JOB_H_
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "net/url_request/url_request_job.h"
11 #include "url/gurl.h"
13 namespace net {
15 class NetworkDelegate;
16 class URLRequest;
18 // SSLCertificateErrorJob simulates a ERR_CERT_DATE_INVALID error.
19 class SSLCertificateErrorJob : public URLRequestJob {
20 public:
21 SSLCertificateErrorJob(URLRequest* request,
22 NetworkDelegate* network_delegate);
24 // URLRequestJob implementation:
25 void Start() override;
27 // Adds the testing URLs to the URLRequestFilter.
28 static void AddUrlHandler();
30 static GURL GetMockUrl();
32 private:
33 ~SSLCertificateErrorJob() override;
35 void NotifyError();
37 base::WeakPtrFactory<SSLCertificateErrorJob> weak_factory_;
39 DISALLOW_COPY_AND_ASSIGN(SSLCertificateErrorJob);
42 } // namespace net
44 #endif // NET_TEST_URL_REQUEST_SSL_CERTIFICATE_ERROR_JOB_H_