| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |