OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/events/blink/blink_event_util.h" | 5 #include "ui/events/blink/blink_event_util.h" |
6 | 6 |
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 "third_party/WebKit/public/web/WebInputEvent.h" | 9 #include "third_party/WebKit/public/web/WebInputEvent.h" |
10 #include "ui/events/gesture_event_details.h" | 10 #include "ui/events/gesture_event_details.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 using BlinkEventUtilTest = testing::Test; | 14 using BlinkEventUtilTest = testing::Test; |
15 | 15 |
16 TEST(BlinkEventUtilTest, NoScalingWith1DSF) { | 16 TEST(BlinkEventUtilTest, NoScalingWith1DSF) { |
17 ui::GestureEventDetails details(ui::ET_GESTURE_SCROLL_UPDATE, 1, 1); | 17 ui::GestureEventDetails details(ui::ET_GESTURE_SCROLL_UPDATE, 1, 1); |
18 details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN); | 18 details.set_device_type(ui::GestureDeviceType::DEVICE_TOUCHSCREEN); |
19 auto event = | 19 auto event = |
20 CreateWebGestureEvent(details, base::TimeDelta::FromMilliseconds(1), | 20 CreateWebGestureEvent(details, |
21 gfx::PointF(1.f, 1.f), gfx::PointF(1.f, 1.f), 0); | 21 base::TimeTicks(), |
| 22 gfx::PointF(1.f, 1.f), |
| 23 gfx::PointF(1.f, 1.f), |
| 24 0); |
22 EXPECT_FALSE(ScaleWebInputEvent(event, 1.f)); | 25 EXPECT_FALSE(ScaleWebInputEvent(event, 1.f)); |
23 EXPECT_TRUE(ScaleWebInputEvent(event, 2.f)); | 26 EXPECT_TRUE(ScaleWebInputEvent(event, 2.f)); |
24 } | 27 } |
25 | 28 |
26 } // namespace ui | 29 } // namespace ui |
OLD | NEW |