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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_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_delegate_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
index d3f466b90268cc19b40556395b184b7ce803cb1b..1bf9e4d6e8fcbd49f8d5e2025511c72779fbf124 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_delegate_unittest.cc
@@ -666,11 +666,11 @@ class DataReductionProxyDelegateTest : public testing::Test {
}
int64_t total_received_bytes() const {
- return GetSessionNetworkStatsInfoInt64("session_received_content_length");
+ return test_context_->io_data()->actual_content_length();
tbansal1 2016/12/20 23:20:48 Is it possible to get this from compression stats
RyanSturm 2016/12/21 00:10:20 Done.
}
int64_t total_original_received_bytes() const {
- return GetSessionNetworkStatsInfoInt64("session_original_content_length");
+ return test_context_->io_data()->original_content_length();
}
net::MockClientSocketFactory* mock_socket_factory() {
@@ -692,23 +692,6 @@ class DataReductionProxyDelegateTest : public testing::Test {
}
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_;
net::TestURLRequestContext context_;

Powered by Google App Engine
This is Rietveld 408576698