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" |
11 #include "blimp/net/blimp_message_processor.h" | 11 #include "blimp/net/blimp_message_processor.h" |
12 #include "blimp/net/input_message_converter.h" | 12 #include "blimp/net/input_message_converter.h" |
13 #include "blimp/net/input_message_generator.h" | 13 #include "blimp/net/input_message_generator.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "third_party/WebKit/public/platform/WebGestureDevice.h" | 15 #include "third_party/WebKit/public/platform/WebGestureDevice.h" |
16 #include "third_party/WebKit/public/web/WebInputEvent.h" | 16 #include "third_party/WebKit/public/platform/WebGestureEvent.h" |
17 | 17 |
18 namespace blimp { | 18 namespace blimp { |
19 namespace { | 19 namespace { |
20 | 20 |
21 void ValidateWebGestureEventRoundTripping(const blink::WebGestureEvent& event) { | 21 void ValidateWebGestureEventRoundTripping(const blink::WebGestureEvent& event) { |
22 InputMessageGenerator generator; | 22 InputMessageGenerator generator; |
23 InputMessageConverter processor; | 23 InputMessageConverter processor; |
24 | 24 |
25 std::unique_ptr<BlimpMessage> proto = generator.GenerateMessage(event); | 25 std::unique_ptr<BlimpMessage> proto = generator.GenerateMessage(event); |
26 EXPECT_NE(nullptr, proto.get()); | 26 EXPECT_NE(nullptr, proto.get()); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 TEST(InputMessageTest, TestGestureShowPressRoundTrip) { | 164 TEST(InputMessageTest, TestGestureShowPressRoundTrip) { |
165 blink::WebGestureEvent event = BuildBaseTestEvent(); | 165 blink::WebGestureEvent event = BuildBaseTestEvent(); |
166 event.type = blink::WebGestureEvent::Type::GestureShowPress; | 166 event.type = blink::WebGestureEvent::Type::GestureShowPress; |
167 event.data.showPress.width = 2.3f; | 167 event.data.showPress.width = 2.3f; |
168 event.data.showPress.height = 3.4f; | 168 event.data.showPress.height = 3.4f; |
169 ValidateWebGestureEventRoundTripping(event); | 169 ValidateWebGestureEventRoundTripping(event); |
170 } | 170 } |
171 | 171 |
172 } // namespace blimp | 172 } // namespace blimp |
OLD | NEW |