OLD | NEW |
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 // Needed on Windows to get |M_PI| from <cmath>. | 5 // Needed on Windows to get |M_PI| from <cmath>. |
6 #ifdef _WIN32 | 6 #ifdef _WIN32 |
7 #define _USE_MATH_DEFINES | 7 #define _USE_MATH_DEFINES |
8 #endif | 8 #endif |
9 | 9 |
10 #include <stddef.h> | 10 #include <stddef.h> |
11 | 11 |
12 #include <cmath> | 12 #include <cmath> |
13 | 13 |
14 #include "content/browser/renderer_host/input/web_input_event_util.h" | 14 #include "content/browser/renderer_host/input/web_input_event_util.h" |
15 #include "content/common/input/synthetic_web_input_event_builders.h" | 15 #include "content/common/input/synthetic_web_input_event_builders.h" |
16 #include "content/common/input/web_input_event_traits.h" | 16 #include "content/public/common/input/web_input_event_traits.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 #include "ui/events/blink/blink_event_util.h" | 18 #include "ui/events/blink/blink_event_util.h" |
19 #include "ui/events/event_constants.h" | 19 #include "ui/events/event_constants.h" |
20 #include "ui/events/gesture_detection/gesture_event_data.h" | 20 #include "ui/events/gesture_detection/gesture_event_data.h" |
21 #include "ui/events/gesture_detection/motion_event_generic.h" | 21 #include "ui/events/gesture_detection/motion_event_generic.h" |
22 #include "ui/events/gesture_event_details.h" | 22 #include "ui/events/gesture_event_details.h" |
23 #include "ui/gfx/geometry/safe_integer_conversions.h" | 23 #include "ui/gfx/geometry/safe_integer_conversions.h" |
24 | 24 |
25 using blink::WebInputEvent; | 25 using blink::WebInputEvent; |
26 using blink::WebTouchEvent; | 26 using blink::WebTouchEvent; |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 127 |
128 TEST(WebInputEventUtilTest, NoScalingWith1DSF) { | 128 TEST(WebInputEventUtilTest, NoScalingWith1DSF) { |
129 auto event = | 129 auto event = |
130 SyntheticWebMouseEventBuilder::Build(blink::WebInputEvent::MouseMove, | 130 SyntheticWebMouseEventBuilder::Build(blink::WebInputEvent::MouseMove, |
131 10, 10, 0); | 131 10, 10, 0); |
132 EXPECT_FALSE(ConvertWebInputEventToViewport(event, 1.f)); | 132 EXPECT_FALSE(ConvertWebInputEventToViewport(event, 1.f)); |
133 EXPECT_TRUE(ConvertWebInputEventToViewport(event, 2.f)); | 133 EXPECT_TRUE(ConvertWebInputEventToViewport(event, 2.f)); |
134 } | 134 } |
135 | 135 |
136 } // namespace content | 136 } // namespace content |
OLD | NEW |