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

Side by Side Diff: blimp/net/input_message_unittest.cc

Issue 1975213003: Blimp Client: add support for tap gesture events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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
« no previous file with comments | « blimp/net/input_message_generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <memory> 5 #include <memory>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "blimp/common/proto/blimp_message.pb.h" 9 #include "blimp/common/proto/blimp_message.pb.h"
10 #include "blimp/common/proto/input.pb.h" 10 #include "blimp/common/proto/input.pb.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 TEST(InputMessageConverterTest, TestTextInputTypeToProtoConversion) { 133 TEST(InputMessageConverterTest, TestTextInputTypeToProtoConversion) {
134 for (size_t i = ui::TextInputType::TEXT_INPUT_TYPE_TEXT; 134 for (size_t i = ui::TextInputType::TEXT_INPUT_TYPE_TEXT;
135 i < ui::TextInputType::TEXT_INPUT_TYPE_MAX; i++) { 135 i < ui::TextInputType::TEXT_INPUT_TYPE_MAX; i++) {
136 ui::TextInputType type = static_cast<ui::TextInputType>(i); 136 ui::TextInputType type = static_cast<ui::TextInputType>(i);
137 EXPECT_EQ(type, InputMessageConverter::TextInputTypeFromProto( 137 EXPECT_EQ(type, InputMessageConverter::TextInputTypeFromProto(
138 InputMessageConverter::TextInputTypeToProto(type))); 138 InputMessageConverter::TextInputTypeToProto(type)));
139 } 139 }
140 } 140 }
141 141
142 TEST(InputMessageTest, TestGestureTapDownRoundTrip) {
143 blink::WebGestureEvent event = BuildBaseTestEvent();
144 event.type = blink::WebGestureEvent::Type::GestureTapDown;
145 event.data.tapDown.width = 2.3f;
146 event.data.tapDown.height = 3.4f;
147 ValidateWebGestureEventRoundTripping(event);
148 }
149
150 TEST(InputMessageTest, TestGestureTapCancelRoundTrip) {
151 blink::WebGestureEvent event = BuildBaseTestEvent();
152 event.type = blink::WebGestureEvent::Type::GestureTapCancel;
153 ValidateWebGestureEventRoundTripping(event);
154 }
155
156 TEST(InputMessageTest, TestGestureTapUnconfirmedRoundTrip) {
157 blink::WebGestureEvent event = BuildBaseTestEvent();
158 event.type = blink::WebGestureEvent::Type::GestureTapUnconfirmed;
159 event.data.tap.tapCount = 2;
160 event.data.tap.width = 2.3f;
161 event.data.tap.height = 3.4f;
162 ValidateWebGestureEventRoundTripping(event);
163 }
164
165 TEST(InputMessageTest, TestGestureShowPressRoundTrip) {
166 blink::WebGestureEvent event = BuildBaseTestEvent();
167 event.type = blink::WebGestureEvent::Type::GestureShowPress;
168 event.data.showPress.width = 2.3f;
169 event.data.showPress.height = 3.4f;
170 ValidateWebGestureEventRoundTripping(event);
171 }
172
142 } // namespace blimp 173 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/net/input_message_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698