OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #if defined(OS_WIN) | |
evanm
2010/12/15 02:12:53
I think Brett concluded we should put all these be
Lei Zhang
2010/12/21 05:14:43
Ok, reverted.
| |
8 #include <windows.h> | |
9 #include <Psapi.h> | |
10 #endif | |
11 | |
7 #include "base/file_util.h" | 12 #include "base/file_util.h" |
8 #include "base/format_macros.h" | 13 #include "base/format_macros.h" |
9 #include "base/message_loop.h" | 14 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 15 #include "base/path_service.h" |
11 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
12 #include "base/string_util.h" | 17 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
14 #include "chrome/browser/browser_window.h" | 19 #include "chrome/browser/browser_window.h" |
15 #include "chrome/browser/renderer_host/render_view_host.h" | 20 #include "chrome/browser/renderer_host/render_view_host.h" |
16 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 21 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
35 #if defined(TOOLKIT_VIEWS) | 40 #if defined(TOOLKIT_VIEWS) |
36 #include "chrome/browser/views/frame/browser_view.h" | 41 #include "chrome/browser/views/frame/browser_view.h" |
37 #include "chrome/browser/views/location_bar/location_bar_view.h" | 42 #include "chrome/browser/views/location_bar/location_bar_view.h" |
38 #include "chrome/browser/views/tab_contents/tab_contents_container.h" | 43 #include "chrome/browser/views/tab_contents/tab_contents_container.h" |
39 #endif | 44 #endif |
40 | 45 |
41 #if defined(TOOLKIT_USES_GTK) | 46 #if defined(TOOLKIT_USES_GTK) |
42 #include "chrome/browser/gtk/view_id_util.h" | 47 #include "chrome/browser/gtk/view_id_util.h" |
43 #endif | 48 #endif |
44 | 49 |
45 #if defined(OS_WIN) | |
46 #include <windows.h> | |
47 #include <Psapi.h> | |
48 #endif | |
49 | |
50 #if defined(OS_LINUX) | 50 #if defined(OS_LINUX) |
51 #define MAYBE_FocusTraversal FocusTraversal | 51 #define MAYBE_FocusTraversal FocusTraversal |
52 #define MAYBE_FocusTraversalOnInterstitial FocusTraversalOnInterstitial | 52 #define MAYBE_FocusTraversalOnInterstitial FocusTraversalOnInterstitial |
53 // TODO(jcampan): http://crbug.com/23683 | 53 // TODO(jcampan): http://crbug.com/23683 |
54 #define MAYBE_TabsRememberFocusFindInPage FAILS_TabsRememberFocusFindInPage | 54 #define MAYBE_TabsRememberFocusFindInPage FAILS_TabsRememberFocusFindInPage |
55 #elif defined(OS_MACOSX) | 55 #elif defined(OS_MACOSX) |
56 // TODO(suzhe): http://crbug.com/60973 (following two tests) | 56 // TODO(suzhe): http://crbug.com/60973 (following two tests) |
57 #define MAYBE_FocusTraversal DISABLED_FocusTraversal | 57 #define MAYBE_FocusTraversal DISABLED_FocusTraversal |
58 #define MAYBE_FocusTraversalOnInterstitial DISABLED_FocusTraversalOnInterstitial | 58 #define MAYBE_FocusTraversalOnInterstitial DISABLED_FocusTraversalOnInterstitial |
59 // TODO(suzhe): http://crbug.com/49737 | 59 // TODO(suzhe): http://crbug.com/49737 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 Source<RenderViewHost>(render_view_host()), | 171 Source<RenderViewHost>(render_view_host()), |
172 Details<const bool>(&is_editable_node)); | 172 Details<const bool>(&is_editable_node)); |
173 } | 173 } |
174 | 174 |
175 private: | 175 private: |
176 std::string html_contents_; | 176 std::string html_contents_; |
177 }; | 177 }; |
178 | 178 |
179 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, ClickingMovesFocus) { | 179 IN_PROC_BROWSER_TEST_F(BrowserFocusTest, ClickingMovesFocus) { |
180 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); | 180 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); |
181 #if defined(USE_X11) || defined(OS_MACOSX) | 181 #if defined(OS_POSIX) |
182 // It seems we have to wait a little bit for the widgets to spin up before | 182 // It seems we have to wait a little bit for the widgets to spin up before |
183 // we can start clicking on them. | 183 // we can start clicking on them. |
184 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 184 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
185 new MessageLoop::QuitTask(), | 185 new MessageLoop::QuitTask(), |
186 kActionDelayMs); | 186 kActionDelayMs); |
187 ui_test_utils::RunMessageLoop(); | 187 ui_test_utils::RunMessageLoop(); |
188 #endif | 188 #endif // defined(OS_POSIX) |
189 | 189 |
190 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); | 190 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); |
191 | 191 |
192 ClickOnView(VIEW_ID_TAB_CONTAINER); | 192 ClickOnView(VIEW_ID_TAB_CONTAINER); |
193 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); | 193 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
194 | 194 |
195 ClickOnView(VIEW_ID_LOCATION_BAR); | 195 ClickOnView(VIEW_ID_LOCATION_BAR); |
196 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); | 196 ASSERT_TRUE(IsViewFocused(VIEW_ID_LOCATION_BAR)); |
197 } | 197 } |
198 | 198 |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
833 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); | 833 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); |
834 browser()->Reload(CURRENT_TAB); | 834 browser()->Reload(CURRENT_TAB); |
835 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 835 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
836 | 836 |
837 // Focus should now be on the tab contents. | 837 // Focus should now be on the tab contents. |
838 browser()->ShowDownloadsTab(); | 838 browser()->ShowDownloadsTab(); |
839 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); | 839 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW)); |
840 } | 840 } |
841 | 841 |
842 } // namespace | 842 } // namespace |
OLD | NEW |