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

Unified Diff: chrome/browser/browser_focus_uitest.cc

Issue 486037: Add a regression test for http://crbug.com/29473 (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_focus_uitest.cc
===================================================================
--- chrome/browser/browser_focus_uitest.cc (revision 34371)
+++ chrome/browser/browser_focus_uitest.cc (working copy)
@@ -36,8 +36,11 @@
// For some reason we hit an external DNS lookup in this test in Linux but not
// on Windows. TODO(estade): investigate.
#define MAYBE_FocusTraversalOnInterstitial DISABLED_FocusTraversalOnInterstitial
+// TODO(jcampan): http://crbug.com/23683
+#define MAYBE_TabsRememberFocusFindInPage DISABLED_TabsRememberFocusFindInPage
#else
#define MAYBE_FocusTraversalOnInterstitial FocusTraversalOnInterstitial
+#define MAYBE_TabsRememberFocusFindInPage TabsRememberFocusFindInPage
#endif
namespace {
@@ -289,12 +292,39 @@
VIEW_ID_LOCATION_BAR;
ASSERT_TRUE(IsViewFocused(vid));
}
+
+ gfx::NativeWindow window = browser()->window()->GetNativeHandle();
+ browser()->SelectTabContentsAt(0, true);
+ // Try the above, but with ctrl+tab. Since tab normally changes focus,
+ // this has regressed in the past. Loop through several times to be sure.
+ for (int j = 0; j < 25; j++) {
tony 2009/12/11 22:00:35 Nit: Do we really need to run 25 times? Looks lik
Evan Stade 2009/12/11 22:11:59 it's a loop of 5, 5 times. I could reduce it, but
+ ViewID vid = kFocusPage[i][j % 5] ? VIEW_ID_TAB_CONTAINER_FOCUS_VIEW :
+ VIEW_ID_LOCATION_BAR;
+ ASSERT_TRUE(IsViewFocused(vid));
+
+ ui_controls::SendKeyPressNotifyWhenDone(window, base::VKEY_TAB, true,
+ false, false,
+ new MessageLoop::QuitTask());
+ ui_test_utils::RunMessageLoop();
+ }
+
+ // As above, but with ctrl+shift+tab.
+ browser()->SelectTabContentsAt(4, true);
+ for (int j = 24; j >= 0; --j) {
+ ViewID vid = kFocusPage[i][j % 5] ? VIEW_ID_TAB_CONTAINER_FOCUS_VIEW :
+ VIEW_ID_LOCATION_BAR;
+ ASSERT_TRUE(IsViewFocused(vid));
+
+ ui_controls::SendKeyPressNotifyWhenDone(window, base::VKEY_TAB, true,
+ true, false,
+ new MessageLoop::QuitTask());
+ ui_test_utils::RunMessageLoop();
+ }
}
}
// Tabs remember focus with find-in-page box.
-// TODO(jcampan): http://crbug.com/23683 Disabled because it fails on Linux.
-IN_PROC_BROWSER_TEST_F(BrowserFocusTest, DISABLED_TabsRememberFocusFindInPage) {
+IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_TabsRememberFocusFindInPage) {
HTTPTestServer* server = StartHTTPServer();
// First we navigate to our test page.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698