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

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

Issue 2615493002: Adding compressed bytes to DRP pingback (Closed)
Patch Set: changing proto to int64 instead of recuding to kb Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client_unittest.cc
index 4c6f3395a94b8ed6db34a6859eec46c07cb6b3bb..70d0992d008282e30fb71ff2f1a31d4a6e4b0c97 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client_unittest.cc
@@ -4,6 +4,8 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pingback_client.h"
+#include <stdint.h>
+
#include <memory>
#include <string>
@@ -37,6 +39,8 @@ static const char kHistogramAttempted[] =
"DataReductionProxy.Pingback.Attempted";
static const char kSessionKey[] = "fake-session";
static const char kFakeURL[] = "http://www.google.com/";
+static const int64_t kBytes = 10000;
+static const int64_t kBytesOriginal = 1000000;
} // namespace
@@ -98,7 +102,9 @@ class DataReductionProxyPingbackClientTest : public testing::Test {
base::Optional<base::TimeDelta>(base::TimeDelta::FromMilliseconds(
100)) /* parse_blocked_on_script_load_duration */,
base::Optional<base::TimeDelta>(
- base::TimeDelta::FromMilliseconds(2000)) /* parse_stop */) {}
+ base::TimeDelta::FromMilliseconds(2000)) /* parse_stop */,
+ kBytes /* network_bytes */,
+ kBytesOriginal /* original_network_bytes */) {}
TestDataReductionProxyPingbackClient* pingback_client() const {
return pingback_client_.get();
@@ -181,6 +187,9 @@ TEST_F(DataReductionProxyPingbackClientTest, VerifyPingbackContent) {
EXPECT_EQ(kSessionKey, pageload_metrics.session_key());
EXPECT_EQ(kFakeURL, pageload_metrics.first_request_url());
+ EXPECT_EQ(kBytes, pageload_metrics.compressed_page_size_bytes());
+ EXPECT_EQ(kBytesOriginal, pageload_metrics.original_page_size_bytes());
+
EXPECT_EQ(
PageloadMetrics_EffectiveConnectionType_EFFECTIVE_CONNECTION_TYPE_OFFLINE,
pageload_metrics.effective_connection_type());
@@ -250,6 +259,8 @@ TEST_F(DataReductionProxyPingbackClientTest, VerifyTwoPingbacksBatchedContent) {
EXPECT_EQ(kSessionKey, pageload_metrics.session_key());
EXPECT_EQ(kFakeURL, pageload_metrics.first_request_url());
+ EXPECT_EQ(kBytes, pageload_metrics.compressed_page_size_bytes());
+ EXPECT_EQ(kBytesOriginal, pageload_metrics.original_page_size_bytes());
EXPECT_EQ(
PageloadMetrics_EffectiveConnectionType_EFFECTIVE_CONNECTION_TYPE_OFFLINE,
pageload_metrics.effective_connection_type());

Powered by Google App Engine
This is Rietveld 408576698