OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/keyboard_codes.h" | 5 #include "base/keyboard_codes.h" |
6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
8 #include "chrome/browser/automation/ui_controls.h" | 8 #include "chrome/browser/automation/ui_controls.h" |
9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
10 #include "chrome/browser/browser_window.h" | 10 #include "chrome/browser/browser_window.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 EXPECT_TRUE(WidgetInFocusChain(GTK_WIDGET(window), widget)) << | 74 EXPECT_TRUE(WidgetInFocusChain(GTK_WIDGET(window), widget)) << |
75 "For view id " << vid; | 75 "For view id " << vid; |
76 #else | 76 #else |
77 NOTIMPLEMENTED(); | 77 NOTIMPLEMENTED(); |
78 #endif | 78 #endif |
79 } | 79 } |
80 | 80 |
81 void ClickOnView(ViewID vid) { | 81 void ClickOnView(ViewID vid) { |
82 BrowserWindow* browser_window = browser()->window(); | 82 BrowserWindow* browser_window = browser()->window(); |
83 ASSERT_TRUE(browser_window); | 83 ASSERT_TRUE(browser_window); |
84 #if defined(OS_WIN) | 84 #if defined(TOOLKIT_VIEWS) |
85 views::View* view = | 85 views::View* view = |
86 reinterpret_cast<BrowserView*>(browser_window)->GetViewByID(vid); | 86 reinterpret_cast<BrowserView*>(browser_window)->GetViewByID(vid); |
87 #elif defined(OS_LINUX) | 87 #elif defined(OS_LINUX) |
88 gfx::NativeWindow window = browser_window->GetNativeHandle(); | 88 gfx::NativeWindow window = browser_window->GetNativeHandle(); |
89 ASSERT_TRUE(window); | 89 ASSERT_TRUE(window); |
90 GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), vid); | 90 GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), vid); |
91 #endif | 91 #endif |
92 ASSERT_TRUE(view); | 92 ASSERT_TRUE(view); |
93 ui_controls::MoveMouseToCenterAndPress( | 93 ui_controls::MoveMouseToCenterAndPress( |
94 view, | 94 view, |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 | 702 |
703 // Open a regular page, crash, reload. | 703 // Open a regular page, crash, reload. |
704 ui_test_utils::NavigateToURL(browser(), server->TestServerPageW(kSimplePage)); | 704 ui_test_utils::NavigateToURL(browser(), server->TestServerPageW(kSimplePage)); |
705 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); | 705 ui_test_utils::CrashTab(browser()->GetSelectedTabContents()); |
706 browser()->Reload(); | 706 browser()->Reload(); |
707 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); | 707 ASSERT_TRUE(ui_test_utils::WaitForNavigationInCurrentTab(browser())); |
708 // Focus should now be on the tab contents. | 708 // Focus should now be on the tab contents. |
709 browser()->ShowDownloadsTab(); | 709 browser()->ShowDownloadsTab(); |
710 CheckViewHasFocus(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW); | 710 CheckViewHasFocus(VIEW_ID_TAB_CONTAINER_FOCUS_VIEW); |
711 } | 711 } |
OLD | NEW |