diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 23:39:42 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-06 23:39:42 +0000 |
commit | a3f343f6ac8b64af57859042089577f5c1752c96 (patch) | |
tree | 61fba3a19b9acf9bbe9f4d143ba5b52b099f3801 /chrome/browser/browser_focus_uitest.cc | |
parent | e0dd245806022340de388d6a288c4ca0fbf1bc7d (diff) | |
download | chromium_src-a3f343f6ac8b64af57859042089577f5c1752c96.zip chromium_src-a3f343f6ac8b64af57859042089577f5c1752c96.tar.gz chromium_src-a3f343f6ac8b64af57859042089577f5c1752c96.tar.bz2 |
Rehabilitate BrowserFocusTest.TabInitialFocus
BUG=50763
TEST=interactive_ui_tests --gtest_filter=BrowserFocusTest.TabInitialFocus
Review URL: http://codereview.chromium.org/3561013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61735 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_focus_uitest.cc')
-rw-r--r-- | chrome/browser/browser_focus_uitest.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 4558c90..ea679674 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -705,27 +705,33 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { // Makes sure the focus is in the right location when opening the different // types of tabs. -// Flaky, http://crbug.com/50763. -IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FLAKY_TabInitialFocus) { +IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabInitialFocus) { ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); // Open the history tab, focus should be on the tab contents. browser()->ShowHistoryTab(); - ui_test_utils::RunAllPendingInMessageLoop(); - ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); + ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( + &browser()->GetSelectedTabContents()->controller())); + EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); // Open the new tab, focus should be on the location bar. browser()->NewTab(); - ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); + ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( + &browser()->GetSelectedTabContents()->controller())); + EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); // Open the download tab, focus should be on the tab contents. browser()->ShowDownloadsTab(); - ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); + ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( + &browser()->GetSelectedTabContents()->controller())); + EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); // Open about:blank, focus should be on the location bar. browser()->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), PageTransition::LINK); - ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); + ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( + &browser()->GetSelectedTabContents()->controller())); + EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); } // Tests that focus goes where expected when using reload. |