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

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

Issue 342633003: [Android] Select text when stylus first button is pressed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed signed unsigned comparison error Created 6 years, 6 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
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/time/time.h" 8 #include "base/time/time.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/events/gesture_detection/mock_motion_event.h"
11 #include "ui/events/gesture_detection/velocity_tracker_state.h" 10 #include "ui/events/gesture_detection/velocity_tracker_state.h"
11 #include "ui/events/test/mock_motion_event.h"
12 #include "ui/gfx/geometry/point_f.h" 12 #include "ui/gfx/geometry/point_f.h"
13 #include "ui/gfx/geometry/vector2d_f.h" 13 #include "ui/gfx/geometry/vector2d_f.h"
14 14
15 using base::TimeDelta; 15 using base::TimeDelta;
16 using base::TimeTicks; 16 using base::TimeTicks;
17 using ui::test::MockMotionEvent;
17 18
18 namespace ui { 19 namespace ui {
19 namespace { 20 namespace {
20 21
21 const TimeDelta kTenMillis = TimeDelta::FromMilliseconds(10); 22 const TimeDelta kTenMillis = TimeDelta::FromMilliseconds(10);
22 const TimeDelta kOneSecond = TimeDelta::FromSeconds(1); 23 const TimeDelta kOneSecond = TimeDelta::FromSeconds(1);
23 const float kEpsilson = .01f; 24 const float kEpsilson = .01f;
24 25
25 const char* GetStrategyName(VelocityTracker::Strategy strategy) { 26 const char* GetStrategyName(VelocityTracker::Strategy strategy) {
26 switch (strategy) { 27 switch (strategy) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // The computed velocity should have increased. 185 // The computed velocity should have increased.
185 state.ComputeCurrentVelocity(1000, 20000); 186 state.ComputeCurrentVelocity(1000, 20000);
186 vCurrentY = state.GetYVelocity(0); 187 vCurrentY = state.GetYVelocity(0);
187 EXPECT_LT(vSlow.y(), vCurrentY); 188 EXPECT_LT(vSlow.y(), vCurrentY);
188 EXPECT_LT(vOldY, vCurrentY); 189 EXPECT_LT(vOldY, vCurrentY);
189 } 190 }
190 } 191 }
191 192
192 193
193 } // namespace ui 194 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/touch_disposition_gesture_filter_unittest.cc ('k') | ui/events/test/mock_motion_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698