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

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

Issue 1160073004: chrome/browser/ui: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for task runner instead of current message loop. Created 5 years, 6 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/location.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/single_thread_task_runner.h"
10 #include "base/strings/stringprintf.h" 11 #include "base/strings/stringprintf.h"
11 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/thread_task_runner_handle.h"
12 #include "chrome/browser/chrome_notification_types.h" 14 #include "chrome/browser/chrome_notification_types.h"
13 #include "chrome/browser/ui/browser.h" 15 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_commands.h" 16 #include "chrome/browser/ui/browser_commands.h"
15 #include "chrome/browser/ui/browser_tabstrip.h" 17 #include "chrome/browser/ui/browser_tabstrip.h"
16 #include "chrome/browser/ui/browser_window.h" 18 #include "chrome/browser/ui/browser_window.h"
17 #include "chrome/browser/ui/chrome_pages.h" 19 #include "chrome/browser/ui/chrome_pages.h"
18 #include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h" 20 #include "chrome/browser/ui/find_bar/find_bar_host_unittest_util.h"
19 #include "chrome/browser/ui/location_bar/location_bar.h" 21 #include "chrome/browser/ui/location_bar/location_bar.h"
20 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 22 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
21 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h" 23 #include "chrome/browser/ui/omnibox/omnibox_edit_model.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 #if defined(OS_MACOSX) 192 #if defined(OS_MACOSX)
191 #define MAYBE_ClickingMovesFocus DISABLED_ClickingMovesFocus 193 #define MAYBE_ClickingMovesFocus DISABLED_ClickingMovesFocus
192 #else 194 #else
193 #define MAYBE_ClickingMovesFocus ClickingMovesFocus 195 #define MAYBE_ClickingMovesFocus ClickingMovesFocus
194 #endif 196 #endif
195 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) { 197 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) {
196 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 198 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
197 #if defined(OS_POSIX) 199 #if defined(OS_POSIX)
198 // It seems we have to wait a little bit for the widgets to spin up before 200 // It seems we have to wait a little bit for the widgets to spin up before
199 // we can start clicking on them. 201 // we can start clicking on them.
200 base::MessageLoop::current()->PostDelayedTask( 202 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
201 FROM_HERE, 203 FROM_HERE, base::MessageLoop::QuitClosure(),
202 base::MessageLoop::QuitClosure(),
203 base::TimeDelta::FromMilliseconds(kActionDelayMs)); 204 base::TimeDelta::FromMilliseconds(kActionDelayMs));
204 content::RunMessageLoop(); 205 content::RunMessageLoop();
205 #endif // defined(OS_POSIX) 206 #endif // defined(OS_POSIX)
206 207
207 ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); 208 ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX));
208 209
209 ClickOnView(VIEW_ID_TAB_CONTAINER); 210 ClickOnView(VIEW_ID_TAB_CONTAINER);
210 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); 211 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER));
211 212
212 ClickOnView(VIEW_ID_OMNIBOX); 213 ClickOnView(VIEW_ID_OMNIBOX);
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 content::NOTIFICATION_NAV_ENTRY_COMMITTED, 701 content::NOTIFICATION_NAV_ENTRY_COMMITTED,
701 content::NotificationService::AllSources()); 702 content::NotificationService::AllSources());
702 chrome::GoForward(browser(), CURRENT_TAB); 703 chrome::GoForward(browser(), CURRENT_TAB);
703 forward_nav_observer.Wait(); 704 forward_nav_observer.Wait();
704 } 705 }
705 706
706 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); 707 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX));
707 } 708 }
708 709
709 } // namespace 710 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698