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

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu_browsertest.cc

Issue 263453007: Implement "Save image as" for canvas (chromium side). (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 OpenEntryAbsentForFilteredURLs) { 70 OpenEntryAbsentForFilteredURLs) {
71 scoped_ptr<TestRenderViewContextMenu> menu( 71 scoped_ptr<TestRenderViewContextMenu> menu(
72 CreateContextMenu(GURL("chrome://history"), 72 CreateContextMenu(GURL("chrome://history"),
73 GURL())); 73 GURL()));
74 74
75 ASSERT_FALSE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB)); 75 ASSERT_FALSE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB));
76 ASSERT_FALSE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW)); 76 ASSERT_FALSE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW));
77 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_COPYLINKLOCATION)); 77 ASSERT_TRUE(menu->IsItemPresent(IDC_CONTENT_CONTEXT_COPYLINKLOCATION));
78 } 78 }
79 79
80 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
81 SaveAsImageForCanvas) {
82 content::ContextMenuParams params;
83 params.media_type = blink::WebContextMenuData::MediaTypeCanvas;
84
85 TestRenderViewContextMenu menu(
86 browser()->tab_strip_model()->GetActiveWebContents()->GetMainFrame(),
87 params);
88 menu.Init();
89
90 ASSERT_TRUE(menu.IsItemPresent(IDC_CONTENT_CONTEXT_SAVEIMAGEAS));
91 }
92
80 // GTK requires a X11-level mouse event to open a context menu correctly. 93 // GTK requires a X11-level mouse event to open a context menu correctly.
81 #if defined(TOOLKIT_GTK) 94 #if defined(TOOLKIT_GTK)
82 #define MAYBE_RealMenu DISABLED_RealMenu 95 #define MAYBE_RealMenu DISABLED_RealMenu
83 #else 96 #else
84 #define MAYBE_RealMenu RealMenu 97 #define MAYBE_RealMenu RealMenu
85 #endif 98 #endif
86 // Opens a link in a new tab via a "real" context menu. 99 // Opens a link in a new tab via a "real" context menu.
87 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest, 100 IN_PROC_BROWSER_TEST_F(ContextMenuBrowserTest,
88 MAYBE_RealMenu) { 101 MAYBE_RealMenu) {
89 ContextMenuNotificationObserver menu_observer( 102 ContextMenuNotificationObserver menu_observer(
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 // Verify that the referrer on the page matches |kEmptyReferrer|. 232 // Verify that the referrer on the page matches |kEmptyReferrer|.
220 std::string page_referrer; 233 std::string page_referrer;
221 ASSERT_TRUE(content::ExecuteScriptAndExtractString( 234 ASSERT_TRUE(content::ExecuteScriptAndExtractString(
222 tab, 235 tab,
223 "window.domAutomationController.send(window.document.referrer);", 236 "window.domAutomationController.send(window.document.referrer);",
224 &page_referrer)); 237 &page_referrer));
225 ASSERT_EQ(kEmptyReferrer, page_referrer); 238 ASSERT_EQ(kEmptyReferrer, page_referrer);
226 } 239 }
227 240
228 } // namespace 241 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698