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

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

Issue 1187273004: Pass MotionEvent tilt angles to Blink on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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/time/time.h" 7 #include "base/time/time.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "ui/events/gesture_detection/motion_event_buffer.h" 9 #include "ui/events/gesture_detection/motion_event_buffer.h"
10 #include "ui/events/test/motion_event_test_utils.h" 10 #include "ui/events/test/motion_event_test_utils.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 int bi = b.FindPointerIndexOfId(a.GetPointerId(i)); 94 int bi = b.FindPointerIndexOfId(a.GetPointerId(i));
95 ASSERT_NE(bi, -1); 95 ASSERT_NE(bi, -1);
96 EXPECT_EQ(a.GetX(i), b.GetX(bi)); 96 EXPECT_EQ(a.GetX(i), b.GetX(bi));
97 EXPECT_EQ(a.GetY(i), b.GetY(bi)); 97 EXPECT_EQ(a.GetY(i), b.GetY(bi));
98 EXPECT_EQ(a.GetRawX(i), b.GetRawX(bi)); 98 EXPECT_EQ(a.GetRawX(i), b.GetRawX(bi));
99 EXPECT_EQ(a.GetRawY(i), b.GetRawY(bi)); 99 EXPECT_EQ(a.GetRawY(i), b.GetRawY(bi));
100 EXPECT_EQ(a.GetTouchMajor(i), b.GetTouchMajor(bi)); 100 EXPECT_EQ(a.GetTouchMajor(i), b.GetTouchMajor(bi));
101 EXPECT_EQ(a.GetTouchMinor(i), b.GetTouchMinor(bi)); 101 EXPECT_EQ(a.GetTouchMinor(i), b.GetTouchMinor(bi));
102 EXPECT_EQ(a.GetOrientation(i), b.GetOrientation(bi)); 102 EXPECT_EQ(a.GetOrientation(i), b.GetOrientation(bi));
103 EXPECT_EQ(a.GetPressure(i), b.GetPressure(bi)); 103 EXPECT_EQ(a.GetPressure(i), b.GetPressure(bi));
104 EXPECT_EQ(a.GetTilt(i), b.GetTilt(bi));
104 EXPECT_EQ(a.GetToolType(i), b.GetToolType(bi)); 105 EXPECT_EQ(a.GetToolType(i), b.GetToolType(bi));
105 } 106 }
106 107
107 if (ignore_history) 108 if (ignore_history)
108 return; 109 return;
109 110
110 ASSERT_EQ(a.GetHistorySize(), b.GetHistorySize()); 111 ASSERT_EQ(a.GetHistorySize(), b.GetHistorySize());
111 for (size_t h = 0; h < a.GetHistorySize(); ++h) 112 for (size_t h = 0; h < a.GetHistorySize(); ++h)
112 ExpectEqualsHistoryIndex(a, h, b); 113 ExpectEqualsHistoryIndex(a, h, b);
113 } 114 }
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 TEST_F(MotionEventBufferTest, Resampling150to60) { 865 TEST_F(MotionEventBufferTest, Resampling150to60) {
865 base::TimeDelta flush_time_delta = 866 base::TimeDelta flush_time_delta =
866 base::TimeDelta::FromMillisecondsD(1000. / 60.); 867 base::TimeDelta::FromMillisecondsD(1000. / 60.);
867 base::TimeDelta event_time_delta = 868 base::TimeDelta event_time_delta =
868 base::TimeDelta::FromMillisecondsD(1000. / 150.); 869 base::TimeDelta::FromMillisecondsD(1000. / 150.);
869 870
870 RunResample(flush_time_delta, event_time_delta); 871 RunResample(flush_time_delta, event_time_delta);
871 } 872 }
872 873
873 } // namespace ui 874 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698