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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api_unittest.cc

Issue 1295523006: Using scoped_ptr for URLRequestJobFactoryImpl::SetProtocolHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
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 <queue> 6 #include <queue>
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/callback.h" 10 #include "base/callback.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 kEventName + "/1", filter, 231 kEventName + "/1", filter,
232 ExtensionWebRequestEventRouter::ExtraInfoSpec::BLOCKING, 0, 0, 232 ExtensionWebRequestEventRouter::ExtraInfoSpec::BLOCKING, 0, 0,
233 ipc_sender_factory.GetWeakPtr()); 233 ipc_sender_factory.GetWeakPtr());
234 ExtensionWebRequestEventRouter::GetInstance()->AddEventListener( 234 ExtensionWebRequestEventRouter::GetInstance()->AddEventListener(
235 &profile_, extension2_id, extension2_id, events::FOR_TEST, kEventName, 235 &profile_, extension2_id, extension2_id, events::FOR_TEST, kEventName,
236 kEventName + "/2", filter, 236 kEventName + "/2", filter,
237 ExtensionWebRequestEventRouter::ExtraInfoSpec::BLOCKING, 0, 0, 237 ExtensionWebRequestEventRouter::ExtraInfoSpec::BLOCKING, 0, 0,
238 ipc_sender_factory.GetWeakPtr()); 238 ipc_sender_factory.GetWeakPtr());
239 239
240 net::URLRequestJobFactoryImpl job_factory; 240 net::URLRequestJobFactoryImpl job_factory;
241 job_factory.SetProtocolHandler(url::kAboutScheme, 241 job_factory.SetProtocolHandler(
242 new about_handler::AboutProtocolHandler()); 242 url::kAboutScheme,
243 make_scoped_ptr(new about_handler::AboutProtocolHandler()));
243 context_->set_job_factory(&job_factory); 244 context_->set_job_factory(&job_factory);
244 245
245 GURL redirect_url("about:redirected"); 246 GURL redirect_url("about:redirected");
246 GURL not_chosen_redirect_url("about:not_chosen"); 247 GURL not_chosen_redirect_url("about:not_chosen");
247 248
248 scoped_ptr<net::URLRequest> request(context_->CreateRequest( 249 scoped_ptr<net::URLRequest> request(context_->CreateRequest(
249 GURL("about:blank"), net::DEFAULT_PRIORITY, &delegate_)); 250 GURL("about:blank"), net::DEFAULT_PRIORITY, &delegate_));
250 { 251 {
251 // onBeforeRequest will be dispatched twice initially. The second response - 252 // onBeforeRequest will be dispatched twice initially. The second response -
252 // the redirect - should win, since it has a later |install_time|. The 253 // the redirect - should win, since it has a later |install_time|. The
(...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 EXPECT_TRUE(credentials_set); 2247 EXPECT_TRUE(credentials_set);
2247 EXPECT_FALSE(auth3.Empty()); 2248 EXPECT_FALSE(auth3.Empty());
2248 EXPECT_EQ(username, auth1.username()); 2249 EXPECT_EQ(username, auth1.username());
2249 EXPECT_EQ(password, auth1.password()); 2250 EXPECT_EQ(password, auth1.password());
2250 EXPECT_EQ(1u, warning_set.size()); 2251 EXPECT_EQ(1u, warning_set.size());
2251 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2252 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2252 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2253 EXPECT_EQ(3u, capturing_net_log.GetSize());
2253 } 2254 }
2254 2255
2255 } // namespace extensions 2256 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698