| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |