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

Side by Side Diff: content/test/net/url_request_slow_http_job.h

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // A URLRequestMockHTTPJob class that inserts a time delay in processing. 5 // A URLRequestMockHTTPJob class that inserts a time delay in processing.
6 6
7 #ifndef CONTENT_TEST_NET_URL_REQUEST_SLOW_HTTP_JOB_H_ 7 #ifndef CONTENT_TEST_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
8 #define CONTENT_TEST_NET_URL_REQUEST_SLOW_HTTP_JOB_H_ 8 #define CONTENT_TEST_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
9 9
10 #include "base/timer.h" 10 #include "base/timer.h"
11 #include "content/test/net/url_request_mock_http_job.h" 11 #include "content/test/net/url_request_mock_http_job.h"
12 12
13 class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob { 13 class URLRequestSlowHTTPJob : public URLRequestMockHTTPJob {
14 public: 14 public:
15 URLRequestSlowHTTPJob(net::URLRequest* request, const FilePath& file_path); 15 URLRequestSlowHTTPJob(net::URLRequest* request,
16 net::NetworkDelegate* network_delegate,
17 const FilePath& file_path);
16 18
17 static const int kDelayMs; 19 static const int kDelayMs;
18 20
19 static net::URLRequest::ProtocolFactory Factory; 21 static net::URLRequest::ProtocolFactory Factory;
20 22
21 // Adds the testing URLs to the net::URLRequestFilter. 23 // Adds the testing URLs to the net::URLRequestFilter.
22 static void AddUrlHandler(const FilePath& base_path); 24 static void AddUrlHandler(const FilePath& base_path);
23 25
24 // Given the path to a file relative to the path passed to AddUrlHandler(), 26 // Given the path to a file relative to the path passed to AddUrlHandler(),
25 // construct a mock URL. 27 // construct a mock URL.
26 static GURL GetMockUrl(const FilePath& path); 28 static GURL GetMockUrl(const FilePath& path);
27 29
28 virtual void Start() OVERRIDE; 30 virtual void Start() OVERRIDE;
29 31
30 private: 32 private:
31 virtual ~URLRequestSlowHTTPJob(); 33 virtual ~URLRequestSlowHTTPJob();
32 34
33 void RealStart(); 35 void RealStart();
34 36
35 base::OneShotTimer<URLRequestSlowHTTPJob> delay_timer_; 37 base::OneShotTimer<URLRequestSlowHTTPJob> delay_timer_;
36 }; 38 };
37 39
38 #endif // CONTENT_TEST_NET_URL_REQUEST_SLOW_HTTP_JOB_H_ 40 #endif // CONTENT_TEST_NET_URL_REQUEST_SLOW_HTTP_JOB_H_
OLDNEW
« no previous file with comments | « content/test/net/url_request_slow_download_job.cc ('k') | content/test/net/url_request_slow_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698