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

Side by Side Diff: ui/events/gesture_detection/gesture_provider_unittest.cc

Issue 401863003: Merge 279991 "[Android] Select text when stylus first button is ..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1985_122/src/
Patch Set: Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "ui/events/event_constants.h" 11 #include "ui/events/event_constants.h"
12 #include "ui/events/gesture_detection/gesture_event_data.h" 12 #include "ui/events/gesture_detection/gesture_event_data.h"
13 #include "ui/events/gesture_detection/gesture_provider.h" 13 #include "ui/events/gesture_detection/gesture_provider.h"
14 #include "ui/events/gesture_detection/mock_motion_event.h"
15 #include "ui/events/gesture_detection/motion_event.h" 14 #include "ui/events/gesture_detection/motion_event.h"
15 #include "ui/events/test/mock_motion_event.h"
16 #include "ui/gfx/geometry/point_f.h" 16 #include "ui/gfx/geometry/point_f.h"
17 17
18 using base::TimeDelta; 18 using base::TimeDelta;
19 using base::TimeTicks; 19 using base::TimeTicks;
20 using ui::test::MockMotionEvent;
20 21
21 namespace ui { 22 namespace ui {
22 namespace { 23 namespace {
23 24
24 const float kFakeCoordX = 42.f; 25 const float kFakeCoordX = 42.f;
25 const float kFakeCoordY = 24.f; 26 const float kFakeCoordY = 24.f;
26 const TimeDelta kOneSecond = TimeDelta::FromSeconds(1); 27 const TimeDelta kOneSecond = TimeDelta::FromSeconds(1);
27 const TimeDelta kOneMicrosecond = TimeDelta::FromMicroseconds(1); 28 const TimeDelta kOneMicrosecond = TimeDelta::FromMicroseconds(1);
28 const TimeDelta kDeltaTimeForFlingSequences = TimeDelta::FromMilliseconds(5); 29 const TimeDelta kDeltaTimeForFlingSequences = TimeDelta::FromMilliseconds(5);
29 const float kMockTouchRadius = MockMotionEvent::TOUCH_MAJOR / 2; 30 const float kMockTouchRadius = MockMotionEvent::TOUCH_MAJOR / 2;
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after
1832 1833
1833 event = ObtainMotionEvent(event_time, MotionEvent::ACTION_CANCEL); 1834 event = ObtainMotionEvent(event_time, MotionEvent::ACTION_CANCEL);
1834 event.pointer_count = 1; 1835 event.pointer_count = 1;
1835 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event)); 1836 EXPECT_TRUE(gesture_provider_->OnTouchEvent(event));
1836 EXPECT_EQ(ET_GESTURE_END, GetMostRecentGestureEventType()); 1837 EXPECT_EQ(ET_GESTURE_END, GetMostRecentGestureEventType());
1837 EXPECT_EQ(12U, GetReceivedGestureCount()); 1838 EXPECT_EQ(12U, GetReceivedGestureCount());
1838 EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points()); 1839 EXPECT_EQ(1, GetMostRecentGestureEvent().details.touch_points());
1839 } 1840 }
1840 1841
1841 } // namespace ui 1842 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698