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

Unified Diff: chrome/browser/ui/views/find_bar_views_interactive_uitest.cc

Issue 1801313003: [M50 Merge] Disable Find-In-Page buttons when no text is entered (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 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 | « chrome/browser/ui/views/find_bar_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/find_bar_views_interactive_uitest.cc
diff --git a/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc b/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc
index b77ba95d9e35e88cc915dc7924118598d271b5ce..b3acc50f100129985cd64392d6061b1541944726 100644
--- a/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc
+++ b/chrome/browser/ui/views/find_bar_views_interactive_uitest.cc
@@ -162,6 +162,27 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, DISABLED_NavigationByMouse) {
VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
}
+IN_PROC_BROWSER_TEST_F(FindInPageTest, ButtonsDisabledWithoutText) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+ // Make sure Chrome is in the foreground, otherwise sending input
+ // won't do anything and the test will hang.
+ ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
+ // First we navigate to any page.
+ ui_test_utils::NavigateToURL(browser(),
+ embedded_test_server()->GetURL(kSimplePage));
+ // Show the Find bar.
+ browser()->GetFindBarController()->Show();
+ EXPECT_TRUE(
+ ui_test_utils::IsViewFocused(browser(), VIEW_ID_FIND_IN_PAGE_TEXT_FIELD));
+
+ // The buttons should be disabled as there is no text entered in the find bar
+ // and no search has been issued yet.
+ ASSERT_TRUE(ui_test_utils::SendKeyPressSync(browser(), ui::VKEY_TAB, false,
+ false, false, false));
+ EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(),
+ VIEW_ID_FIND_IN_PAGE_CLOSE_BUTTON));
+}
+
#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA)
// TODO(erg): linux_aura bringup: http://crbug.com/163931
#define MAYBE_FocusRestore DISABLED_FocusRestore
« no previous file with comments | « chrome/browser/ui/views/find_bar_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698