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: content/common/input/input_param_traits_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 "content/common/input/input_param_traits.h" 5 #include "content/common/input/input_param_traits.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 12 matching lines...) Expand all
23 namespace content { 23 namespace content {
24 namespace { 24 namespace {
25 25
26 typedef ScopedVector<InputEvent> InputEvents; 26 typedef ScopedVector<InputEvent> InputEvents;
27 27
28 class InputParamTraitsTest : public testing::Test { 28 class InputParamTraitsTest : public testing::Test {
29 protected: 29 protected:
30 static void Compare(const InputEvent* a, const InputEvent* b) { 30 static void Compare(const InputEvent* a, const InputEvent* b) {
31 EXPECT_EQ(!!a->web_event, !!b->web_event); 31 EXPECT_EQ(!!a->web_event, !!b->web_event);
32 if (a->web_event && b->web_event) { 32 if (a->web_event && b->web_event) {
33 const size_t a_size = a->web_event->size; 33 const size_t a_size = a->web_event->size();
34 ASSERT_EQ(a_size, b->web_event->size); 34 ASSERT_EQ(a_size, b->web_event->size());
35 EXPECT_EQ(0, memcmp(a->web_event.get(), b->web_event.get(), a_size)); 35 EXPECT_EQ(0, memcmp(a->web_event.get(), b->web_event.get(), a_size));
36 } 36 }
37 EXPECT_EQ(a->latency_info.latency_components().size(), 37 EXPECT_EQ(a->latency_info.latency_components().size(),
38 b->latency_info.latency_components().size()); 38 b->latency_info.latency_components().size());
39 } 39 }
40 40
41 static void Compare(const InputEvents* a, const InputEvents* b) { 41 static void Compare(const InputEvents* a, const InputEvents* b) {
42 for (size_t i = 0; i < a->size(); ++i) 42 for (size_t i = 0; i < a->size(); ++i)
43 Compare((*a)[i], (*b)[i]); 43 Compare((*a)[i], (*b)[i]);
44 } 44 }
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 SyntheticGestureParams::TOUCH_INPUT); 326 SyntheticGestureParams::TOUCH_INPUT);
327 ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION, 327 ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION,
328 gesture_params->GetGestureType()); 328 gesture_params->GetGestureType());
329 SyntheticGesturePacket packet_in; 329 SyntheticGesturePacket packet_in;
330 packet_in.set_gesture_params(std::move(gesture_params)); 330 packet_in.set_gesture_params(std::move(gesture_params));
331 Verify(packet_in); 331 Verify(packet_in);
332 } 332 }
333 333
334 } // namespace 334 } // namespace
335 } // namespace content 335 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698