| Index: chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
|
| diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc b/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
|
| index c55c0ce901949cda79f7d9ad0c95c8d5cfe99656..6292219e3fb3aa8375dbb6991d28f30b4817487d 100644
|
| --- a/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
|
| +++ b/chrome/browser/renderer_context_menu/render_view_context_menu_unittest.cc
|
| @@ -23,6 +23,7 @@
|
| #include "chrome/test/base/chrome_render_view_host_test_harness.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_test_utils.h"
|
| +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
|
| #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
|
| #include "content/public/browser/web_contents.h"
|
| @@ -356,6 +357,10 @@ class RenderViewContextMenuPrefsTest : public ChromeRenderViewHostTestHarness {
|
| return menu;
|
| }
|
|
|
| + void AppendImageItems(TestRenderViewContextMenu* menu) {
|
| + menu->AppendImageItems();
|
| + }
|
| +
|
| void SetupDataReductionProxy(bool enable_data_reduction_proxy) {
|
| drp_test_context_ =
|
| data_reduction_proxy::DataReductionProxyTestContext::Builder()
|
| @@ -467,3 +472,19 @@ TEST_F(RenderViewContextMenuPrefsTest, DataSaverDisabledSaveImageAs) {
|
| std::string::npos &&
|
| headers.find("Cache-Control: no-cache") == std::string::npos);
|
| }
|
| +
|
| +// Verify that the Chrome-Proxy Lo-Fi directive causes the context menu to
|
| +// display the reload original image menu item.
|
| +TEST_F(RenderViewContextMenuPrefsTest, DataSaverLoadImage) {
|
| + SetupDataReductionProxy(true);
|
| + content::ContextMenuParams params = CreateParams(MenuItem::IMAGE);
|
| + params.properties[data_reduction_proxy::kChromeProxyHeader] =
|
| + data_reduction_proxy::kChromeProxyLoFiDirective;
|
| + params.unfiltered_link_url = params.link_url;
|
| + content::WebContents* wc = web_contents();
|
| + scoped_ptr<TestRenderViewContextMenu> menu(
|
| + new TestRenderViewContextMenu(wc->GetMainFrame(), params));
|
| + AppendImageItems(menu.get());
|
| +
|
| + ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_RELOAD_ORIGINAL_IMAGE));
|
| +}
|
|
|