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

Unified Diff: chrome/browser/browser_focus_uitest.cc

Issue 5966006: Hitting Tab should always move cursor to end of omnibox text. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Mac build. Created 9 years, 11 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
Index: chrome/browser/browser_focus_uitest.cc
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc
index 9bd27da34a013cb49d6b4b9dc16d70f00f124eba..75a6304387ba7e1157e6aa6f90b9d4731405d036 100644
--- a/chrome/browser/browser_focus_uitest.cc
+++ b/chrome/browser/browser_focus_uitest.cc
@@ -469,6 +469,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
// Location bar should be focused.
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
+ // Move the caret to the end, otherwise the next Tab key may not move focus.
+ ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
+ browser(), ui::VKEY_END, false, false, false, false));
+
// Now let's press tab to move the focus.
for (size_t j = 0; j < arraysize(kExpElementIDs); ++j) {
SCOPED_TRACE(StringPrintf("inner loop %" PRIuS, j));
@@ -515,6 +519,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversal) {
// Location bar should be focused.
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
+ // Move the caret to the end, otherwise the next Tab key may not move focus.
+ ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
+ browser(), ui::VKEY_END, false, false, false, false));
+
// Now let's press shift-tab to move the focus in reverse.
for (size_t j = 0; j < arraysize(kExpElementIDs); ++j) {
SCOPED_TRACE(StringPrintf("inner loop: %" PRIuS, j));
@@ -595,6 +603,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) {
// Location bar should be focused.
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
+ // Move the caret to the end, otherwise the next Tab key may not move focus.
+ ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
+ browser(), ui::VKEY_END, false, false, false, false));
+
// Now let's press tab to move the focus.
for (size_t j = 0; j < 7; ++j) {
// Let's make sure the focus is on the expected element in the page.
@@ -634,6 +646,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusTraversalOnInterstitial) {
// Location bar should be focused.
ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
+ // Move the caret to the end, otherwise the next Tab key may not move focus.
+ ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
+ browser(), ui::VKEY_END, false, false, false, false));
+
// Now let's press shift-tab to move the focus in reverse.
for (size_t j = 0; j < 7; ++j) {
NotificationType::Type notification_type;
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_edit_view_win.cc ('k') | chrome/browser/instant/instant_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698