summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_focus_uitest.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-14 22:02:35 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-14 22:02:35 +0000
commitcb7e254d1a3e767dd1a1c7bb9361959f3f37de9b (patch)
tree0195c36c39d7919b6bc05b1a5192e01cd339e765 /chrome/browser/browser_focus_uitest.cc
parent930b37c6d91807921ef8b8a5834cab3a153a4c69 (diff)
downloadchromium_src-cb7e254d1a3e767dd1a1c7bb9361959f3f37de9b.zip
chromium_src-cb7e254d1a3e767dd1a1c7bb9361959f3f37de9b.tar.gz
chromium_src-cb7e254d1a3e767dd1a1c7bb9361959f3f37de9b.tar.bz2
Add a regression test for http://crbug.com/29473
BUG=29473 TEST=it passes Review URL: http://codereview.chromium.org/486037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_focus_uitest.cc')
-rw-r--r--chrome/browser/browser_focus_uitest.cc34
1 files changed, 32 insertions, 2 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc
index 7a07b1e..05b45205 100644
--- a/chrome/browser/browser_focus_uitest.cc
+++ b/chrome/browser/browser_focus_uitest.cc
@@ -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 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabsRememberFocus) {
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 < 15; 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,
+ false, false,
+ new MessageLoop::QuitTask());
+ ui_test_utils::RunMessageLoop();
+ }
+
+ // As above, but with ctrl+shift+tab.
+ browser()->SelectTabContentsAt(4, true);
+ for (int j = 14; 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.