Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: ui/aura/root_window_unittest.cc

Issue 113283005: aura: Start using EventPrcessor interface for event dispatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/aura/window_targeter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 // Check that on ReleasePointerMoves, held events are not dispatched 624 // Check that on ReleasePointerMoves, held events are not dispatched
625 // immediately, but posted instead. 625 // immediately, but posted instead.
626 dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( 626 dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
627 &mouse_dragged_event); 627 &mouse_dragged_event);
628 dispatcher()->ReleasePointerMoves(); 628 dispatcher()->ReleasePointerMoves();
629 EXPECT_TRUE(filter->events().empty()); 629 EXPECT_TRUE(filter->events().empty());
630 RunAllPendingInMessageLoop(); 630 RunAllPendingInMessageLoop();
631 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events())); 631 EXPECT_EQ("MOUSE_DRAGGED", EventTypesToString(filter->events()));
632 filter->events().clear(); 632 filter->events().clear();
633 633
634 // However if another message comes in before the dispatch, 634 // However if another message comes in before the dispatch of the posted
635 // the Check that on ReleasePointerMoves, held events are not dispatched 635 // event, check that the posted event is dispatched before this new event.
636 // immediately, but posted instead.
637 dispatcher()->HoldPointerMoves(); 636 dispatcher()->HoldPointerMoves();
638 dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( 637 dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
639 &mouse_dragged_event); 638 &mouse_dragged_event);
640 dispatcher()->ReleasePointerMoves(); 639 dispatcher()->ReleasePointerMoves();
641 dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent( 640 dispatcher()->AsRootWindowHostDelegate()->OnHostMouseEvent(
642 &mouse_pressed_event); 641 &mouse_pressed_event);
643 EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED", 642 EXPECT_EQ("MOUSE_DRAGGED MOUSE_PRESSED",
644 EventTypesToString(filter->events())); 643 EventTypesToString(filter->events()));
645 filter->events().clear(); 644 filter->events().clear();
646 RunAllPendingInMessageLoop(); 645 RunAllPendingInMessageLoop();
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 1443
1445 EXPECT_EQ("TOUCH_PRESSED GESTURE_BEGIN GESTURE_TAP_DOWN TOUCH_MOVED " 1444 EXPECT_EQ("TOUCH_PRESSED GESTURE_BEGIN GESTURE_TAP_DOWN TOUCH_MOVED "
1446 "GESTURE_TAP_CANCEL GESTURE_SCROLL_BEGIN GESTURE_SCROLL_UPDATE " 1445 "GESTURE_TAP_CANCEL GESTURE_SCROLL_BEGIN GESTURE_SCROLL_UPDATE "
1447 "TOUCH_CANCELLED GESTURE_SCROLL_END GESTURE_END", 1446 "TOUCH_CANCELLED GESTURE_SCROLL_END GESTURE_END",
1448 EventTypesToString(filter1->events())); 1447 EventTypesToString(filter1->events()));
1449 1448
1450 EXPECT_TRUE(filter2->events().empty()); 1449 EXPECT_TRUE(filter2->events().empty());
1451 } 1450 }
1452 1451
1453 } // namespace aura 1452 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/aura/window_targeter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698