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 get<2>(param); | 83 return base::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, get<0>(param)); | 91 EXPECT_EQ(arg1, base::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, get<0>(param)); | 101 EXPECT_EQ(arg1, base::get<0>(param)); |
102 EXPECT_EQ(arg2, get<1>(param)); | 102 EXPECT_EQ(arg2, base::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 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 client_overscroll = client_->GetAndResetOverscroll(); | 1831 client_overscroll = client_->GetAndResetOverscroll(); |
1832 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, | 1832 EXPECT_EQ(wheel_overscroll.accumulated_overscroll, |
1833 client_overscroll.accumulated_overscroll); | 1833 client_overscroll.accumulated_overscroll); |
1834 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, | 1834 EXPECT_EQ(wheel_overscroll.latest_overscroll_delta, |
1835 client_overscroll.latest_overscroll_delta); | 1835 client_overscroll.latest_overscroll_delta); |
1836 EXPECT_EQ(wheel_overscroll.current_fling_velocity, | 1836 EXPECT_EQ(wheel_overscroll.current_fling_velocity, |
1837 client_overscroll.current_fling_velocity); | 1837 client_overscroll.current_fling_velocity); |
1838 } | 1838 } |
1839 | 1839 |
1840 } // namespace content | 1840 } // namespace content |
OLD | NEW |