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

Side by Side Diff: content/common/input/input_param_traits_unittest.cc

Issue 65813002: mac: Prepare most test code for -Wunused-functions too. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | Annotate | Revision Log
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 "content/common/input/input_event.h" 7 #include "content/common/input/input_event.h"
8 #include "content/common/input_messages.h" 8 #include "content/common/input_messages.h"
9 #include "ipc/ipc_message.h" 9 #include "ipc/ipc_message.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "third_party/WebKit/public/web/WebInputEvent.h" 11 #include "third_party/WebKit/public/web/WebInputEvent.h"
12 12
13 namespace content { 13 namespace content {
14 namespace { 14 namespace {
15 15
16 typedef ScopedVector<InputEvent> InputEvents; 16 typedef ScopedVector<InputEvent> InputEvents;
17 17
18 void AddTo(InputEvents& events, const blink::WebInputEvent& event) {
19 events.push_back(new InputEvent(event, ui::LatencyInfo(), false));
20 }
21
22 class InputParamTraitsTest : public testing::Test { 18 class InputParamTraitsTest : public testing::Test {
23 protected: 19 protected:
24 static void Compare(const InputEvent* a, const InputEvent* b) { 20 static void Compare(const InputEvent* a, const InputEvent* b) {
25 EXPECT_EQ(!!a->web_event, !!b->web_event); 21 EXPECT_EQ(!!a->web_event, !!b->web_event);
26 if (a->web_event && b->web_event) { 22 if (a->web_event && b->web_event) {
27 const size_t a_size = a->web_event->size; 23 const size_t a_size = a->web_event->size;
28 ASSERT_EQ(a_size, b->web_event->size); 24 ASSERT_EQ(a_size, b->web_event->size);
29 EXPECT_EQ(0, memcmp(a->web_event.get(), b->web_event.get(), a_size)); 25 EXPECT_EQ(0, memcmp(a->web_event.get(), b->web_event.get(), a_size));
30 } 26 }
31 EXPECT_EQ(a->latency_info.latency_components.size(), 27 EXPECT_EQ(a->latency_info.latency_components.size(),
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 ASSERT_EQ(SyntheticGestureParams::SMOOTH_SCROLL_GESTURE, 167 ASSERT_EQ(SyntheticGestureParams::SMOOTH_SCROLL_GESTURE,
172 gesture_params->GetGestureType()); 168 gesture_params->GetGestureType());
173 SyntheticGesturePacket packet_in; 169 SyntheticGesturePacket packet_in;
174 packet_in.set_gesture_params(gesture_params.PassAs<SyntheticGestureParams>()); 170 packet_in.set_gesture_params(gesture_params.PassAs<SyntheticGestureParams>());
175 171
176 Verify(packet_in); 172 Verify(packet_in);
177 } 173 }
178 174
179 } // namespace 175 } // namespace
180 } // namespace content 176 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/fileapi/sandbox_file_system_backend_unittest.cc ('k') | net/ssl/default_server_bound_cert_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698