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

Side by Side Diff: chrome/browser/net/dns_probe_browsertest.cc

Issue 541743002: Move url_request_mock_http_job to net/test/url_request/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include <set> 5 #include <set>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/common/net/net_error_info.h" 24 #include "chrome/common/net/net_error_info.h"
25 #include "chrome/common/pref_names.h" 25 #include "chrome/common/pref_names.h"
26 #include "chrome/test/base/in_process_browser_test.h" 26 #include "chrome/test/base/in_process_browser_test.h"
27 #include "chrome/test/base/ui_test_utils.h" 27 #include "chrome/test/base/ui_test_utils.h"
28 #include "components/google/core/browser/google_util.h" 28 #include "components/google/core/browser/google_util.h"
29 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/web_contents.h" 30 #include "content/public/browser/web_contents.h"
31 #include "content/public/test/browser_test_utils.h" 31 #include "content/public/test/browser_test_utils.h"
32 #include "content/public/test/test_navigation_observer.h" 32 #include "content/public/test/test_navigation_observer.h"
33 #include "content/test/net/url_request_failed_job.h" 33 #include "content/test/net/url_request_failed_job.h"
34 #include "content/test/net/url_request_mock_http_job.h"
35 #include "net/base/net_errors.h" 34 #include "net/base/net_errors.h"
36 #include "net/dns/dns_test_util.h" 35 #include "net/dns/dns_test_util.h"
36 #include "net/test/url_request/url_request_mock_http_job.h"
37 #include "net/url_request/url_request_filter.h" 37 #include "net/url_request/url_request_filter.h"
38 #include "net/url_request/url_request_interceptor.h" 38 #include "net/url_request/url_request_interceptor.h"
39 #include "net/url_request/url_request_job.h" 39 #include "net/url_request/url_request_job.h"
40 40
41 using base::Bind; 41 using base::Bind;
42 using base::Callback; 42 using base::Callback;
43 using base::Closure; 43 using base::Closure;
44 using base::ConstRef; 44 using base::ConstRef;
45 using base::FilePath; 45 using base::FilePath;
46 using base::MessageLoop; 46 using base::MessageLoop;
47 using base::Unretained; 47 using base::Unretained;
48 using chrome_common_net::DnsProbeStatus; 48 using chrome_common_net::DnsProbeStatus;
49 using content::BrowserThread; 49 using content::BrowserThread;
50 using content::URLRequestFailedJob; 50 using content::URLRequestFailedJob;
51 using content::URLRequestMockHTTPJob; 51 using net::URLRequestMockHTTPJob;
52 using content::WebContents; 52 using content::WebContents;
53 using google_util::LinkDoctorBaseURL; 53 using google_util::LinkDoctorBaseURL;
54 using net::MockDnsClientRule; 54 using net::MockDnsClientRule;
55 using net::NetworkDelegate; 55 using net::NetworkDelegate;
56 using net::URLRequest; 56 using net::URLRequest;
57 using net::URLRequestFilter; 57 using net::URLRequestFilter;
58 using net::URLRequestInterceptor; 58 using net::URLRequestInterceptor;
59 using net::URLRequestJob; 59 using net::URLRequestJob;
60 using ui_test_utils::NavigateToURL; 60 using ui_test_utils::NavigateToURL;
61 using ui_test_utils::NavigateToURLBlockUntilNavigationsComplete; 61 using ui_test_utils::NavigateToURLBlockUntilNavigationsComplete;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 class DelayableURLRequestMockHTTPJob : public URLRequestMockHTTPJob, 175 class DelayableURLRequestMockHTTPJob : public URLRequestMockHTTPJob,
176 public DelayableRequest { 176 public DelayableRequest {
177 public: 177 public:
178 DelayableURLRequestMockHTTPJob( 178 DelayableURLRequestMockHTTPJob(
179 net::URLRequest* request, 179 net::URLRequest* request,
180 net::NetworkDelegate* network_delegate, 180 net::NetworkDelegate* network_delegate,
181 const base::FilePath& file_path, 181 const base::FilePath& file_path,
182 bool should_delay, 182 bool should_delay,
183 const DestructionCallback& destruction_callback) 183 const DestructionCallback& destruction_callback)
184 : URLRequestMockHTTPJob(request, network_delegate, file_path), 184 : URLRequestMockHTTPJob(
185 request,
186 network_delegate,
187 file_path,
188 BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(
189 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)),
185 should_delay_(should_delay), 190 should_delay_(should_delay),
186 start_delayed_(false), 191 start_delayed_(false),
187 destruction_callback_(destruction_callback) {} 192 destruction_callback_(destruction_callback) {}
188 193
189 virtual void Start() OVERRIDE { 194 virtual void Start() OVERRIDE {
190 if (should_delay_) { 195 if (should_delay_) {
191 DCHECK(!start_delayed_); 196 DCHECK(!start_delayed_);
192 start_delayed_ = true; 197 start_delayed_ = true;
193 return; 198 return;
194 } 199 }
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 991
987 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE, 992 EXPECT_EQ(chrome_common_net::DNS_PROBE_FINISHED_INCONCLUSIVE,
988 WaitForSentStatus()); 993 WaitForSentStatus());
989 EXPECT_EQ(0, pending_status_count()); 994 EXPECT_EQ(0, pending_status_count());
990 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED"); 995 ExpectDisplayingLocalErrorPage("ERR_NAME_NOT_RESOLVED");
991 } 996 }
992 997
993 } // namespace 998 } // namespace
994 999
995 } // namespace chrome_browser_net 1000 } // namespace chrome_browser_net
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager_browsertest.cc ('k') | chrome/browser/net/url_request_mock_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698