| 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |