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

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

Issue 1074293003: Use int64 instead of int32 for response sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reuploading to try to fix corrupt issue 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
index 87e92e60560b561d2c52169d48376824686d757a..aad3de816fc8f087561e9f2943148d63ba93aa04 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc
@@ -269,8 +269,8 @@ class DataReductionProxyCompressionStatsTest : public testing::Test {
compression_stats_->SetInt64(pref_path, pref_value);
}
- void RecordContentLengthPrefs(int received_content_length,
- int original_content_length,
+ void RecordContentLengthPrefs(int64 received_content_length,
+ int64 original_content_length,
bool with_data_reduction_proxy_enabled,
DataReductionProxyRequestType request_type,
base::Time now) {
@@ -658,6 +658,23 @@ TEST_F(DataReductionProxyCompressionStatsTest, ForwardOneDay) {
received_with_data_reduction_proxy_enabled, 2,
original_via_data_reduction_proxy, 2,
received_via_data_reduction_proxy, 2);
+
+ // Proxy enabled and via proxy, with content length greater than max int32.
+ const int64 kBigOriginalLength = 0x300000000LL; // 12G.
+ const int64 kBigReceivedLength = 0x200000000LL; // 8G.
+ RecordContentLengthPrefs(kBigReceivedLength, kBigOriginalLength, true,
+ VIA_DATA_REDUCTION_PROXY, FakeNow());
+ original[1] += kBigOriginalLength;
+ received[1] += kBigReceivedLength;
+ original_with_data_reduction_proxy_enabled[1] += kBigOriginalLength;
+ received_with_data_reduction_proxy_enabled[1] += kBigReceivedLength;
+ original_via_data_reduction_proxy[1] += kBigOriginalLength;
+ received_via_data_reduction_proxy[1] += kBigReceivedLength;
+ VerifyDailyDataSavingContentLengthPrefLists(
+ original, 2, received, 2, original_with_data_reduction_proxy_enabled, 2,
+ received_with_data_reduction_proxy_enabled, 2,
+ original_via_data_reduction_proxy, 2, received_via_data_reduction_proxy,
+ 2);
}
TEST_F(DataReductionProxyCompressionStatsTest, PartialDayTimeChange) {

Powered by Google App Engine
This is Rietveld 408576698