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 "ui/aura/root_window.h" | 5 #include "ui/aura/root_window.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "ui/aura/client/event_client.h" | 10 #include "ui/aura/client/event_client.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 virtual bool PreHandleKeyEvent(Window* target, ui::KeyEvent* event) OVERRIDE { | 84 virtual bool PreHandleKeyEvent(Window* target, ui::KeyEvent* event) OVERRIDE { |
85 num_key_events_++; | 85 num_key_events_++; |
86 return true; | 86 return true; |
87 } | 87 } |
88 virtual bool PreHandleMouseEvent(Window* target, | 88 virtual bool PreHandleMouseEvent(Window* target, |
89 ui::MouseEvent* event) OVERRIDE { | 89 ui::MouseEvent* event) OVERRIDE { |
90 num_mouse_events_++; | 90 num_mouse_events_++; |
91 return true; | 91 return true; |
92 } | 92 } |
93 virtual ui::TouchStatus PreHandleTouchEvent( | 93 virtual ui::TouchStatus PreHandleTouchEvent( |
94 Window* target, ui::TouchEventImpl* event) OVERRIDE { | 94 Window* target, ui::TouchEvent* event) OVERRIDE { |
95 return ui::TOUCH_STATUS_UNKNOWN; | 95 return ui::TOUCH_STATUS_UNKNOWN; |
96 } | 96 } |
97 virtual ui::GestureStatus PreHandleGestureEvent( | 97 virtual ui::GestureStatus PreHandleGestureEvent( |
98 Window* target, ui::GestureEventImpl* event) OVERRIDE { | 98 Window* target, ui::GestureEventImpl* event) OVERRIDE { |
99 return ui::GESTURE_STATUS_UNKNOWN; | 99 return ui::GESTURE_STATUS_UNKNOWN; |
100 } | 100 } |
101 | 101 |
102 private: | 102 private: |
103 // How many key events have been received? | 103 // How many key events have been received? |
104 int num_key_events_; | 104 int num_key_events_; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 events_.push_back(event->type()); | 361 events_.push_back(event->type()); |
362 return true; | 362 return true; |
363 } | 363 } |
364 virtual bool PreHandleMouseEvent(Window* target, | 364 virtual bool PreHandleMouseEvent(Window* target, |
365 ui::MouseEvent* event) OVERRIDE { | 365 ui::MouseEvent* event) OVERRIDE { |
366 events_.push_back(event->type()); | 366 events_.push_back(event->type()); |
367 return true; | 367 return true; |
368 } | 368 } |
369 virtual ui::TouchStatus PreHandleTouchEvent( | 369 virtual ui::TouchStatus PreHandleTouchEvent( |
370 Window* target, | 370 Window* target, |
371 ui::TouchEventImpl* event) OVERRIDE { | 371 ui::TouchEvent* event) OVERRIDE { |
372 events_.push_back(event->type()); | 372 events_.push_back(event->type()); |
373 return ui::TOUCH_STATUS_UNKNOWN; | 373 return ui::TOUCH_STATUS_UNKNOWN; |
374 } | 374 } |
375 virtual ui::GestureStatus PreHandleGestureEvent( | 375 virtual ui::GestureStatus PreHandleGestureEvent( |
376 Window* target, | 376 Window* target, |
377 ui::GestureEventImpl* event) OVERRIDE { | 377 ui::GestureEventImpl* event) OVERRIDE { |
378 events_.push_back(event->type()); | 378 events_.push_back(event->type()); |
379 return ui::GESTURE_STATUS_UNKNOWN; | 379 return ui::GESTURE_STATUS_UNKNOWN; |
380 } | 380 } |
381 | 381 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 root_window()->ReleaseMouseMoves(); | 538 root_window()->ReleaseMouseMoves(); |
539 root_window()->AsRootWindowHostDelegate()->OnHostMouseEvent( | 539 root_window()->AsRootWindowHostDelegate()->OnHostMouseEvent( |
540 &mouse_dragged_event2); | 540 &mouse_dragged_event2); |
541 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); | 541 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); |
542 filter->events().clear(); | 542 filter->events().clear(); |
543 RunAllPendingInMessageLoop(); | 543 RunAllPendingInMessageLoop(); |
544 EXPECT_TRUE(filter->events().empty()); | 544 EXPECT_TRUE(filter->events().empty()); |
545 } | 545 } |
546 | 546 |
547 } // namespace aura | 547 } // namespace aura |
OLD | NEW |