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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_browsertest.cc

Issue 10534100: Decouple URLRequestJob from URLRequestContext; access NetworkDelegate as a contructor parameter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with latest sync Created 8 years, 5 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 (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 #include <map> 5 #include <map>
6 #include <set> 6 #include <set>
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 26 matching lines...) Expand all
37 #include "content/public/browser/notification_observer.h" 37 #include "content/public/browser/notification_observer.h"
38 #include "content/public/browser/notification_registrar.h" 38 #include "content/public/browser/notification_registrar.h"
39 #include "content/public/browser/notification_service.h" 39 #include "content/public/browser/notification_service.h"
40 #include "content/public/browser/notification_types.h" 40 #include "content/public/browser/notification_types.h"
41 #include "content/public/browser/render_view_host.h" 41 #include "content/public/browser/render_view_host.h"
42 #include "content/public/browser/web_contents.h" 42 #include "content/public/browser/web_contents.h"
43 #include "content/public/common/url_constants.h" 43 #include "content/public/common/url_constants.h"
44 #include "content/test/net/url_request_failed_job.h" 44 #include "content/test/net/url_request_failed_job.h"
45 #include "content/test/net/url_request_mock_http_job.h" 45 #include "content/test/net/url_request_mock_http_job.h"
46 #include "net/base/net_errors.h" 46 #include "net/base/net_errors.h"
47 #include "net/url_request/url_request.h"
48 #include "net/url_request/url_request_context.h"
47 #include "net/url_request/url_request_filter.h" 49 #include "net/url_request/url_request_filter.h"
48 #include "net/url_request/url_request_job.h" 50 #include "net/url_request/url_request_job.h"
49 #include "net/url_request/url_request_status.h" 51 #include "net/url_request/url_request_status.h"
50 #include "testing/gtest/include/gtest/gtest.h" 52 #include "testing/gtest/include/gtest/gtest.h"
51 53
52 using content::BrowserThread; 54 using content::BrowserThread;
53 55
54 namespace captive_portal { 56 namespace captive_portal {
55 57
56 namespace { 58 namespace {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void URLRequestTimeoutOnDemandJob::AbandonJobs(int expected_num_jobs) { 211 void URLRequestTimeoutOnDemandJob::AbandonJobs(int expected_num_jobs) {
210 content::BrowserThread::PostTask( 212 content::BrowserThread::PostTask(
211 content::BrowserThread::IO, FROM_HERE, 213 content::BrowserThread::IO, FROM_HERE,
212 base::Bind(&URLRequestTimeoutOnDemandJob::FailOrAbandonJobsOnIOThread, 214 base::Bind(&URLRequestTimeoutOnDemandJob::FailOrAbandonJobsOnIOThread,
213 expected_num_jobs, 215 expected_num_jobs,
214 ABANDON_JOBS)); 216 ABANDON_JOBS));
215 } 217 }
216 218
217 URLRequestTimeoutOnDemandJob::URLRequestTimeoutOnDemandJob( 219 URLRequestTimeoutOnDemandJob::URLRequestTimeoutOnDemandJob(
218 net::URLRequest* request) 220 net::URLRequest* request)
219 : net::URLRequestJob(request), 221 : net::URLRequestJob(request, request->context()->network_delegate()),
220 next_job_(NULL) { 222 next_job_(NULL) {
221 } 223 }
222 224
223 URLRequestTimeoutOnDemandJob::~URLRequestTimeoutOnDemandJob() { 225 URLRequestTimeoutOnDemandJob::~URLRequestTimeoutOnDemandJob() {
224 // All hanging jobs should have failed or been abandoned before being 226 // All hanging jobs should have failed or been abandoned before being
225 // destroyed. 227 // destroyed.
226 EXPECT_FALSE(RemoveFromList()); 228 EXPECT_FALSE(RemoveFromList());
227 } 229 }
228 230
229 bool URLRequestTimeoutOnDemandJob::RemoveFromList() { 231 bool URLRequestTimeoutOnDemandJob::RemoveFromList() {
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 GetStateOfTabReloaderAt(active_browser, 0)); 1886 GetStateOfTabReloaderAt(active_browser, 0));
1885 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, 1887 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE,
1886 GetStateOfTabReloaderAt(active_browser, 1)); 1888 GetStateOfTabReloaderAt(active_browser, 1));
1887 EXPECT_TRUE(IsLoginTab(active_browser->GetTabContentsAt(1))); 1889 EXPECT_TRUE(IsLoginTab(active_browser->GetTabContentsAt(1)));
1888 1890
1889 // Simulate logging in. 1891 // Simulate logging in.
1890 Login(active_browser, 0, 1); 1892 Login(active_browser, 0, 1);
1891 } 1893 }
1892 1894
1893 } // namespace captive_portal 1895 } // namespace captive_portal
OLDNEW
« no previous file with comments | « chrome/browser/automation/url_request_automation_job.cc ('k') | chrome/browser/chromeos/gdata/gdata_protocol_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698