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

Side by Side Diff: ui/events/blink/input_handler_proxy_unittest.cc

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Created 4 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 }; 66 };
67 static const InputHandlerProxyTestType test_types[] = { 67 static const InputHandlerProxyTestType test_types[] = {
68 ROOT_SCROLL_NORMAL_HANDLER, ROOT_SCROLL_SYNCHRONOUS_HANDLER, 68 ROOT_SCROLL_NORMAL_HANDLER, ROOT_SCROLL_SYNCHRONOUS_HANDLER,
69 CHILD_SCROLL_NORMAL_HANDLER, CHILD_SCROLL_SYNCHRONOUS_HANDLER}; 69 CHILD_SCROLL_NORMAL_HANDLER, CHILD_SCROLL_SYNCHRONOUS_HANDLER};
70 70
71 double InSecondsF(const base::TimeTicks& time) { 71 double InSecondsF(const base::TimeTicks& time) {
72 return (time - base::TimeTicks()).InSecondsF(); 72 return (time - base::TimeTicks()).InSecondsF();
73 } 73 }
74 74
75 bool WheelEventsMatch(const WebInputEvent& lhs, const WebInputEvent& rhs) { 75 bool WheelEventsMatch(const WebInputEvent& lhs, const WebInputEvent& rhs) {
76 if (lhs.size == rhs.size && lhs.type == rhs.type && 76 if (lhs.size() == rhs.size() && lhs.type() == rhs.type() &&
77 lhs.type == WebInputEvent::MouseWheel) { 77 lhs.type() == WebInputEvent::MouseWheel) {
78 WebMouseWheelEvent rhs_timestamped = 78 WebMouseWheelEvent rhs_timestamped =
79 static_cast<const WebMouseWheelEvent&>(rhs); 79 static_cast<const WebMouseWheelEvent&>(rhs);
80 rhs_timestamped.timeStampSeconds = lhs.timeStampSeconds; 80 rhs_timestamped.setTimeStampSeconds(lhs.timeStampSeconds());
81 return memcmp(&rhs_timestamped, &lhs, rhs.size) == 0; 81 return memcmp(&rhs_timestamped, &lhs, rhs.size()) == 0;
82 } 82 }
83 return false; 83 return false;
84 } 84 }
85 85
86 MATCHER_P(WheelEventsMatch, expected, "") { 86 MATCHER_P(WheelEventsMatch, expected, "") {
87 return WheelEventsMatch(arg, expected); 87 return WheelEventsMatch(arg, expected);
88 } 88 }
89 89
90 WebGestureEvent CreateFling(base::TimeTicks timestamp, 90 WebGestureEvent CreateFling(base::TimeTicks timestamp,
91 WebGestureDevice source_device, 91 WebGestureDevice source_device,
(...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after
3082 histogram_tester.ExpectBucketCount(kNonContinuousQueueingTimeHistogram, 70, 3082 histogram_tester.ExpectBucketCount(kNonContinuousQueueingTimeHistogram, 70,
3083 1); 3083 1);
3084 } 3084 }
3085 3085
3086 INSTANTIATE_TEST_CASE_P(AnimateInput, 3086 INSTANTIATE_TEST_CASE_P(AnimateInput,
3087 InputHandlerProxyTest, 3087 InputHandlerProxyTest,
3088 testing::ValuesIn(test_types)); 3088 testing::ValuesIn(test_types));
3089 3089
3090 } // namespace test 3090 } // namespace test
3091 } // namespace ui 3091 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698