OLD | NEW |
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 #if defined(OS_MACOSX) | 190 #if defined(OS_MACOSX) |
191 #define MAYBE_ClickingMovesFocus DISABLED_ClickingMovesFocus | 191 #define MAYBE_ClickingMovesFocus DISABLED_ClickingMovesFocus |
192 #else | 192 #else |
193 #define MAYBE_ClickingMovesFocus ClickingMovesFocus | 193 #define MAYBE_ClickingMovesFocus ClickingMovesFocus |
194 #endif | 194 #endif |
195 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) { | 195 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, MAYBE_ClickingMovesFocus) { |
196 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 196 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
197 #if defined(OS_POSIX) | 197 #if defined(OS_POSIX) |
198 // It seems we have to wait a little bit for the widgets to spin up before | 198 // It seems we have to wait a little bit for the widgets to spin up before |
199 // we can start clicking on them. | 199 // we can start clicking on them. |
200 base::MessageLoop::current()->PostDelayedTask( | 200 base::MessageLoop::current()->task_runner()->PostDelayedTask( |
201 FROM_HERE, | 201 FROM_HERE, base::MessageLoop::QuitClosure(), |
202 base::MessageLoop::QuitClosure(), | |
203 base::TimeDelta::FromMilliseconds(kActionDelayMs)); | 202 base::TimeDelta::FromMilliseconds(kActionDelayMs)); |
204 content::RunMessageLoop(); | 203 content::RunMessageLoop(); |
205 #endif // defined(OS_POSIX) | 204 #endif // defined(OS_POSIX) |
206 | 205 |
207 ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); | 206 ASSERT_TRUE(IsViewFocused(VIEW_ID_OMNIBOX)); |
208 | 207 |
209 ClickOnView(VIEW_ID_TAB_CONTAINER); | 208 ClickOnView(VIEW_ID_TAB_CONTAINER); |
210 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 209 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
211 | 210 |
212 ClickOnView(VIEW_ID_OMNIBOX); | 211 ClickOnView(VIEW_ID_OMNIBOX); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 699 content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
701 content::NotificationService::AllSources()); | 700 content::NotificationService::AllSources()); |
702 chrome::GoForward(browser(), CURRENT_TAB); | 701 chrome::GoForward(browser(), CURRENT_TAB); |
703 forward_nav_observer.Wait(); | 702 forward_nav_observer.Wait(); |
704 } | 703 } |
705 | 704 |
706 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); | 705 EXPECT_FALSE(IsViewFocused(VIEW_ID_OMNIBOX)); |
707 } | 706 } |
708 | 707 |
709 } // namespace | 708 } // namespace |
OLD | NEW |