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

Unified Diff: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc

Issue 1008233002: Add a test for a simulated click on a link on tapping of gesture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/test/data/popup_blocker/popup-simulated-click-on-anchor2.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
diff --git a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
index 1ff40fe0157f5753d5bfb248bd9513be8c9f519e..74a5c554da78277b9a98c8338fb488541935ae67 100644
--- a/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
+++ b/chrome/browser/ui/blocked_content/popup_blocker_browsertest.cc
@@ -675,4 +675,33 @@ IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, CtrlEnterKey) {
ASSERT_EQ(0, browser()->tab_strip_model()->active_index());
}
+// Tests that the tapping gesture with cntl/cmd key on a link open the
+// backgournd tab.
+IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, TapGestureWithCtrlKey) {
+ WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
+
+ GURL url(embedded_test_server()->GetURL(
+ "/popup_blocker/popup-simulated-click-on-anchor2.html"));
+ ui_test_utils::NavigateToURL(browser(), url);
+
+ content::WindowedNotificationObserver wait_for_new_tab(
+ chrome::NOTIFICATION_TAB_ADDED,
+ content::NotificationService::AllSources());
+
+#if defined(OS_MACOSX)
+ unsigned modifiers = blink::WebInputEvent::MetaKey;
+#else
+ unsigned modifiers = blink::WebInputEvent::ControlKey;
+#endif
+ content::SimulateTapWithModifiersAt(tab, modifiers, gfx::Point(350, 250));
+
+ wait_for_new_tab.Wait();
+
+ ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
+ browser()->host_desktop_type()));
+ ASSERT_EQ(2, browser()->tab_strip_model()->count());
+ // Check that we create the background tab.
+ ASSERT_EQ(0, browser()->tab_strip_model()->active_index());
+}
+
} // namespace
« no previous file with comments | « no previous file | chrome/test/data/popup_blocker/popup-simulated-click-on-anchor2.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698