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

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: Fix nits Created 3 years, 11 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 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 14 matching lines...) Expand all
25 namespace content { 25 namespace content {
26 namespace { 26 namespace {
27 27
28 typedef ScopedVector<InputEvent> InputEvents; 28 typedef ScopedVector<InputEvent> InputEvents;
29 29
30 class InputParamTraitsTest : public testing::Test { 30 class InputParamTraitsTest : public testing::Test {
31 protected: 31 protected:
32 static void Compare(const InputEvent* a, const InputEvent* b) { 32 static void Compare(const InputEvent* a, const InputEvent* b) {
33 EXPECT_EQ(!!a->web_event, !!b->web_event); 33 EXPECT_EQ(!!a->web_event, !!b->web_event);
34 if (a->web_event && b->web_event) { 34 if (a->web_event && b->web_event) {
35 const size_t a_size = a->web_event->size; 35 const size_t a_size = a->web_event->size();
36 ASSERT_EQ(a_size, b->web_event->size); 36 ASSERT_EQ(a_size, b->web_event->size());
37 EXPECT_EQ(0, memcmp(a->web_event.get(), b->web_event.get(), a_size)); 37 EXPECT_EQ(0, memcmp(a->web_event.get(), b->web_event.get(), a_size));
38 } 38 }
39 EXPECT_EQ(a->latency_info.latency_components().size(), 39 EXPECT_EQ(a->latency_info.latency_components().size(),
40 b->latency_info.latency_components().size()); 40 b->latency_info.latency_components().size());
41 } 41 }
42 42
43 static void Compare(const InputEvents* a, const InputEvents* b) { 43 static void Compare(const InputEvents* a, const InputEvents* b) {
44 for (size_t i = 0; i < a->size(); ++i) 44 for (size_t i = 0; i < a->size(); ++i)
45 Compare((*a)[i], (*b)[i]); 45 Compare((*a)[i], (*b)[i]);
46 } 46 }
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 355
356 ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION_LIST, 356 ASSERT_EQ(SyntheticGestureParams::POINTER_ACTION_LIST,
357 gesture_params->GetGestureType()); 357 gesture_params->GetGestureType());
358 SyntheticGesturePacket packet_in; 358 SyntheticGesturePacket packet_in;
359 packet_in.set_gesture_params(std::move(gesture_params)); 359 packet_in.set_gesture_params(std::move(gesture_params));
360 Verify(packet_in); 360 Verify(packet_in);
361 } 361 }
362 362
363 } // namespace 363 } // namespace
364 } // namespace content 364 } // namespace content
OLDNEW
« no previous file with comments | « content/common/input/input_event_stream_validator.cc ('k') | content/common/input/synthetic_web_input_event_builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698