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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 public: | 175 public: |
176 ExtensionWebRequestTest() | 176 ExtensionWebRequestTest() |
177 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 177 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
178 profile_manager_(TestingBrowserProcess::GetGlobal()), | 178 profile_manager_(TestingBrowserProcess::GetGlobal()), |
179 event_router_(new EventRouterForwarder) {} | 179 event_router_(new EventRouterForwarder) {} |
180 | 180 |
181 protected: | 181 protected: |
182 virtual void SetUp() OVERRIDE { | 182 virtual void SetUp() OVERRIDE { |
183 ASSERT_TRUE(profile_manager_.SetUp()); | 183 ASSERT_TRUE(profile_manager_.SetUp()); |
184 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 184 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
185 &enable_referrers_, NULL, NULL, profile_.GetTestingPrefService()); | 185 &enable_referrers_, NULL, NULL, NULL, profile_.GetTestingPrefService()); |
186 network_delegate_.reset( | 186 network_delegate_.reset( |
187 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); | 187 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); |
188 network_delegate_->set_profile(&profile_); | 188 network_delegate_->set_profile(&profile_); |
189 network_delegate_->set_cookie_settings( | 189 network_delegate_->set_cookie_settings( |
190 CookieSettings::Factory::GetForProfile(&profile_).get()); | 190 CookieSettings::Factory::GetForProfile(&profile_).get()); |
191 context_.reset(new net::TestURLRequestContext(true)); | 191 context_.reset(new net::TestURLRequestContext(true)); |
192 context_->set_network_delegate(network_delegate_.get()); | 192 context_->set_network_delegate(network_delegate_.get()); |
193 context_->Init(); | 193 context_->Init(); |
194 } | 194 } |
195 | 195 |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 public: | 772 public: |
773 ExtensionWebRequestHeaderModificationTest() | 773 ExtensionWebRequestHeaderModificationTest() |
774 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 774 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
775 profile_manager_(TestingBrowserProcess::GetGlobal()), | 775 profile_manager_(TestingBrowserProcess::GetGlobal()), |
776 event_router_(new EventRouterForwarder) {} | 776 event_router_(new EventRouterForwarder) {} |
777 | 777 |
778 protected: | 778 protected: |
779 virtual void SetUp() { | 779 virtual void SetUp() { |
780 ASSERT_TRUE(profile_manager_.SetUp()); | 780 ASSERT_TRUE(profile_manager_.SetUp()); |
781 ChromeNetworkDelegate::InitializePrefsOnUIThread( | 781 ChromeNetworkDelegate::InitializePrefsOnUIThread( |
782 &enable_referrers_, NULL, NULL, profile_.GetTestingPrefService()); | 782 &enable_referrers_, NULL, NULL, NULL, profile_.GetTestingPrefService()); |
783 network_delegate_.reset( | 783 network_delegate_.reset( |
784 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); | 784 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); |
785 network_delegate_->set_profile(&profile_); | 785 network_delegate_->set_profile(&profile_); |
786 network_delegate_->set_cookie_settings( | 786 network_delegate_->set_cookie_settings( |
787 CookieSettings::Factory::GetForProfile(&profile_).get()); | 787 CookieSettings::Factory::GetForProfile(&profile_).get()); |
788 context_.reset(new net::TestURLRequestContext(true)); | 788 context_.reset(new net::TestURLRequestContext(true)); |
789 host_resolver_.reset(new net::MockHostResolver()); | 789 host_resolver_.reset(new net::MockHostResolver()); |
790 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); | 790 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); |
791 context_->set_host_resolver(host_resolver_.get()); | 791 context_->set_host_resolver(host_resolver_.get()); |
792 context_->set_network_delegate(network_delegate_.get()); | 792 context_->set_network_delegate(network_delegate_.get()); |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2223 EXPECT_TRUE(credentials_set); | 2223 EXPECT_TRUE(credentials_set); |
2224 EXPECT_FALSE(auth3.Empty()); | 2224 EXPECT_FALSE(auth3.Empty()); |
2225 EXPECT_EQ(username, auth1.username()); | 2225 EXPECT_EQ(username, auth1.username()); |
2226 EXPECT_EQ(password, auth1.password()); | 2226 EXPECT_EQ(password, auth1.password()); |
2227 EXPECT_EQ(1u, warning_set.size()); | 2227 EXPECT_EQ(1u, warning_set.size()); |
2228 EXPECT_TRUE(HasWarning(warning_set, "extid2")); | 2228 EXPECT_TRUE(HasWarning(warning_set, "extid2")); |
2229 EXPECT_EQ(3u, capturing_net_log.GetSize()); | 2229 EXPECT_EQ(3u, capturing_net_log.GetSize()); |
2230 } | 2230 } |
2231 | 2231 |
2232 } // namespace extensions | 2232 } // namespace extensions |
OLD | NEW |