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

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

Issue 1056003003: Policy: Ignore ForceSafeSearch if ForceGoogleSafeSearch or ForceYoutubeSafetyMode are enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Android Created 5 years, 8 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
« no previous file with comments | « chrome/browser/android/preferences/pref_service_bridge.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 public: 174 public:
175 ExtensionWebRequestTest() 175 ExtensionWebRequestTest()
176 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), 176 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
177 profile_manager_(TestingBrowserProcess::GetGlobal()), 177 profile_manager_(TestingBrowserProcess::GetGlobal()),
178 event_router_(new EventRouterForwarder) {} 178 event_router_(new EventRouterForwarder) {}
179 179
180 protected: 180 protected:
181 void SetUp() override { 181 void SetUp() override {
182 ASSERT_TRUE(profile_manager_.SetUp()); 182 ASSERT_TRUE(profile_manager_.SetUp());
183 ChromeNetworkDelegate::InitializePrefsOnUIThread( 183 ChromeNetworkDelegate::InitializePrefsOnUIThread(
184 &enable_referrers_, NULL, NULL, NULL, NULL, 184 &enable_referrers_, NULL, NULL, NULL,
185 profile_.GetTestingPrefService()); 185 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 }
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 public: 774 public:
775 ExtensionWebRequestHeaderModificationTest() 775 ExtensionWebRequestHeaderModificationTest()
776 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), 776 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
777 profile_manager_(TestingBrowserProcess::GetGlobal()), 777 profile_manager_(TestingBrowserProcess::GetGlobal()),
778 event_router_(new EventRouterForwarder) {} 778 event_router_(new EventRouterForwarder) {}
779 779
780 protected: 780 protected:
781 void SetUp() override { 781 void SetUp() override {
782 ASSERT_TRUE(profile_manager_.SetUp()); 782 ASSERT_TRUE(profile_manager_.SetUp());
783 ChromeNetworkDelegate::InitializePrefsOnUIThread( 783 ChromeNetworkDelegate::InitializePrefsOnUIThread(
784 &enable_referrers_, NULL, NULL, NULL, NULL, 784 &enable_referrers_, NULL, NULL, NULL,
785 profile_.GetTestingPrefService()); 785 profile_.GetTestingPrefService());
786 network_delegate_.reset( 786 network_delegate_.reset(
787 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); 787 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_));
788 network_delegate_->set_profile(&profile_); 788 network_delegate_->set_profile(&profile_);
789 network_delegate_->set_cookie_settings( 789 network_delegate_->set_cookie_settings(
790 CookieSettings::Factory::GetForProfile(&profile_).get()); 790 CookieSettings::Factory::GetForProfile(&profile_).get());
791 context_.reset(new net::TestURLRequestContext(true)); 791 context_.reset(new net::TestURLRequestContext(true));
792 host_resolver_.reset(new net::MockHostResolver()); 792 host_resolver_.reset(new net::MockHostResolver());
793 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); 793 host_resolver_->rules()->AddSimulatedFailure("doesnotexist");
794 context_->set_host_resolver(host_resolver_.get()); 794 context_->set_host_resolver(host_resolver_.get());
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 EXPECT_TRUE(credentials_set); 2227 EXPECT_TRUE(credentials_set);
2228 EXPECT_FALSE(auth3.Empty()); 2228 EXPECT_FALSE(auth3.Empty());
2229 EXPECT_EQ(username, auth1.username()); 2229 EXPECT_EQ(username, auth1.username());
2230 EXPECT_EQ(password, auth1.password()); 2230 EXPECT_EQ(password, auth1.password());
2231 EXPECT_EQ(1u, warning_set.size()); 2231 EXPECT_EQ(1u, warning_set.size());
2232 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2232 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2233 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2233 EXPECT_EQ(3u, capturing_net_log.GetSize());
2234 } 2234 }
2235 2235
2236 } // namespace extensions 2236 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/android/preferences/pref_service_bridge.cc ('k') | chrome/browser/io_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698