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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc

Issue 2592783002: Move session network stats from IO to UI (Closed)
Patch Set: Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
index e5efb87c942ae6e510efff748f1d2a52bf284f2f..d573dd3b031b5ade0232bb537f9e17b629a58349 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate_unittest.cc
@@ -405,14 +405,6 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test {
request, data_reduction_proxy_info, proxy_retry_info, headers);
}
- int64_t total_received_bytes() const {
- return GetSessionNetworkStatsInfoInt64("session_received_content_length");
- }
-
- int64_t total_original_received_bytes() const {
- return GetSessionNetworkStatsInfoInt64("session_original_content_length");
- }
-
net::MockClientSocketFactory* mock_socket_factory() {
return &mock_socket_factory_;
}
@@ -438,23 +430,6 @@ class DataReductionProxyNetworkDelegateTest : public testing::Test {
TestLoFiDecider* lofi_decider() const { return lofi_decider_; }
private:
- int64_t GetSessionNetworkStatsInfoInt64(const char* key) const {
- const DataReductionProxyNetworkDelegate* drp_network_delegate =
- reinterpret_cast<const DataReductionProxyNetworkDelegate*>(
- context_.network_delegate());
-
- std::unique_ptr<base::DictionaryValue> session_network_stats_info =
- base::DictionaryValue::From(
- drp_network_delegate->SessionNetworkStatsInfoToValue());
- EXPECT_TRUE(session_network_stats_info);
-
- std::string string_value;
- EXPECT_TRUE(session_network_stats_info->GetString(key, &string_value));
- int64_t value = 0;
- EXPECT_TRUE(base::StringToInt64(string_value, &value));
- return value;
- }
-
base::MessageLoopForIO message_loop_;
net::MockClientSocketFactory mock_socket_factory_;
std::unique_ptr<net::ProxyService> proxy_service_;

Powered by Google App Engine
This is Rietveld 408576698