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

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

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/format_macros.h" 7 #include "base/format_macros.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 #define MAYBE_ClickingMovesFocus DISABLED_ClickingMovesFocus 195 #define MAYBE_ClickingMovesFocus DISABLED_ClickingMovesFocus
196 #else 196 #else
197 #define MAYBE_ClickingMovesFocus ClickingMovesFocus 197 #define MAYBE_ClickingMovesFocus ClickingMovesFocus
198 #endif 198 #endif
199 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) { 199 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) {
200 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 200 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
201 #if defined(OS_POSIX) 201 #if defined(OS_POSIX)
202 // It seems we have to wait a little bit for the widgets to spin up before 202 // It seems we have to wait a little bit for the widgets to spin up before
203 // we can start clicking on them. 203 // we can start clicking on them.
204 base::MessageLoop::current()->task_runner()->PostDelayedTask( 204 base::MessageLoop::current()->task_runner()->PostDelayedTask(
205 FROM_HERE, base::MessageLoop::QuitClosure(), 205 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
206 base::TimeDelta::FromMilliseconds(kActionDelayMs)); 206 base::TimeDelta::FromMilliseconds(kActionDelayMs));
207 content::RunMessageLoop(); 207 content::RunMessageLoop();
208 #endif // defined(OS_POSIX) 208 #endif // defined(OS_POSIX)
209 209
210 ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); 210 ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX));
211 211
212 ClickOnView(VIEW_ID_TAB_CONTAINER); 212 ClickOnView(VIEW_ID_TAB_CONTAINER);
213 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 213 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
214 214
215 ClickOnView(VIEW_ID_OMNIBOX); 215 ClickOnView(VIEW_ID_OMNIBOX);
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 705 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
706 content::NotificationService::AllSources()); 706 content::NotificationService::AllSources());
707 chrome::GoForward(browser(), CURRENT_TAB); 707 chrome::GoForward(browser(), CURRENT_TAB);
708 forward_nav_observer.Wait(); 708 forward_nav_observer.Wait();
709 } 709 }
710 710
711 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); 711 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX));
712 } 712 }
713 713
714 } // namespace 714 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698