diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 01:11:07 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-30 01:11:07 +0000 |
commit | 9ba21eded1c923718c9fe28cf093b41a077bc92c (patch) | |
tree | ce609b7b89884e74b25f26fe9426ad5316e24033 /chrome/browser/browser_focus_uitest.cc | |
parent | f628f48960532cdfc5277f6b26e5d0801f34807d (diff) | |
download | chromium_src-9ba21eded1c923718c9fe28cf093b41a077bc92c.zip chromium_src-9ba21eded1c923718c9fe28cf093b41a077bc92c.tar.gz chromium_src-9ba21eded1c923718c9fe28cf093b41a077bc92c.tar.bz2 |
Uncrash BrowserFocusTest.*
It didn't wait for things to finish, which was clearly broken.
TBR=xji
TEST=interactive_ui_tests:BrowserFocusTest.* on Linux, no crashes
BUG=50696
Review URL: http://codereview.chromium.org/3005038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54251 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_focus_uitest.cc')
-rw-r--r-- | chrome/browser/browser_focus_uitest.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index aa79385..46a335b 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -745,19 +745,20 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { // types of tabs. IN_PROC_BROWSER_TEST_F(BrowserFocusTest, TabInitialFocus) { BringBrowserWindowToFront(); + // 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)); // Open the new tab, focus should be on the location bar. browser()->NewTab(); + ui_test_utils::RunAllPendingInMessageLoop(); ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); // Open the download tab, focus should be on the tab contents. browser()->ShowDownloadsTab(); + ui_test_utils::RunAllPendingInMessageLoop(); ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); // Open about:blank, focus should be on the location bar. @@ -775,7 +776,6 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { // Open the new tab, reload. browser()->NewTab(); - ui_test_utils::RunAllPendingInMessageLoop(); browser()->Reload(CURRENT_TAB); @@ -789,8 +789,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); browser()->Reload(CURRENT_TAB); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); + // Focus should now be on the tab contents. browser()->ShowDownloadsTab(); + ui_test_utils::RunAllPendingInMessageLoop(); ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); } @@ -813,8 +815,10 @@ IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FocusOnReloadCrashedTab) { ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); browser()->Reload(CURRENT_TAB); ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); + // Focus should now be on the tab contents. browser()->ShowDownloadsTab(); + ui_test_utils::RunAllPendingInMessageLoop(); ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); } |