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 46f5ee2ac8c89b872acc7541eb7ece292a657e9c..9405f8dcebf222f527961ac179e1b9a2a6afe548 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 |
@@ -818,4 +818,32 @@ TEST_F(ContentLoFiDeciderTest, RequestIsClientSideLoFiImageTest) { |
EXPECT_TRUE(lofi_decider->IsClientLoFiImageRequest(*request)); |
} |
+TEST_F(ContentLoFiDeciderTest, RequestIsClientLoFiAutoReload) { |
+ // IsClientLoFiAutoReloadRequest() should return true for any request with the |
+ // CLIENT_LOFI_AUTO_RELOAD bit set. |
+ |
+ EXPECT_TRUE(ContentLoFiDecider().IsClientLoFiAutoReloadRequest( |
+ *CreateRequestByType(content::RESOURCE_TYPE_IMAGE, false, |
+ content::CLIENT_LOFI_AUTO_RELOAD))); |
+ |
+ EXPECT_TRUE( |
+ ContentLoFiDecider().IsClientLoFiAutoReloadRequest(*CreateRequestByType( |
+ content::RESOURCE_TYPE_IMAGE, true, |
+ content::CLIENT_LOFI_AUTO_RELOAD | content::PREVIEWS_NO_TRANSFORM))); |
+ |
+ EXPECT_TRUE(ContentLoFiDecider().IsClientLoFiAutoReloadRequest( |
+ *CreateRequestByType(content::RESOURCE_TYPE_MAIN_FRAME, true, |
+ content::CLIENT_LOFI_AUTO_RELOAD))); |
+ |
+ EXPECT_TRUE(ContentLoFiDecider().IsClientLoFiAutoReloadRequest( |
+ *CreateRequestByType(content::RESOURCE_TYPE_SCRIPT, true, |
+ content::CLIENT_LOFI_AUTO_RELOAD))); |
+ |
+ // IsClientLoFiAutoReloadRequest() should return false for any request without |
+ // the CLIENT_LOFI_AUTO_RELOAD bit set. |
+ EXPECT_FALSE(ContentLoFiDecider().IsClientLoFiAutoReloadRequest( |
+ *CreateRequestByType(content::RESOURCE_TYPE_IMAGE, false, |
+ content::PREVIEWS_NO_TRANSFORM))); |
+} |
+ |
} // namespace data_reduction_proxy |