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

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

Issue 1818613002: Implement UMA log throttling for cellular connections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | chrome/browser/io_thread.h » ('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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <tuple> 10 #include <tuple>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 profile_manager_(TestingBrowserProcess::GetGlobal()), 186 profile_manager_(TestingBrowserProcess::GetGlobal()),
187 event_router_(new EventRouterForwarder) {} 187 event_router_(new EventRouterForwarder) {}
188 188
189 protected: 189 protected:
190 void SetUp() override { 190 void SetUp() override {
191 ASSERT_TRUE(profile_manager_.SetUp()); 191 ASSERT_TRUE(profile_manager_.SetUp());
192 ChromeNetworkDelegate::InitializePrefsOnUIThread( 192 ChromeNetworkDelegate::InitializePrefsOnUIThread(
193 &enable_referrers_, NULL, NULL, NULL, 193 &enable_referrers_, NULL, NULL, NULL,
194 profile_.GetTestingPrefService()); 194 profile_.GetTestingPrefService());
195 network_delegate_.reset( 195 network_delegate_.reset(
196 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); 196 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_,
197 metrics::UpdateUsagePrefCallbackType()));
197 network_delegate_->set_profile(&profile_); 198 network_delegate_->set_profile(&profile_);
198 network_delegate_->set_cookie_settings( 199 network_delegate_->set_cookie_settings(
199 CookieSettingsFactory::GetForProfile(&profile_).get()); 200 CookieSettingsFactory::GetForProfile(&profile_).get());
200 context_.reset(new net::TestURLRequestContext(true)); 201 context_.reset(new net::TestURLRequestContext(true));
201 context_->set_network_delegate(network_delegate_.get()); 202 context_->set_network_delegate(network_delegate_.get());
202 context_->Init(); 203 context_->Init();
203 } 204 }
204 205
205 // Fires a URLRequest with the specified |method|, |content_type| and three 206 // Fires a URLRequest with the specified |method|, |content_type| and three
206 // elements of upload data: bytes_1, a dummy empty file, bytes_2. 207 // elements of upload data: bytes_1, a dummy empty file, bytes_2.
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 profile_manager_(TestingBrowserProcess::GetGlobal()), 865 profile_manager_(TestingBrowserProcess::GetGlobal()),
865 event_router_(new EventRouterForwarder) {} 866 event_router_(new EventRouterForwarder) {}
866 867
867 protected: 868 protected:
868 void SetUp() override { 869 void SetUp() override {
869 ASSERT_TRUE(profile_manager_.SetUp()); 870 ASSERT_TRUE(profile_manager_.SetUp());
870 ChromeNetworkDelegate::InitializePrefsOnUIThread( 871 ChromeNetworkDelegate::InitializePrefsOnUIThread(
871 &enable_referrers_, NULL, NULL, NULL, 872 &enable_referrers_, NULL, NULL, NULL,
872 profile_.GetTestingPrefService()); 873 profile_.GetTestingPrefService());
873 network_delegate_.reset( 874 network_delegate_.reset(
874 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_)); 875 new ChromeNetworkDelegate(event_router_.get(), &enable_referrers_,
876 metrics::UpdateUsagePrefCallbackType()));
875 network_delegate_->set_profile(&profile_); 877 network_delegate_->set_profile(&profile_);
876 network_delegate_->set_cookie_settings( 878 network_delegate_->set_cookie_settings(
877 CookieSettingsFactory::GetForProfile(&profile_).get()); 879 CookieSettingsFactory::GetForProfile(&profile_).get());
878 context_.reset(new net::TestURLRequestContext(true)); 880 context_.reset(new net::TestURLRequestContext(true));
879 host_resolver_.reset(new net::MockHostResolver()); 881 host_resolver_.reset(new net::MockHostResolver());
880 host_resolver_->rules()->AddSimulatedFailure("doesnotexist"); 882 host_resolver_->rules()->AddSimulatedFailure("doesnotexist");
881 context_->set_host_resolver(host_resolver_.get()); 883 context_->set_host_resolver(host_resolver_.get());
882 context_->set_network_delegate(network_delegate_.get()); 884 context_->set_network_delegate(network_delegate_.get());
883 context_->Init(); 885 context_->Init();
884 } 886 }
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 EXPECT_TRUE(credentials_set); 2317 EXPECT_TRUE(credentials_set);
2316 EXPECT_FALSE(auth3.Empty()); 2318 EXPECT_FALSE(auth3.Empty());
2317 EXPECT_EQ(username, auth1.username()); 2319 EXPECT_EQ(username, auth1.username());
2318 EXPECT_EQ(password, auth1.password()); 2320 EXPECT_EQ(password, auth1.password());
2319 EXPECT_EQ(1u, warning_set.size()); 2321 EXPECT_EQ(1u, warning_set.size());
2320 EXPECT_TRUE(HasWarning(warning_set, "extid2")); 2322 EXPECT_TRUE(HasWarning(warning_set, "extid2"));
2321 EXPECT_EQ(3u, capturing_net_log.GetSize()); 2323 EXPECT_EQ(3u, capturing_net_log.GetSize());
2322 } 2324 }
2323 2325
2324 } // namespace extensions 2326 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/io_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698