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

Side by Side Diff: chrome/browser/browser_focus_uitest.cc

Issue 6730016: Fix flakiness and enable RenderViewHostManagerTest on Linux/Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix additional flakiness. Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 788
789 // Makes sure the focus is in the right location when opening the different 789 // Makes sure the focus is in the right location when opening the different
790 // types of tabs. 790 // types of tabs.
791 // Flaky, http://crbug.com/62539. 791 // Flaky, http://crbug.com/62539.
792 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FLAKY_TabInitialFocus) { 792 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FLAKY_TabInitialFocus) {
793 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 793 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
794 794
795 // Open the history tab, focus should be on the tab contents. 795 // Open the history tab, focus should be on the tab contents.
796 browser()->ShowHistoryTab(); 796 browser()->ShowHistoryTab();
797 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( 797 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop(
798 &browser()->GetSelectedTabContents()->controller())); 798 browser()->GetSelectedTabContents()));
799 EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); 799 EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW));
800 800
801 // Open the new tab, focus should be on the location bar. 801 // Open the new tab, focus should be on the location bar.
802 browser()->NewTab(); 802 browser()->NewTab();
803 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( 803 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop(
804 &browser()->GetSelectedTabContents()->controller())); 804 browser()->GetSelectedTabContents()));
805 EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); 805 EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
806 806
807 // Open the download tab, focus should be on the tab contents. 807 // Open the download tab, focus should be on the tab contents.
808 browser()->ShowDownloadsTab(); 808 browser()->ShowDownloadsTab();
809 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( 809 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop(
810 &browser()->GetSelectedTabContents()->controller())); 810 browser()->GetSelectedTabContents()));
811 EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); 811 EXPECT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW));
812 812
813 // Open about:blank, focus should be on the location bar. 813 // Open about:blank, focus should be on the location bar.
814 browser()->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL), 814 browser()->AddSelectedTabWithURL(GURL(chrome::kAboutBlankURL),
815 PageTransition::LINK); 815 PageTransition::LINK);
816 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop( 816 ASSERT_NO_FATAL_FAILURE(ui_test_utils::WaitForLoadStop(
817 &browser()->GetSelectedTabContents()->controller())); 817 browser()->GetSelectedTabContents()));
818 EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); 818 EXPECT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR));
819 } 819 }
820 820
821 // Tests that focus goes where expected when using reload. 821 // Tests that focus goes where expected when using reload.
822 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) { 822 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FocusOnReload) {
823 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 823 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
824 ASSERT_TRUE(test_server()->Start()); 824 ASSERT_TRUE(test_server()->Start());
825 825
826 // Open the new tab, reload. 826 // Open the new tab, reload.
827 browser()->NewTab(); 827 browser()->NewTab();
(...skipping 26 matching lines...) Expand all
854 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); 854 ui_test_utils::CrashTab(browser()->GetSelectedTabContents());
855 browser()->Reload(CURRENT_TAB); 855 browser()->Reload(CURRENT_TAB);
856 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); 856 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser()));
857 857
858 // Focus should now be on the tab contents. 858 // Focus should now be on the tab contents.
859 browser()->ShowDownloadsTab(); 859 browser()->ShowDownloadsTab();
860 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); 860 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW));
861 } 861 }
862 862
863 } // namespace 863 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698