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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 668
669 wait_for_new_tab.Wait(); 669 wait_for_new_tab.Wait();
670 670
671 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(), 671 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
672 browser()->host_desktop_type())); 672 browser()->host_desktop_type()));
673 ASSERT_EQ(2, browser()->tab_strip_model()->count()); 673 ASSERT_EQ(2, browser()->tab_strip_model()->count());
674 // Check that we create the background tab. 674 // Check that we create the background tab.
675 ASSERT_EQ(0, browser()->tab_strip_model()->active_index()); 675 ASSERT_EQ(0, browser()->tab_strip_model()->active_index());
676 } 676 }
677 677
678 // Tests that the tapping gesture with cntl/cmd key on a link open the
679 // backgournd tab.
680 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, TapGestureWithCtrlKey) {
681 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
682
683 GURL url(embedded_test_server()->GetURL(
684 "/popup_blocker/popup-simulated-click-on-anchor2.html"));
685 ui_test_utils::NavigateToURL(browser(), url);
686
687 content::WindowedNotificationObserver wait_for_new_tab(
688 chrome::NOTIFICATION_TAB_ADDED,
689 content::NotificationService::AllSources());
690
691 #if defined(OS_MACOSX)
692 unsigned modifiers = blink::WebInputEvent::MetaKey;
693 #else
694 unsigned modifiers = blink::WebInputEvent::ControlKey;
695 #endif
696 content::SimulateTapWithModifiersAt(tab, modifiers, gfx::Point(350, 250));
697
698 wait_for_new_tab.Wait();
699
700 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
701 browser()->host_desktop_type()));
702 ASSERT_EQ(2, browser()->tab_strip_model()->count());
703 // Check that we create the background tab.
704 ASSERT_EQ(0, browser()->tab_strip_model()->active_index());
705 }
706
678 } // namespace 707 } // namespace
OLDNEW
« 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