| 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 "ash/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
| 6 | 6 |
| 7 #include "ash/drag_drop/drag_drop_tracker.h" | 7 #include "ash/drag_drop/drag_drop_tracker.h" |
| 8 #include "ash/drag_drop/drag_image_view.h" | 8 #include "ash/drag_drop/drag_image_view.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/test/ash_test_base.h" | 10 #include "ash/test/ash_test_base.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 if (i > 0) | 730 if (i > 0) |
| 731 UpdateDragData(&data); | 731 UpdateDragData(&data); |
| 732 generator.MoveMouseBy(0, 1); | 732 generator.MoveMouseBy(0, 1); |
| 733 | 733 |
| 734 // We send a unexpected mouse move event. Note that we cannot use | 734 // We send a unexpected mouse move event. Note that we cannot use |
| 735 // EventGenerator since it implicitly turns these into mouse drag events. | 735 // EventGenerator since it implicitly turns these into mouse drag events. |
| 736 // The DragDropController should simply ignore these events. | 736 // The DragDropController should simply ignore these events. |
| 737 gfx::Point mouse_move_location = drag_view->bounds().CenterPoint(); | 737 gfx::Point mouse_move_location = drag_view->bounds().CenterPoint(); |
| 738 ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, mouse_move_location, | 738 ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, mouse_move_location, |
| 739 mouse_move_location, 0, 0); | 739 mouse_move_location, 0, 0); |
| 740 Shell::GetPrimaryRootWindow()->GetDispatcher()->AsRootWindowHostDelegate()-> | 740 Shell::GetPrimaryRootWindow()->GetDispatcher()->AsWindowTreeHostDelegate()-> |
| 741 OnHostMouseEvent(&mouse_move); | 741 OnHostMouseEvent(&mouse_move); |
| 742 } | 742 } |
| 743 | 743 |
| 744 generator.ReleaseLeftButton(); | 744 generator.ReleaseLeftButton(); |
| 745 | 745 |
| 746 EXPECT_TRUE(drag_drop_controller_->drag_start_received_); | 746 EXPECT_TRUE(drag_drop_controller_->drag_start_received_); |
| 747 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), | 747 EXPECT_EQ(num_drags - 1 - drag_view->VerticalDragThreshold(), |
| 748 drag_drop_controller_->num_drag_updates_); | 748 drag_drop_controller_->num_drag_updates_); |
| 749 EXPECT_TRUE(drag_drop_controller_->drop_received_); | 749 EXPECT_TRUE(drag_drop_controller_->drop_received_); |
| 750 EXPECT_EQ(UTF8ToUTF16("I am being dragged"), | 750 EXPECT_EQ(UTF8ToUTF16("I am being dragged"), |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); | 1078 EXPECT_EQ("405,405", observer.window_location_on_destroying().ToString()); |
| 1079 } | 1079 } |
| 1080 for (aura::Window::Windows::iterator iter = root_windows.begin(); | 1080 for (aura::Window::Windows::iterator iter = root_windows.begin(); |
| 1081 iter != root_windows.end(); ++iter) { | 1081 iter != root_windows.end(); ++iter) { |
| 1082 aura::client::SetDragDropClient(*iter, NULL); | 1082 aura::client::SetDragDropClient(*iter, NULL); |
| 1083 } | 1083 } |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 } // namespace test | 1086 } // namespace test |
| 1087 } // namespace aura | 1087 } // namespace aura |
| OLD | NEW |