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

Unified Diff: chrome/browser/captive_portal/captive_portal_browsertest.cc

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/captive_portal/captive_portal_browsertest.cc
diff --git a/chrome/browser/captive_portal/captive_portal_browsertest.cc b/chrome/browser/captive_portal/captive_portal_browsertest.cc
index 09b3460c9951193ed59a7ec53fa601e7dc87541d..307762117f1387e29cb64fe2cc7639c7261f0ca9 100644
--- a/chrome/browser/captive_portal/captive_portal_browsertest.cc
+++ b/chrome/browser/captive_portal/captive_portal_browsertest.cc
@@ -134,7 +134,8 @@ class URLRequestTimeoutOnDemandJob : public net::URLRequestJob,
ABANDON_JOBS,
};
- explicit URLRequestTimeoutOnDemandJob(net::URLRequest* request);
+ URLRequestTimeoutOnDemandJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate);
virtual ~URLRequestTimeoutOnDemandJob();
// Attempts to removes |this| from |jobs_|. Returns true if it was removed
@@ -226,8 +227,8 @@ void URLRequestTimeoutOnDemandJob::AbandonJobs(int expected_num_jobs) {
}
URLRequestTimeoutOnDemandJob::URLRequestTimeoutOnDemandJob(
- net::URLRequest* request)
- : net::URLRequestJob(request, request->context()->network_delegate()),
+ net::URLRequest* request, net::NetworkDelegate* network_delegate)
+ : net::URLRequestJob(request, network_delegate),
next_job_(NULL) {
}
@@ -343,6 +344,7 @@ class URLRequestMockCaptivePortalJobFactory {
// kMockHttpsQuickTimeoutUrl. See documentation of individual URLs for
// actual behavior.
static net::URLRequestJob* Factory(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
const std::string& scheme);
static bool behind_captive_portal_;
@@ -398,6 +400,7 @@ void URLRequestMockCaptivePortalJobFactory::SetBehindCaptivePortalOnIOThread(
// static
net::URLRequestJob* URLRequestMockCaptivePortalJobFactory::Factory(
net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
const std::string& scheme) {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -408,19 +411,22 @@ net::URLRequestJob* URLRequestMockCaptivePortalJobFactory::Factory(
if (request->url() == GURL(kMockHttpsUrl) ||
request->url() == GURL(kMockHttpsUrl2)) {
if (behind_captive_portal_)
- return new URLRequestTimeoutOnDemandJob(request);
+ return new URLRequestTimeoutOnDemandJob(request, network_delegate);
// Once logged in to the portal, HTTPS requests return the page that was
// actually requested.
return new URLRequestMockHTTPJob(
request,
+ network_delegate,
root_http.Append(FILE_PATH_LITERAL("title2.html")));
} else if (request->url() == GURL(kMockHttpsQuickTimeoutUrl)) {
if (behind_captive_portal_)
- return new URLRequestFailedJob(request, net::ERR_CONNECTION_TIMED_OUT);
+ return new URLRequestFailedJob(
+ request, network_delegate, net::ERR_CONNECTION_TIMED_OUT);
// Once logged in to the portal, HTTPS requests return the page that was
// actually requested.
return new URLRequestMockHTTPJob(
request,
+ network_delegate,
root_http.Append(FILE_PATH_LITERAL("title2.html")));
} else {
// The URL should be the captive portal test URL.
@@ -430,12 +436,14 @@ net::URLRequestJob* URLRequestMockCaptivePortalJobFactory::Factory(
// Prior to logging in to the portal, HTTP requests go to the login page.
return new URLRequestMockHTTPJob(
request,
+ network_delegate,
root_http.Append(FILE_PATH_LITERAL("captive_portal/login.html")));
}
// After logging in to the portal, the test URL returns a 204 response.
return new URLRequestMockHTTPJob(
request,
+ network_delegate,
root_http.Append(FILE_PATH_LITERAL("captive_portal/page204.html")));
}
}
« no previous file with comments | « chrome/browser/automation/url_request_automation_job.cc ('k') | chrome/browser/chromeos/gdata/gdata_protocol_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698