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

Unified Diff: chrome/renderer/chrome_content_renderer_client_unittest.cc

Issue 2465253005: Fix 'Load image' context menu item (Closed)
Patch Set: fix dependent patchset Created 4 years, 1 month 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
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client_unittest.cc
diff --git a/chrome/renderer/chrome_content_renderer_client_unittest.cc b/chrome/renderer/chrome_content_renderer_client_unittest.cc
index 4a4e831fdebc0825cd3ab8e6c176d319405f69e3..67856128d36f6b2f396c6b1229945f418de093d5 100644
--- a/chrome/renderer/chrome_content_renderer_client_unittest.cc
+++ b/chrome/renderer/chrome_content_renderer_client_unittest.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <map>
+#include <string>
#include <vector>
#include "base/metrics/histogram_samples.h"
@@ -13,8 +15,11 @@
#include "base/test/histogram_tester.h"
#include "build/build_config.h"
#include "chrome/renderer/searchbox/search_bouncer.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h"
#include "content/public/common/webplugininfo.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/WebKit/public/platform/WebString.h"
+#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "url/gurl.h"
#if defined(ENABLE_EXTENSIONS)
@@ -411,6 +416,22 @@ TEST_F(ChromeContentRendererClientTest, ShouldSuppressErrorPage) {
std::vector<GURL>(), GURL::EmptyGURL());
}
+TEST_F(ChromeContentRendererClientTest, AddImageContextMenuProperties) {
+ ChromeContentRendererClient client;
+ blink::WebURLResponse web_url_response;
+ web_url_response.addHTTPHeaderField(
+ blink::WebString::fromUTF8(
+ data_reduction_proxy::chrome_proxy_content_transform_header()),
+ blink::WebString::fromUTF8(
+ data_reduction_proxy::empty_image_directive()));
+ std::map<std::string, std::string> properties;
+ client.AddImageContextMenuProperties(web_url_response, &properties);
+ EXPECT_EQ(
+ data_reduction_proxy::empty_image_directive(),
+ properties
+ [data_reduction_proxy::chrome_proxy_content_transform_header()]);
+}
+
// These are tests that are common for both Android and desktop browsers.
TEST_F(ChromeContentRendererClientTest, RewriteEmbedCommon) {
struct TestData {
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698