| 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 "remoting/host/touch_injector_win.h" | 5 #include "remoting/host/touch_injector_win.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 expected.pointerInfo.ptPixelLocation.x && | 56 expected.pointerInfo.ptPixelLocation.x && |
| 57 arg->pointerInfo.ptPixelLocation.y == | 57 arg->pointerInfo.ptPixelLocation.y == |
| 58 expected.pointerInfo.ptPixelLocation.y; | 58 expected.pointerInfo.ptPixelLocation.y; |
| 59 } | 59 } |
| 60 | 60 |
| 61 // Make sure that every touch point has the right flag (pointerFlags). | 61 // Make sure that every touch point has the right flag (pointerFlags). |
| 62 MATCHER_P(EqualsPointerTouchInfoFlag, id_to_flag_map, "") { | 62 MATCHER_P(EqualsPointerTouchInfoFlag, id_to_flag_map, "") { |
| 63 for (size_t i = 0; i < id_to_flag_map.size(); ++i) { | 63 for (size_t i = 0; i < id_to_flag_map.size(); ++i) { |
| 64 const POINTER_TOUCH_INFO* touch_info = arg + i; | 64 const POINTER_TOUCH_INFO* touch_info = arg + i; |
| 65 const uint32_t id = touch_info->pointerInfo.pointerId; | 65 const uint32_t id = touch_info->pointerInfo.pointerId; |
| 66 if (!ContainsKey(id_to_flag_map, id)) | 66 if (!base::ContainsKey(id_to_flag_map, id)) |
| 67 return false; | 67 return false; |
| 68 | 68 |
| 69 if (id_to_flag_map.find(id)->second != touch_info->pointerInfo.pointerFlags) | 69 if (id_to_flag_map.find(id)->second != touch_info->pointerInfo.pointerFlags) |
| 70 return false; | 70 return false; |
| 71 } | 71 } |
| 72 return true; | 72 return true; |
| 73 } | 73 } |
| 74 | 74 |
| 75 class TouchInjectorWinDelegateMock : public TouchInjectorWinDelegate { | 75 class TouchInjectorWinDelegateMock : public TouchInjectorWinDelegate { |
| 76 public: | 76 public: |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 TouchEvent cancel_rest; | 513 TouchEvent cancel_rest; |
| 514 cancel_rest.set_event_type(TouchEvent::TOUCH_POINT_CANCEL); | 514 cancel_rest.set_event_type(TouchEvent::TOUCH_POINT_CANCEL); |
| 515 point0 = cancel_rest.add_touch_points(); | 515 point0 = cancel_rest.add_touch_points(); |
| 516 point0->set_id(0u); | 516 point0->set_id(0u); |
| 517 point2 = cancel_rest.add_touch_points(); | 517 point2 = cancel_rest.add_touch_points(); |
| 518 point2->set_id(2u); | 518 point2->set_id(2u); |
| 519 injector.InjectTouchEvent(cancel_rest); | 519 injector.InjectTouchEvent(cancel_rest); |
| 520 } | 520 } |
| 521 | 521 |
| 522 } // namespace remoting | 522 } // namespace remoting |
| OLD | NEW |