| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |