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

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

Issue 10407037: Disable BrowserFocusTest.ClickingMovesFocus and BrowserFocusTest.FindFocusTest on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 bool HasFocus() { 213 bool HasFocus() {
214 return render_view_host()->GetView()->HasFocus(); 214 return render_view_host()->GetView()->HasFocus();
215 } 215 }
216 216
217 private: 217 private:
218 std::string html_contents_; 218 std::string html_contents_;
219 InterstitialPage* interstitial_page_; // Owns us. 219 InterstitialPage* interstitial_page_; // Owns us.
220 }; 220 };
221 221
222 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, ClickingMovesFocus) { 222 // Flaky on mac. http://crbug.com/67301.
223 #if defined(OS_MACOSX)
224 #define MAYBE_FindFocusTest DISABLED_FindFocusTest
225 #else
226 #define MAYBE_FindFocusTest FindFocusTest
227 #endif
228 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) {
223 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 229 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
224 #if defined(OS_POSIX) 230 #if defined(OS_POSIX)
225 // It seems we have to wait a little bit for the widgets to spin up before 231 // It seems we have to wait a little bit for the widgets to spin up before
226 // we can start clicking on them. 232 // we can start clicking on them.
227 MessageLoop::current()->PostDelayedTask( 233 MessageLoop::current()->PostDelayedTask(
228 FROM_HERE, 234 FROM_HERE,
229 MessageLoop::QuitClosure(), 235 MessageLoop::QuitClosure(),
230 base::TimeDelta::FromMilliseconds(kActionDelayMs)); 236 base::TimeDelta::FromMilliseconds(kActionDelayMs));
231 ui_test_utils::RunMessageLoop(); 237 ui_test_utils::RunMessageLoop();
232 #endif // defined(OS_POSIX) 238 #endif // defined(OS_POSIX)
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 772 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
767 } 773 }
768 774
769 // Make sure Find box can request focus, even when it is already open. 775 // Make sure Find box can request focus, even when it is already open.
770 // Flaky on mac and valgrind. http://crbug.com/67301. 776 // Flaky on mac and valgrind. http://crbug.com/67301.
771 #if defined(OS_MACOSX) 777 #if defined(OS_MACOSX)
772 #define MAYBE_FindFocusTest DISABLED_FindFocusTest 778 #define MAYBE_FindFocusTest DISABLED_FindFocusTest
773 #else 779 #else
774 #define MAYBE_FindFocusTest FindFocusTest 780 #define MAYBE_FindFocusTest FindFocusTest
775 #endif 781 #endif
776 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, FindFocusTest) { 782 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_FindFocusTest) {
777 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 783 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
778 ASSERT_TRUE(test_server()->Start()); 784 ASSERT_TRUE(test_server()->Start());
779 785
780 // Open some page (any page that doesn't steal focus). 786 // Open some page (any page that doesn't steal focus).
781 GURL url = test_server()->GetURL(kTypicalPage); 787 GURL url = test_server()->GetURL(kTypicalPage);
782 ui_test_utils::NavigateToURL(browser(), url); 788 ui_test_utils::NavigateToURL(browser(), url);
783 789
784 EXPECT_TRUE(ChromeInForeground()); 790 EXPECT_TRUE(ChromeInForeground());
785 791
786 #if defined(OS_MACOSX) 792 #if defined(OS_MACOSX)
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
919 browser()->Reload(CURRENT_TAB); 925 browser()->Reload(CURRENT_TAB);
920 observer.Wait(); 926 observer.Wait();
921 } 927 }
922 928
923 // Focus should now be on the tab contents. 929 // Focus should now be on the tab contents.
924 browser()->ShowDownloadsTab(); 930 browser()->ShowDownloadsTab();
925 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 931 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
926 } 932 }
927 933
928 } // namespace 934 } // namespace
OLDNEW
« 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