| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1791 EXPECT_EQ(gfx::Range(4, 7), textfield_->GetSelectedRange()); | 1791 EXPECT_EQ(gfx::Range(4, 7), textfield_->GetSelectedRange()); |
| 1792 | 1792 |
| 1793 // Drag the mouse to the beginning of the textfield. | 1793 // Drag the mouse to the beginning of the textfield. |
| 1794 ui::MouseEvent drag_event(ui::ET_MOUSE_DRAGGED, beginning, beginning, | 1794 ui::MouseEvent drag_event(ui::ET_MOUSE_DRAGGED, beginning, beginning, |
| 1795 ui::EF_LEFT_MOUSE_BUTTON, 0); | 1795 ui::EF_LEFT_MOUSE_BUTTON, 0); |
| 1796 textfield_->OnMouseDragged(drag_event); | 1796 textfield_->OnMouseDragged(drag_event); |
| 1797 EXPECT_EQ(gfx::Range(7, 0), textfield_->GetSelectedRange()); | 1797 EXPECT_EQ(gfx::Range(7, 0), textfield_->GetSelectedRange()); |
| 1798 } | 1798 } |
| 1799 | 1799 |
| 1800 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 1800 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 1801 TEST_F(TextfieldTest, SelectionClipboard) { | 1801 // flaky: http://crbug.com/396477 |
| 1802 TEST_F(TextfieldTest, DISABLED_SelectionClipboard) { |
| 1802 InitTextfield(); | 1803 InitTextfield(); |
| 1803 textfield_->SetText(ASCIIToUTF16("0123")); | 1804 textfield_->SetText(ASCIIToUTF16("0123")); |
| 1804 gfx::Point point_1(GetCursorPositionX(1), 0); | 1805 gfx::Point point_1(GetCursorPositionX(1), 0); |
| 1805 gfx::Point point_2(GetCursorPositionX(2), 0); | 1806 gfx::Point point_2(GetCursorPositionX(2), 0); |
| 1806 gfx::Point point_3(GetCursorPositionX(3), 0); | 1807 gfx::Point point_3(GetCursorPositionX(3), 0); |
| 1807 gfx::Point point_4(GetCursorPositionX(4), 0); | 1808 gfx::Point point_4(GetCursorPositionX(4), 0); |
| 1808 | 1809 |
| 1809 // Text selected by the mouse should be placed on the selection clipboard. | 1810 // Text selected by the mouse should be placed on the selection clipboard. |
| 1810 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, point_1, point_1, | 1811 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, point_1, point_1, |
| 1811 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); | 1812 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2016 TextfieldDestroyerController controller(textfield_); | 2017 TextfieldDestroyerController controller(textfield_); |
| 2017 EXPECT_TRUE(controller.target()); | 2018 EXPECT_TRUE(controller.target()); |
| 2018 | 2019 |
| 2019 // Send a key to trigger OnKeyEvent(). | 2020 // Send a key to trigger OnKeyEvent(). |
| 2020 SendKeyEvent('X'); | 2021 SendKeyEvent('X'); |
| 2021 | 2022 |
| 2022 EXPECT_FALSE(controller.target()); | 2023 EXPECT_FALSE(controller.target()); |
| 2023 } | 2024 } |
| 2024 | 2025 |
| 2025 } // namespace views | 2026 } // namespace views |
| OLD | NEW |