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

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: Fixed more files Created 8 years, 6 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 25 matching lines...) Expand all
36 #include "content/public/browser/notification_observer.h" 36 #include "content/public/browser/notification_observer.h"
37 #include "content/public/browser/notification_registrar.h" 37 #include "content/public/browser/notification_registrar.h"
38 #include "content/public/browser/notification_service.h" 38 #include "content/public/browser/notification_service.h"
39 #include "content/public/browser/notification_types.h" 39 #include "content/public/browser/notification_types.h"
40 #include "content/public/browser/render_view_host.h" 40 #include "content/public/browser/render_view_host.h"
41 #include "content/public/browser/web_contents.h" 41 #include "content/public/browser/web_contents.h"
42 #include "content/public/common/url_constants.h" 42 #include "content/public/common/url_constants.h"
43 #include "content/test/net/url_request_failed_job.h" 43 #include "content/test/net/url_request_failed_job.h"
44 #include "content/test/net/url_request_mock_http_job.h" 44 #include "content/test/net/url_request_mock_http_job.h"
45 #include "net/base/net_errors.h" 45 #include "net/base/net_errors.h"
46 #include "net/url_request/url_request_context.h"
mmenke 2012/06/22 20:23:43 Let's include url_request as well, since we're now
shalev 2012/06/22 20:53:55 Done.
46 #include "net/url_request/url_request_filter.h" 47 #include "net/url_request/url_request_filter.h"
47 #include "net/url_request/url_request_job.h" 48 #include "net/url_request/url_request_job.h"
48 #include "net/url_request/url_request_status.h" 49 #include "net/url_request/url_request_status.h"
49 #include "testing/gtest/include/gtest/gtest.h" 50 #include "testing/gtest/include/gtest/gtest.h"
50 51
51 using content::BrowserThread; 52 using content::BrowserThread;
52 53
53 namespace captive_portal { 54 namespace captive_portal {
54 55
55 namespace { 56 namespace {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 154
154 // static 155 // static
155 void URLRequestTimeoutOnDemandJob::AbandonRequests() { 156 void URLRequestTimeoutOnDemandJob::AbandonRequests() {
156 content::BrowserThread::PostTask( 157 content::BrowserThread::PostTask(
157 content::BrowserThread::IO, FROM_HERE, 158 content::BrowserThread::IO, FROM_HERE,
158 base::Bind(&URLRequestTimeoutOnDemandJob::AbandonRequestsOnIOThread)); 159 base::Bind(&URLRequestTimeoutOnDemandJob::AbandonRequestsOnIOThread));
159 } 160 }
160 161
161 URLRequestTimeoutOnDemandJob::URLRequestTimeoutOnDemandJob( 162 URLRequestTimeoutOnDemandJob::URLRequestTimeoutOnDemandJob(
162 net::URLRequest* request) 163 net::URLRequest* request)
163 : net::URLRequestJob(request), 164 : net::URLRequestJob(request, request->context()->network_delegate()),
164 next_job_(NULL) { 165 next_job_(NULL) {
165 } 166 }
166 167
167 URLRequestTimeoutOnDemandJob::~URLRequestTimeoutOnDemandJob() { 168 URLRequestTimeoutOnDemandJob::~URLRequestTimeoutOnDemandJob() {
168 // |this| shouldn't be in the list. 169 // |this| shouldn't be in the list.
169 EXPECT_FALSE(RemoveFromList()); 170 EXPECT_FALSE(RemoveFromList());
170 } 171 }
171 172
172 bool URLRequestTimeoutOnDemandJob::RemoveFromList() { 173 bool URLRequestTimeoutOnDemandJob::RemoveFromList() {
173 URLRequestTimeoutOnDemandJob** job = &job_list_; 174 URLRequestTimeoutOnDemandJob** job = &job_list_;
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1762 GetStateOfTabReloaderAt(active_browser, 0)); 1763 GetStateOfTabReloaderAt(active_browser, 0));
1763 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, 1764 EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE,
1764 GetStateOfTabReloaderAt(active_browser, 1)); 1765 GetStateOfTabReloaderAt(active_browser, 1));
1765 EXPECT_TRUE(IsLoginTab(active_browser->GetTabContentsAt(1))); 1766 EXPECT_TRUE(IsLoginTab(active_browser->GetTabContentsAt(1)));
1766 1767
1767 // Simulate logging in. 1768 // Simulate logging in.
1768 Login(active_browser, 0, 1); 1769 Login(active_browser, 0, 1);
1769 } 1770 }
1770 1771
1771 } // namespace captive_portal 1772 } // namespace captive_portal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698