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

Unified Diff: components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc

Issue 2848293002: Adding the Previews infobar to pages that show a client LoFi image (Closed)
Patch Set: sclittle comments 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/content/browser/content_lofi_decider_unittest.cc
diff --git a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc
index 3bbfb38c263852f7bf5cda111ba4dc3ce43194b7..b069126a21db5eb849616d244b892e5f713a133f 100644
--- a/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc
+++ b/components/data_reduction_proxy/content/browser/content_lofi_decider_unittest.cc
@@ -794,4 +794,20 @@ TEST_F(ContentLoFiDeciderTest, NoTransformDoesNotAddHeader) {
EXPECT_FALSE(headers.HasHeader(chrome_proxy_accept_transform_header()));
}
+TEST_F(ContentLoFiDeciderTest, RequestIsClientSideLoFiMainFrameTest) {
+ std::unique_ptr<net::URLRequest> request = CreateRequestByType(
+ content::RESOURCE_TYPE_MAIN_FRAME, true, content::CLIENT_LOFI_ON);
sclittle 2017/05/03 22:51:29 nit: Could we also have a test for when it's an im
RyanSturm 2017/05/03 23:20:30 Done.
+ std::unique_ptr<data_reduction_proxy::ContentLoFiDecider> lofi_decider(
+ new data_reduction_proxy::ContentLoFiDecider());
+ EXPECT_FALSE(lofi_decider->IsClientLoFiImageRequest(*request));
+}
+
+TEST_F(ContentLoFiDeciderTest, RequestIsClientSideLoFiImageTest) {
+ std::unique_ptr<net::URLRequest> request = CreateRequestByType(
+ content::RESOURCE_TYPE_IMAGE, true, content::CLIENT_LOFI_ON);
+ std::unique_ptr<data_reduction_proxy::ContentLoFiDecider> lofi_decider(
+ new data_reduction_proxy::ContentLoFiDecider());
+ EXPECT_TRUE(lofi_decider->IsClientLoFiImageRequest(*request));
+}
+
} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698