Index: chrome/browser/ui/omnibox/omnibox_view_browsertest.cc |
diff --git a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc |
index e54078f2db3e5eca910aa80c719fd99e11b40150..429a083cd144dda92e46e44a93f3a0e0ebddb83e 100644 |
--- a/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc |
+++ b/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc |
@@ -50,10 +50,6 @@ |
#include <gtk/gtk.h> |
#endif |
-#if defined(TOOLKIT_VIEWS) |
-#include "chrome/browser/ui/views/frame/browser_view.h" |
-#endif |
- |
using base::Time; |
using base::TimeDelta; |
@@ -1256,40 +1252,6 @@ class OmniboxViewTest : public InProcessBrowserTest, |
// Inline autocomplete should still be there. |
EXPECT_EQ(old_text, omnibox_view->GetText()); |
} |
- |
-#if defined(TOOLKIT_VIEWS) |
- const BrowserView* GetBrowserView() const { |
- return BrowserView::GetBrowserViewForBrowser(browser()); |
- } |
- |
- // Move the mouse to the center of the browser window and left-click. |
- void ClickBrowserWindowCenter() { |
- ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( |
- GetBrowserView()->GetBoundsInScreen().CenterPoint())); |
- ASSERT_TRUE(ui_test_utils::SendMouseEventsSync( |
- ui_controls::LEFT, ui_controls::DOWN)); |
- ASSERT_TRUE(ui_test_utils::SendMouseEventsSync( |
- ui_controls::LEFT, ui_controls::UP)); |
- } |
- |
- // Press and release the mouse in the omnibox at an offset from its origin. |
- // If |release_offset| differs from |press_offset|, the mouse will be moved |
- // between the press and release. |
- void ClickOmnibox(ui_controls::MouseButton button, |
- const gfx::Vector2d& press_offset, |
- const gfx::Vector2d& release_offset) { |
- const views::View* omnibox = GetBrowserView()->GetViewByID(VIEW_ID_OMNIBOX); |
- gfx::Point omnibox_origin = omnibox->GetBoundsInScreen().origin(); |
- gfx::Point press_point = omnibox_origin + press_offset; |
- ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(press_point)); |
- ASSERT_TRUE(ui_test_utils::SendMouseEventsSync(button, ui_controls::DOWN)); |
- |
- gfx::Point release_point = omnibox_origin + release_offset; |
- if (release_point != press_point) |
- ASSERT_TRUE(ui_test_utils::SendMouseMoveSync(release_point)); |
- ASSERT_TRUE(ui_test_utils::SendMouseEventsSync(button, ui_controls::UP)); |
- } |
-#endif // defined(TOOLKIT_VIEWS) |
}; |
// Test if ctrl-* accelerators are workable in omnibox. |
@@ -1622,56 +1584,6 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewTest, Paste) { |
EXPECT_TRUE(popup_model->IsOpen()); |
} |
-#if defined(TOOLKIT_VIEWS) |
-IN_PROC_BROWSER_TEST_F(OmniboxViewTest, SelectAllOnClick) { |
- OmniboxView* omnibox_view = NULL; |
- ASSERT_NO_FATAL_FAILURE(GetOmniboxView(&omnibox_view)); |
- omnibox_view->SetUserText(ASCIIToUTF16("http://www.google.com/")); |
- const gfx::Vector2d click(40, 10); |
- |
- // Take the focus away from the omnibox. |
- ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); |
- EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_FALSE(omnibox_view->IsSelectAll()); |
- |
- // Clicking in the omnibox should take focus and select all text. |
- ASSERT_NO_FATAL_FAILURE(ClickOmnibox(ui_controls::LEFT, click, click)); |
- EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_TRUE(omnibox_view->IsSelectAll()); |
- |
- // Clicking in another view should clear focus and the selection. |
- ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); |
- EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_FALSE(omnibox_view->IsSelectAll()); |
- |
- // Clicking in the omnibox again should take focus and select all text again. |
- ASSERT_NO_FATAL_FAILURE(ClickOmnibox(ui_controls::LEFT, click, click)); |
- EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_TRUE(omnibox_view->IsSelectAll()); |
- |
- // Clicking another omnibox spot should keep focus but clear the selection. |
- omnibox_view->SelectAll(false); |
- const gfx::Vector2d click_2(click.x() + 10, click.y()); |
- ASSERT_NO_FATAL_FAILURE(ClickOmnibox(ui_controls::LEFT, click_2, click_2)); |
- EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_FALSE(omnibox_view->IsSelectAll()); |
- |
- // Take the focus away and click in the omnibox again, but drag a bit before |
- // releasing. We should focus the omnibox but not select all of its text. |
- ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); |
- const gfx::Vector2d release(click.x() + 10, click.y()); |
- ASSERT_NO_FATAL_FAILURE(ClickOmnibox(ui_controls::LEFT, click, release)); |
- EXPECT_TRUE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_FALSE(omnibox_view->IsSelectAll()); |
- |
- // Middle-clicking should not be handled by the omnibox. |
- ASSERT_NO_FATAL_FAILURE(ClickBrowserWindowCenter()); |
- ASSERT_NO_FATAL_FAILURE(ClickOmnibox(ui_controls::MIDDLE, click, click)); |
- EXPECT_FALSE(ui_test_utils::IsViewFocused(browser(), VIEW_ID_OMNIBOX)); |
- EXPECT_FALSE(omnibox_view->IsSelectAll()); |
-} |
-#endif // defined(TOOLKIT_VIEWS) |
- |
IN_PROC_BROWSER_TEST_F(OmniboxViewTest, CopyURLToClipboard) { |
// Set permanent text thus making sure that omnibox treats 'google.com' |
// as URL (not as ordinary user input). |