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

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

Issue 22865036: Add support for reposting the ET_GESTURE_TAP_DOWN gesture event to the RootWindow and in the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 months 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
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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after
875 875
876 // Tap on w2 which triggers nested gestures for w1. 876 // Tap on w2 which triggers nested gestures for w1.
877 test::EventGenerator generator(root_window(), w2.get()); 877 test::EventGenerator generator(root_window(), w2.get());
878 generator.GestureTapAt(w2->bounds().CenterPoint()); 878 generator.GestureTapAt(w2->bounds().CenterPoint());
879 879
880 // Both windows should get their gesture end events. 880 // Both windows should get their gesture end events.
881 EXPECT_EQ(1, d1.gesture_end_count()); 881 EXPECT_EQ(1, d1.gesture_end_count());
882 EXPECT_EQ(1, d2.gesture_end_count()); 882 EXPECT_EQ(1, d2.gesture_end_count());
883 } 883 }
884 884
885 // Tests whether we can repost the Tap down gesture event.
886 TEST_F(RootWindowTest, RepostTapdownGestureTest) {
887 EventFilterRecorder* filter = new EventFilterRecorder;
888 root_window()->SetEventFilter(filter); // passes ownership
889
890 test::TestWindowDelegate delegate;
891 scoped_ptr<aura::Window> window(CreateTestWindowWithDelegate(
892 &delegate, 1, gfx::Rect(0, 0, 100, 100), root_window()));
893
894 ui::GestureEventDetails details(ui::ET_GESTURE_TAP_DOWN, 0.0f, 0.0f);
895 gfx::Point point(10, 10);
896 ui::GestureEvent event(
897 ui::ET_GESTURE_TAP_DOWN,
898 point.x(),
899 point.y(),
900 0,
901 ui::EventTimeForNow(),
902 details,
903 0);
904 root_window()->RepostEvent(event);
905 RunAllPendingInMessageLoop();
906 EXPECT_TRUE(EventTypesToString(filter->events()).find("GESTURE_TAP_DOWN") !=
907 std::string::npos);
908 filter->events().clear();
sadrul 2013/08/23 03:16:03 An interesting test would be to generate a Tap, or
909 }
910
885 } // namespace aura 911 } // namespace aura
OLDNEW
« ui/aura/root_window.cc ('K') | « ui/aura/root_window.cc ('k') | ui/base/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698