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

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

Issue 2803813003: Adding a data saver page id to requests and reports (Closed)
Patch Set: bengr nits Created 3 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_data_unittest.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc
index 09aaaa199bab3d20784e93627712bbf403bf8c57..4ace1e8ba03cd0cc0af913064ad0110fe93cea70 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_data_unittest.cc
@@ -4,6 +4,8 @@
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h"
+#include <stdint.h>
+
#include <memory>
#include "base/memory/ptr_util.h"
@@ -54,6 +56,10 @@ TEST_F(DataReductionProxyDataTest, BasicSettersAndGetters) {
data->set_effective_connection_type(net::EFFECTIVE_CONNECTION_TYPE_OFFLINE);
EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_OFFLINE,
data->effective_connection_type());
+ uint64_t page_id = 1;
+ EXPECT_FALSE(data->page_id());
+ data->set_page_id(page_id);
+ EXPECT_EQ(page_id, data->page_id().value());
}
TEST_F(DataReductionProxyDataTest, AddToURLRequest) {
@@ -101,6 +107,7 @@ TEST_F(DataReductionProxyDataTest, DeepCopy) {
data->set_session_key(kSessionKey);
data->set_request_url(kTestURL);
data->set_effective_connection_type(net::EFFECTIVE_CONNECTION_TYPE_OFFLINE);
+ data->set_page_id(2u);
std::unique_ptr<DataReductionProxyData> copy = data->DeepCopy();
EXPECT_EQ(tests[i].lofi_on, copy->lofi_requested());
EXPECT_EQ(tests[i].data_reduction_used, copy->used_data_reduction_proxy());
@@ -108,6 +115,7 @@ TEST_F(DataReductionProxyDataTest, DeepCopy) {
EXPECT_EQ(kTestURL, copy->request_url());
EXPECT_EQ(net::EFFECTIVE_CONNECTION_TYPE_OFFLINE,
copy->effective_connection_type());
+ EXPECT_EQ(2u, data->page_id().value());
}
}

Powered by Google App Engine
This is Rietveld 408576698