OLD | NEW |
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 <math.h> | 5 #include <math.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 event = &wheel; | 73 event = &wheel; |
74 } | 74 } |
75 CHECK(event); | 75 CHECK(event); |
76 event->type = type; | 76 event->type = type; |
77 return *event; | 77 return *event; |
78 } | 78 } |
79 | 79 |
80 bool GetIsShortcutFromHandleInputEventMessage(const IPC::Message* msg) { | 80 bool GetIsShortcutFromHandleInputEventMessage(const IPC::Message* msg) { |
81 InputMsg_HandleInputEvent::Schema::Param param; | 81 InputMsg_HandleInputEvent::Schema::Param param; |
82 InputMsg_HandleInputEvent::Read(msg, ¶m); | 82 InputMsg_HandleInputEvent::Read(msg, ¶m); |
83 return param.c; | 83 return get<2>(param); |
84 } | 84 } |
85 | 85 |
86 template<typename MSG_T, typename ARG_T1> | 86 template<typename MSG_T, typename ARG_T1> |
87 void ExpectIPCMessageWithArg1(const IPC::Message* msg, const ARG_T1& arg1) { | 87 void ExpectIPCMessageWithArg1(const IPC::Message* msg, const ARG_T1& arg1) { |
88 ASSERT_EQ(MSG_T::ID, msg->type()); | 88 ASSERT_EQ(MSG_T::ID, msg->type()); |
89 typename MSG_T::Schema::Param param; | 89 typename MSG_T::Schema::Param param; |
90 ASSERT_TRUE(MSG_T::Read(msg, ¶m)); | 90 ASSERT_TRUE(MSG_T::Read(msg, ¶m)); |
91 EXPECT_EQ(arg1, param.a); | 91 EXPECT_EQ(arg1, get<0>(param)); |
92 } | 92 } |
93 | 93 |
94 template<typename MSG_T, typename ARG_T1, typename ARG_T2> | 94 template<typename MSG_T, typename ARG_T1, typename ARG_T2> |
95 void ExpectIPCMessageWithArg2(const IPC::Message* msg, | 95 void ExpectIPCMessageWithArg2(const IPC::Message* msg, |
96 const ARG_T1& arg1, | 96 const ARG_T1& arg1, |
97 const ARG_T2& arg2) { | 97 const ARG_T2& arg2) { |
98 ASSERT_EQ(MSG_T::ID, msg->type()); | 98 ASSERT_EQ(MSG_T::ID, msg->type()); |
99 typename MSG_T::Schema::Param param; | 99 typename MSG_T::Schema::Param param; |
100 ASSERT_TRUE(MSG_T::Read(msg, ¶m)); | 100 ASSERT_TRUE(MSG_T::Read(msg, ¶m)); |
101 EXPECT_EQ(arg1, param.a); | 101 EXPECT_EQ(arg1, get<0>(param)); |
102 EXPECT_EQ(arg2, param.b); | 102 EXPECT_EQ(arg2, get<1>(param)); |
103 } | 103 } |
104 | 104 |
105 #if defined(USE_AURA) | 105 #if defined(USE_AURA) |
106 bool TouchEventsAreEquivalent(const ui::TouchEvent& first, | 106 bool TouchEventsAreEquivalent(const ui::TouchEvent& first, |
107 const ui::TouchEvent& second) { | 107 const ui::TouchEvent& second) { |
108 if (first.type() != second.type()) | 108 if (first.type() != second.type()) |
109 return false; | 109 return false; |
110 if (first.location() != second.location()) | 110 if (first.location() != second.location()) |
111 return false; | 111 return false; |
112 if (first.touch_id() != second.touch_id()) | 112 if (first.touch_id() != second.touch_id()) |
(...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1899 client_overscroll = client_->GetAndResetOverscroll(); | 1899 client_overscroll = client_->GetAndResetOverscroll(); |
1900 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, | 1900 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, |
1901 client_overscroll.accumulated_overscroll); | 1901 client_overscroll.accumulated_overscroll); |
1902 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, | 1902 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, |
1903 client_overscroll.latest_overscroll_delta); | 1903 client_overscroll.latest_overscroll_delta); |
1904 EXPECT_EQ(wheel_overscroll.current_fling_velocity, | 1904 EXPECT_EQ(wheel_overscroll.current_fling_velocity, |
1905 client_overscroll.current_fling_velocity); | 1905 client_overscroll.current_fling_velocity); |
1906 } | 1906 } |
1907 | 1907 |
1908 } // namespace content | 1908 } // namespace content |
OLD | NEW |