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

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

Issue 1984723002: Support setReadTimeout in CronetHttpURLConnection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address John's comments Created 4 years, 7 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: 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_

Powered by Google App Engine
This is Rietveld 408576698