| 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 4159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4170 view_->InitAsChild(parent.get()); | 4170 view_->InitAsChild(parent.get()); |
| 4171 | 4171 |
| 4172 // Simulate mouse events, ensure they are forwarded to delegate. | 4172 // Simulate mouse events, ensure they are forwarded to delegate. |
| 4173 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 4173 ui::MouseEvent mouse_event(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), |
| 4174 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 4174 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, |
| 4175 0); | 4175 0); |
| 4176 view_->OnMouseEvent(&mouse_event); | 4176 view_->OnMouseEvent(&mouse_event); |
| 4177 EXPECT_EQ("1 0", delegate.GetMouseButtonCountsAndReset()); | 4177 EXPECT_EQ("1 0", delegate.GetMouseButtonCountsAndReset()); |
| 4178 | 4178 |
| 4179 // Simulate mouse events, ensure they are forwarded to delegate. | 4179 // Simulate mouse events, ensure they are forwarded to delegate. |
| 4180 mouse_event = ui::MouseEvent(ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), | 4180 mouse_event = ui::MouseEvent(ui::ET_MOUSE_MOVED, gfx::Point(1, 1), |
| 4181 ui::EventTimeForNow(), 0, 0); | 4181 gfx::Point(), ui::EventTimeForNow(), 0, 0); |
| 4182 view_->OnMouseEvent(&mouse_event); | 4182 view_->OnMouseEvent(&mouse_event); |
| 4183 EXPECT_EQ("0 1 0", delegate.GetMouseMotionCountsAndReset()); | 4183 EXPECT_EQ("0 1 0", delegate.GetMouseMotionCountsAndReset()); |
| 4184 | 4184 |
| 4185 // Lock the mouse, simulate, and ensure they are forwarded. | 4185 // Lock the mouse, simulate, and ensure they are forwarded. |
| 4186 view_->LockMouse(); | 4186 view_->LockMouse(); |
| 4187 | 4187 |
| 4188 mouse_event = | 4188 mouse_event = |
| 4189 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), | 4189 ui::MouseEvent(ui::ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(), |
| 4190 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0); | 4190 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 0); |
| 4191 view_->OnMouseEvent(&mouse_event); | 4191 view_->OnMouseEvent(&mouse_event); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4759 // There is no composition in the beginning. | 4759 // There is no composition in the beginning. |
| 4760 EXPECT_FALSE(has_composition_text()); | 4760 EXPECT_FALSE(has_composition_text()); |
| 4761 SetHasCompositionTextToTrue(); | 4761 SetHasCompositionTextToTrue(); |
| 4762 view->ImeCancelComposition(); | 4762 view->ImeCancelComposition(); |
| 4763 // The composition must have been canceled. | 4763 // The composition must have been canceled. |
| 4764 EXPECT_FALSE(has_composition_text()); | 4764 EXPECT_FALSE(has_composition_text()); |
| 4765 } | 4765 } |
| 4766 } | 4766 } |
| 4767 | 4767 |
| 4768 } // namespace content | 4768 } // namespace content |
| OLD | NEW |