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

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

Issue 11970002: Added Client-Hints. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Changed Client Hint names to match spec Created 7 years, 10 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 io_thread_(content::BrowserThread::IO, &message_loop_), 175 io_thread_(content::BrowserThread::IO, &message_loop_),
176 profile_manager_(TestingBrowserProcess::GetGlobal()), 176 profile_manager_(TestingBrowserProcess::GetGlobal()),
177 event_router_(new EventRouterForwarder) {} 177 event_router_(new EventRouterForwarder) {}
178 178
179 protected: 179 protected:
180 virtual void SetUp() OVERRIDE { 180 virtual void SetUp() OVERRIDE {
181 ASSERT_TRUE(profile_manager_.SetUp()); 181 ASSERT_TRUE(profile_manager_.SetUp());
182 ChromeNetworkDelegate::InitializePrefsOnUIThread( 182 ChromeNetworkDelegate::InitializePrefsOnUIThread(
183 &enable_referrers_, NULL, NULL, profile_.GetTestingPrefService()); 183 &enable_referrers_, NULL, NULL, profile_.GetTestingPrefService());
184 network_delegate_.reset( 184 network_delegate_.reset(
185 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); 185 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_,
186 false));
186 network_delegate_->set_profile(&profile_); 187 network_delegate_->set_profile(&profile_);
187 network_delegate_->set_cookie_settings( 188 network_delegate_->set_cookie_settings(
188 CookieSettings::Factory::GetForProfile(&profile_)); 189 CookieSettings::Factory::GetForProfile(&profile_));
189 context_.reset(new net::TestURLRequestContext(true)); 190 context_.reset(new net::TestURLRequestContext(true));
190 context_->set_network_delegate(network_delegate_.get()); 191 context_->set_network_delegate(network_delegate_.get());
191 context_->Init(); 192 context_->Init();
192 } 193 }
193 194
194 // Fires a URLRequest with the specified |method|, |content_type| and three 195 // Fires a URLRequest with the specified |method|, |content_type| and three
195 // elements of upload data: bytes_1, a dummy empty file, bytes_2. 196 // elements of upload data: bytes_1, a dummy empty file, bytes_2.
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 io_thread_(content::BrowserThread::IO, &message_loop_), 764 io_thread_(content::BrowserThread::IO, &message_loop_),
764 profile_manager_(TestingBrowserProcess::GetGlobal()), 765 profile_manager_(TestingBrowserProcess::GetGlobal()),
765 event_router_(new EventRouterForwarder) {} 766 event_router_(new EventRouterForwarder) {}
766 767
767 protected: 768 protected:
768 virtual void SetUp() { 769 virtual void SetUp() {
769 ASSERT_TRUE(profile_manager_.SetUp()); 770 ASSERT_TRUE(profile_manager_.SetUp());
770 ChromeNetworkDelegate::InitializePrefsOnUIThread( 771 ChromeNetworkDelegate::InitializePrefsOnUIThread(
771 &enable_referrers_, NULL, NULL, profile_.GetTestingPrefService()); 772 &enable_referrers_, NULL, NULL, profile_.GetTestingPrefService());
772 network_delegate_.reset( 773 network_delegate_.reset(
773 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); 774 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_,
775 false));
774 network_delegate_->set_profile(&profile_); 776 network_delegate_->set_profile(&profile_);
775 network_delegate_->set_cookie_settings( 777 network_delegate_->set_cookie_settings(
776 CookieSettings::Factory::GetForProfile(&profile_)); 778 CookieSettings::Factory::GetForProfile(&profile_));
777 context_.reset(new net::TestURLRequestContext(true)); 779 context_.reset(new net::TestURLRequestContext(true));
778 host_resolver_.reset(new net::MockHostResolver()); 780 host_resolver_.reset(new net::MockHostResolver());
779 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); 781 host_resolver_->rules()->AddSimulatedFailure("doesnotexist");
780 context_->set_host_resolver(host_resolver_.get()); 782 context_->set_host_resolver(host_resolver_.get());
781 context_->set_network_delegate(network_delegate_.get()); 783 context_->set_network_delegate(network_delegate_.get());
782 context_->Init(); 784 context_->Init();
783 } 785 }
(...skipping 1341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 EXPECT_TRUE(credentials_set); 2127 EXPECT_TRUE(credentials_set);
2126 EXPECT_FALSE(auth3.Empty()); 2128 EXPECT_FALSE(auth3.Empty());
2127 EXPECT_EQ(username, auth1.username()); 2129 EXPECT_EQ(username, auth1.username());
2128 EXPECT_EQ(password, auth1.password()); 2130 EXPECT_EQ(password, auth1.password());
2129 EXPECT_EQ(1u, warning_set.size()); 2131 EXPECT_EQ(1u, warning_set.size());
2130 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2132 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2131 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2133 EXPECT_EQ(3u, capturing_net_log.GetSize());
2132 } 2134 }
2133 2135
2134 } // namespace extensions 2136 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/io_thread.cc » ('j') | chrome/browser/net/chrome_network_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698