Index: net/test/url_request/url_request_hanging_connect_job.h |
diff --git a/net/test/url_request/url_request_hanging_connect_job.h b/net/test/url_request/url_request_hanging_connect_job.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9fb3eafa19aec608b7b8c0ea6330bef788818caa |
--- /dev/null |
+++ b/net/test/url_request/url_request_hanging_connect_job.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2016 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 NET_TEST_URL_REQUEST_URL_REQUEST_HANGING_CONNECT_JOB_H_ |
+#define NET_TEST_URL_REQUEST_URL_REQUEST_HANGING_CONNECT_JOB_H_ |
+ |
+#include "base/macros.h" |
+#include "net/url_request/url_request_job.h" |
+#include "url/gurl.h" |
+ |
+namespace net { |
+ |
+class URLRequest; |
+ |
+// URLRequestJob that simulates a hanging connect by not starting the job. |
+class URLRequestHangingConnectJob : public URLRequestJob { |
+ public: |
+ URLRequestHangingConnectJob(URLRequest* request, |
+ NetworkDelegate* network_delegate); |
+ |
+ // URLRequestJob implementation: |
+ void Start() override; |
+ |
+ // Adds the testing URLs to the URLRequestFilter. |
+ static void AddUrlHandler(); |
+ |
+ static GURL GetMockHttpUrl(); |
+ static GURL GetMockHttpsUrl(); |
+ |
+ protected: |
+ ~URLRequestHangingConnectJob() override; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(URLRequestHangingConnectJob); |
+}; |
+ |
+} // namespace net |
+ |
+#endif // NET_TEST_URL_REQUEST_URL_REQUEST_HANGING_CONNECT_JOB_H_ |