| 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 12 matching lines...) Expand all  Loading... | 
|   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()); | 
|   27   EXPECT_EQ(BlimpMessage::kInput, proto->feature_case()); |   27   EXPECT_EQ(BlimpMessage::kInput, proto->feature_case()); | 
|   28  |   28  | 
|   29   std::unique_ptr<blink::WebGestureEvent> new_event = |   29   std::unique_ptr<blink::WebGestureEvent> new_event = | 
|   30       processor.ProcessMessage(proto->input()); |   30       processor.ProcessMessage(proto->input()); | 
|   31   EXPECT_NE(nullptr, new_event.get()); |   31   EXPECT_NE(nullptr, new_event.get()); | 
|   32  |   32  | 
|   33   EXPECT_EQ(event.size, new_event->size); |   33   EXPECT_EQ(event.size(), new_event->size()); | 
|   34   EXPECT_EQ(0, memcmp(&event, new_event.get(), event.size)); |   34   EXPECT_EQ(0, memcmp(&event, new_event.get(), event.size())); | 
|   35 } |   35 } | 
|   36  |   36  | 
|   37 blink::WebGestureEvent BuildBaseTestEvent(blink::WebInputEvent::Type type) { |   37 blink::WebGestureEvent BuildBaseTestEvent(blink::WebInputEvent::Type type) { | 
|   38   blink::WebGestureEvent event(type, blink::WebInputEvent::NoModifiers, |   38   blink::WebGestureEvent event(type, blink::WebInputEvent::NoModifiers, | 
|   39                                blink::WebInputEvent::TimeStampForTesting); |   39                                blink::WebInputEvent::TimeStampForTesting); | 
|   40   event.x = 2; |   40   event.x = 2; | 
|   41   event.y = 3; |   41   event.y = 3; | 
|   42   event.globalX = 4; |   42   event.globalX = 4; | 
|   43   event.globalY = 5; |   43   event.globalY = 5; | 
|   44   event.sourceDevice = blink::WebGestureDevice::WebGestureDeviceTouchscreen; |   44   event.sourceDevice = blink::WebGestureDevice::WebGestureDeviceTouchscreen; | 
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  164  |  164  | 
|  165 TEST(InputMessageTest, TestGestureShowPressRoundTrip) { |  165 TEST(InputMessageTest, TestGestureShowPressRoundTrip) { | 
|  166   blink::WebGestureEvent event = |  166   blink::WebGestureEvent event = | 
|  167       BuildBaseTestEvent(blink::WebGestureEvent::Type::GestureShowPress); |  167       BuildBaseTestEvent(blink::WebGestureEvent::Type::GestureShowPress); | 
|  168   event.data.showPress.width = 2.3f; |  168   event.data.showPress.width = 2.3f; | 
|  169   event.data.showPress.height = 3.4f; |  169   event.data.showPress.height = 3.4f; | 
|  170   ValidateWebGestureEventRoundTripping(event); |  170   ValidateWebGestureEventRoundTripping(event); | 
|  171 } |  171 } | 
|  172  |  172  | 
|  173 }  // namespace blimp |  173 }  // namespace blimp | 
| OLD | NEW |