Flutter Engine
pointer_data_packet_converter_unittests.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "flutter/lib/ui/window/pointer_data_packet_converter.h"
6 
7 #include <cstring>
8 
9 #include "gtest/gtest.h"
10 
11 namespace flutter {
12 namespace testing {
13 
15  PointerData::Change change,
16  int64_t device,
17  double dx,
18  double dy) {
19  data.time_stamp = 0;
20  data.change = change;
23  data.device = device;
24  data.pointer_identifier = 0;
25  data.physical_x = dx;
26  data.physical_y = dy;
27  data.physical_delta_x = 0.0;
28  data.physical_delta_y = 0.0;
29  data.buttons = 0;
30  data.obscured = 0;
31  data.synthesized = 0;
32  data.pressure = 0.0;
33  data.pressure_min = 0.0;
34  data.pressure_max = 0.0;
35  data.distance = 0.0;
36  data.distance_max = 0.0;
37  data.size = 0.0;
38  data.radius_major = 0.0;
39  data.radius_minor = 0.0;
40  data.radius_min = 0.0;
41  data.radius_max = 0.0;
42  data.orientation = 0.0;
43  data.tilt = 0.0;
44  data.platformData = 0;
45  data.scroll_delta_x = 0.0;
46  data.scroll_delta_y = 0.0;
47 }
48 
50  PointerData::Change change,
51  PointerData::SignalKind signal_kind,
52  int64_t device,
53  double dx,
54  double dy,
55  double scroll_delta_x,
56  double scroll_delta_y) {
57  data.time_stamp = 0;
58  data.change = change;
60  data.signal_kind = signal_kind;
61  data.device = device;
62  data.pointer_identifier = 0;
63  data.physical_x = dx;
64  data.physical_y = dy;
65  data.physical_delta_x = 0.0;
66  data.physical_delta_y = 0.0;
67  data.buttons = 0;
68  data.obscured = 0;
69  data.synthesized = 0;
70  data.pressure = 0.0;
71  data.pressure_min = 0.0;
72  data.pressure_max = 0.0;
73  data.distance = 0.0;
74  data.distance_max = 0.0;
75  data.size = 0.0;
76  data.radius_major = 0.0;
77  data.radius_minor = 0.0;
78  data.radius_min = 0.0;
79  data.radius_max = 0.0;
80  data.orientation = 0.0;
81  data.tilt = 0.0;
82  data.platformData = 0;
83  data.scroll_delta_x = scroll_delta_x;
84  data.scroll_delta_y = scroll_delta_y;
85 }
86 
87 void UnpackPointerPacket(std::vector<PointerData>& output, // NOLINT
88  std::unique_ptr<PointerDataPacket> packet) {
89  size_t kBytesPerPointerData = kPointerDataFieldCount * kBytesPerField;
90  auto buffer = packet->data();
91  size_t buffer_length = buffer.size();
92 
93  for (size_t i = 0; i < buffer_length / kBytesPerPointerData; i++) {
94  PointerData pointer_data;
95  memcpy(&pointer_data, &buffer[i * kBytesPerPointerData],
96  sizeof(PointerData));
97  output.push_back(pointer_data);
98  }
99  packet.reset();
100 }
101 
102 TEST(PointerDataPacketConverterTest, CanConvetPointerDataPacket) {
103  PointerDataPacketConverter converter;
104  auto packet = std::make_unique<PointerDataPacket>(6);
105  PointerData data;
107  packet->SetPointerData(0, data);
109  packet->SetPointerData(1, data);
111  packet->SetPointerData(2, data);
113  packet->SetPointerData(3, data);
115  packet->SetPointerData(4, data);
117  packet->SetPointerData(5, data);
118  auto converted_packet = converter.Convert(std::move(packet));
119 
120  std::vector<PointerData> result;
121  UnpackPointerPacket(result, std::move(converted_packet));
122 
123  ASSERT_EQ(result.size(), (size_t)6);
124  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
125  ASSERT_EQ(result[0].synthesized, 0);
126 
127  ASSERT_EQ(result[1].change, PointerData::Change::kHover);
128  ASSERT_EQ(result[1].synthesized, 0);
129  ASSERT_EQ(result[1].physical_delta_x, 3.0);
130  ASSERT_EQ(result[1].physical_delta_y, 0.0);
131 
132  ASSERT_EQ(result[2].change, PointerData::Change::kDown);
133  ASSERT_EQ(result[2].pointer_identifier, 1);
134  ASSERT_EQ(result[2].synthesized, 0);
135 
136  ASSERT_EQ(result[3].change, PointerData::Change::kMove);
137  ASSERT_EQ(result[3].pointer_identifier, 1);
138  ASSERT_EQ(result[3].synthesized, 0);
139  ASSERT_EQ(result[3].physical_delta_x, 0.0);
140  ASSERT_EQ(result[3].physical_delta_y, 4.0);
141 
142  ASSERT_EQ(result[4].change, PointerData::Change::kUp);
143  ASSERT_EQ(result[4].pointer_identifier, 1);
144  ASSERT_EQ(result[4].synthesized, 0);
145 
146  ASSERT_EQ(result[5].change, PointerData::Change::kRemove);
147  ASSERT_EQ(result[5].synthesized, 0);
148 }
149 
150 TEST(PointerDataPacketConverterTest, CanSynthesizeDownAndUp) {
151  PointerDataPacketConverter converter;
152  auto packet = std::make_unique<PointerDataPacket>(4);
153  PointerData data;
155  packet->SetPointerData(0, data);
157  packet->SetPointerData(1, data);
159  packet->SetPointerData(2, data);
161  packet->SetPointerData(3, data);
162  auto converted_packet = converter.Convert(std::move(packet));
163 
164  std::vector<PointerData> result;
165  UnpackPointerPacket(result, std::move(converted_packet));
166 
167  ASSERT_EQ(result.size(), (size_t)6);
168  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
169  ASSERT_EQ(result[0].synthesized, 0);
170 
171  // A hover should be synthesized.
172  ASSERT_EQ(result[1].change, PointerData::Change::kHover);
173  ASSERT_EQ(result[1].synthesized, 1);
174  ASSERT_EQ(result[1].physical_delta_x, 3.0);
175  ASSERT_EQ(result[1].physical_delta_y, 0.0);
176 
177  ASSERT_EQ(result[2].change, PointerData::Change::kDown);
178  ASSERT_EQ(result[2].pointer_identifier, 1);
179  ASSERT_EQ(result[2].synthesized, 0);
180 
181  // A move should be synthesized.
182  ASSERT_EQ(result[3].change, PointerData::Change::kMove);
183  ASSERT_EQ(result[3].pointer_identifier, 1);
184  ASSERT_EQ(result[3].synthesized, 1);
185  ASSERT_EQ(result[3].physical_delta_x, 0.0);
186  ASSERT_EQ(result[3].physical_delta_y, 4.0);
187 
188  ASSERT_EQ(result[4].change, PointerData::Change::kUp);
189  ASSERT_EQ(result[4].pointer_identifier, 1);
190  ASSERT_EQ(result[4].synthesized, 0);
191 
192  ASSERT_EQ(result[5].change, PointerData::Change::kRemove);
193  ASSERT_EQ(result[5].synthesized, 0);
194 }
195 
196 TEST(PointerDataPacketConverterTest, CanUpdatePointerIdentifier) {
197  PointerDataPacketConverter converter;
198  auto packet = std::make_unique<PointerDataPacket>(7);
199  PointerData data;
201  packet->SetPointerData(0, data);
203  packet->SetPointerData(1, data);
205  packet->SetPointerData(2, data);
207  packet->SetPointerData(3, data);
209  packet->SetPointerData(4, data);
211  packet->SetPointerData(5, data);
213  packet->SetPointerData(6, data);
214  auto converted_packet = converter.Convert(std::move(packet));
215 
216  std::vector<PointerData> result;
217  UnpackPointerPacket(result, std::move(converted_packet));
218 
219  ASSERT_EQ(result.size(), (size_t)7);
220  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
221  ASSERT_EQ(result[0].synthesized, 0);
222 
223  ASSERT_EQ(result[1].change, PointerData::Change::kDown);
224  ASSERT_EQ(result[1].pointer_identifier, 1);
225  ASSERT_EQ(result[1].synthesized, 0);
226 
227  ASSERT_EQ(result[2].change, PointerData::Change::kUp);
228  ASSERT_EQ(result[2].pointer_identifier, 1);
229  ASSERT_EQ(result[2].synthesized, 0);
230 
231  // Pointer count increase to 2.
232  ASSERT_EQ(result[3].change, PointerData::Change::kDown);
233  ASSERT_EQ(result[3].pointer_identifier, 2);
234  ASSERT_EQ(result[3].synthesized, 0);
235 
236  ASSERT_EQ(result[4].change, PointerData::Change::kMove);
237  ASSERT_EQ(result[4].pointer_identifier, 2);
238  ASSERT_EQ(result[4].synthesized, 0);
239  ASSERT_EQ(result[4].physical_delta_x, 3.0);
240  ASSERT_EQ(result[4].physical_delta_y, 0.0);
241 
242  ASSERT_EQ(result[5].change, PointerData::Change::kUp);
243  ASSERT_EQ(result[5].pointer_identifier, 2);
244  ASSERT_EQ(result[5].synthesized, 0);
245 
246  ASSERT_EQ(result[6].change, PointerData::Change::kRemove);
247  ASSERT_EQ(result[6].synthesized, 0);
248 }
249 
250 TEST(PointerDataPacketConverterTest, AlwaysForwardMoveEvent) {
251  PointerDataPacketConverter converter;
252  auto packet = std::make_unique<PointerDataPacket>(4);
253  PointerData data;
255  packet->SetPointerData(0, data);
257  packet->SetPointerData(1, data);
258  // Creates a move event without a location change.
260  packet->SetPointerData(2, data);
262  packet->SetPointerData(3, data);
263 
264  auto converted_packet = converter.Convert(std::move(packet));
265 
266  std::vector<PointerData> result;
267  UnpackPointerPacket(result, std::move(converted_packet));
268 
269  ASSERT_EQ(result.size(), (size_t)4);
270  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
271  ASSERT_EQ(result[0].synthesized, 0);
272 
273  ASSERT_EQ(result[1].change, PointerData::Change::kDown);
274  ASSERT_EQ(result[1].pointer_identifier, 1);
275  ASSERT_EQ(result[1].synthesized, 0);
276 
277  // Does not filter out the move event.
278  ASSERT_EQ(result[2].change, PointerData::Change::kMove);
279  ASSERT_EQ(result[2].pointer_identifier, 1);
280  ASSERT_EQ(result[2].synthesized, 0);
281 
282  ASSERT_EQ(result[3].change, PointerData::Change::kUp);
283  ASSERT_EQ(result[3].pointer_identifier, 1);
284  ASSERT_EQ(result[3].synthesized, 0);
285 }
286 
287 TEST(PointerDataPacketConverterTest, CanWorkWithDifferentDevices) {
288  PointerDataPacketConverter converter;
289  auto packet = std::make_unique<PointerDataPacket>(12);
290  PointerData data;
292  packet->SetPointerData(0, data);
294  packet->SetPointerData(1, data);
296  packet->SetPointerData(2, data);
298  packet->SetPointerData(3, data);
300  packet->SetPointerData(4, data);
302  packet->SetPointerData(5, data);
304  packet->SetPointerData(6, data);
306  packet->SetPointerData(7, data);
308  packet->SetPointerData(8, data);
310  packet->SetPointerData(9, data);
312  packet->SetPointerData(10, data);
314  packet->SetPointerData(11, data);
315  auto converted_packet = converter.Convert(std::move(packet));
316 
317  std::vector<PointerData> result;
318  UnpackPointerPacket(result, std::move(converted_packet));
319 
320  ASSERT_EQ(result.size(), (size_t)12);
321  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
322  ASSERT_EQ(result[0].device, 0);
323  ASSERT_EQ(result[0].synthesized, 0);
324 
325  ASSERT_EQ(result[1].change, PointerData::Change::kDown);
326  ASSERT_EQ(result[1].device, 0);
327  ASSERT_EQ(result[1].pointer_identifier, 1);
328  ASSERT_EQ(result[1].synthesized, 0);
329 
330  ASSERT_EQ(result[2].change, PointerData::Change::kAdd);
331  ASSERT_EQ(result[2].device, 1);
332  ASSERT_EQ(result[2].synthesized, 0);
333 
334  ASSERT_EQ(result[3].change, PointerData::Change::kDown);
335  ASSERT_EQ(result[3].device, 1);
336  ASSERT_EQ(result[3].pointer_identifier, 2);
337  ASSERT_EQ(result[3].synthesized, 0);
338 
339  ASSERT_EQ(result[4].change, PointerData::Change::kUp);
340  ASSERT_EQ(result[4].device, 0);
341  ASSERT_EQ(result[4].pointer_identifier, 1);
342  ASSERT_EQ(result[4].synthesized, 0);
343 
344  ASSERT_EQ(result[5].change, PointerData::Change::kDown);
345  ASSERT_EQ(result[5].device, 0);
346  ASSERT_EQ(result[5].pointer_identifier, 3);
347  ASSERT_EQ(result[5].synthesized, 0);
348 
349  ASSERT_EQ(result[6].change, PointerData::Change::kMove);
350  ASSERT_EQ(result[6].device, 1);
351  ASSERT_EQ(result[6].pointer_identifier, 2);
352  ASSERT_EQ(result[6].synthesized, 0);
353  ASSERT_EQ(result[6].physical_delta_x, 0.0);
354  ASSERT_EQ(result[6].physical_delta_y, 4.0);
355 
356  ASSERT_EQ(result[7].change, PointerData::Change::kMove);
357  ASSERT_EQ(result[7].device, 0);
358  ASSERT_EQ(result[7].pointer_identifier, 3);
359  ASSERT_EQ(result[7].synthesized, 0);
360  ASSERT_EQ(result[7].physical_delta_x, 3.0);
361  ASSERT_EQ(result[7].physical_delta_y, 0.0);
362 
363  ASSERT_EQ(result[8].change, PointerData::Change::kUp);
364  ASSERT_EQ(result[8].device, 1);
365  ASSERT_EQ(result[8].pointer_identifier, 2);
366  ASSERT_EQ(result[8].synthesized, 0);
367 
368  ASSERT_EQ(result[9].change, PointerData::Change::kUp);
369  ASSERT_EQ(result[9].device, 0);
370  ASSERT_EQ(result[9].pointer_identifier, 3);
371  ASSERT_EQ(result[9].synthesized, 0);
372 
373  ASSERT_EQ(result[10].change, PointerData::Change::kRemove);
374  ASSERT_EQ(result[10].device, 0);
375  ASSERT_EQ(result[10].synthesized, 0);
376 
377  ASSERT_EQ(result[11].change, PointerData::Change::kRemove);
378  ASSERT_EQ(result[11].device, 1);
379  ASSERT_EQ(result[11].synthesized, 0);
380 }
381 
382 TEST(PointerDataPacketConverterTest, CanSynthesizeAdd) {
383  PointerDataPacketConverter converter;
384  auto packet = std::make_unique<PointerDataPacket>(2);
385  PointerData data;
387  packet->SetPointerData(0, data);
389  packet->SetPointerData(1, data);
390  auto converted_packet = converter.Convert(std::move(packet));
391 
392  std::vector<PointerData> result;
393  UnpackPointerPacket(result, std::move(converted_packet));
394 
395  ASSERT_EQ(result.size(), (size_t)4);
396  // A add should be synthesized.
397  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
398  ASSERT_EQ(result[0].physical_x, 330.0);
399  ASSERT_EQ(result[0].physical_y, 450.0);
400  ASSERT_EQ(result[0].synthesized, 1);
401 
402  ASSERT_EQ(result[1].change, PointerData::Change::kDown);
403  ASSERT_EQ(result[1].physical_x, 330.0);
404  ASSERT_EQ(result[1].physical_y, 450.0);
405  ASSERT_EQ(result[1].synthesized, 0);
406 
407  // A move should be synthesized.
408  ASSERT_EQ(result[2].change, PointerData::Change::kMove);
409  ASSERT_EQ(result[2].physical_delta_x, -330.0);
410  ASSERT_EQ(result[2].physical_delta_y, -450.0);
411  ASSERT_EQ(result[2].physical_x, 0.0);
412  ASSERT_EQ(result[2].physical_y, 0.0);
413  ASSERT_EQ(result[2].synthesized, 1);
414 
415  ASSERT_EQ(result[3].change, PointerData::Change::kUp);
416  ASSERT_EQ(result[3].physical_x, 0.0);
417  ASSERT_EQ(result[3].physical_y, 0.0);
418  ASSERT_EQ(result[3].synthesized, 0);
419 }
420 
421 TEST(PointerDataPacketConverterTest, CanHandleThreeFingerGesture) {
422  // Regression test https://github.com/flutter/flutter/issues/20517.
423  PointerDataPacketConverter converter;
424  PointerData data;
425  std::vector<PointerData> result;
426  // First finger down.
427  auto packet = std::make_unique<PointerDataPacket>(1);
429  packet->SetPointerData(0, data);
430  auto converted_packet = converter.Convert(std::move(packet));
431  UnpackPointerPacket(result, std::move(converted_packet));
432  // Second finger down.
433  packet = std::make_unique<PointerDataPacket>(1);
435  packet->SetPointerData(0, data);
436  converted_packet = converter.Convert(std::move(packet));
437  UnpackPointerPacket(result, std::move(converted_packet));
438  // Triggers three cancels.
439  packet = std::make_unique<PointerDataPacket>(3);
441  packet->SetPointerData(0, data);
443  packet->SetPointerData(1, data);
445  packet->SetPointerData(2, data);
446  converted_packet = converter.Convert(std::move(packet));
447  UnpackPointerPacket(result, std::move(converted_packet));
448 
449  ASSERT_EQ(result.size(), (size_t)6);
450  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
451  ASSERT_EQ(result[0].device, 0);
452  ASSERT_EQ(result[0].physical_x, 0.0);
453  ASSERT_EQ(result[0].physical_y, 0.0);
454  ASSERT_EQ(result[0].synthesized, 1);
455 
456  ASSERT_EQ(result[1].change, PointerData::Change::kDown);
457  ASSERT_EQ(result[1].device, 0);
458  ASSERT_EQ(result[1].physical_x, 0.0);
459  ASSERT_EQ(result[1].physical_y, 0.0);
460  ASSERT_EQ(result[1].synthesized, 0);
461 
462  ASSERT_EQ(result[2].change, PointerData::Change::kAdd);
463  ASSERT_EQ(result[2].device, 1);
464  ASSERT_EQ(result[2].physical_x, 33.0);
465  ASSERT_EQ(result[2].physical_y, 44.0);
466  ASSERT_EQ(result[2].synthesized, 1);
467 
468  ASSERT_EQ(result[3].change, PointerData::Change::kDown);
469  ASSERT_EQ(result[3].device, 1);
470  ASSERT_EQ(result[3].physical_x, 33.0);
471  ASSERT_EQ(result[3].physical_y, 44.0);
472  ASSERT_EQ(result[3].synthesized, 0);
473 
474  ASSERT_EQ(result[4].change, PointerData::Change::kCancel);
475  ASSERT_EQ(result[4].device, 1);
476  ASSERT_EQ(result[4].physical_x, 33.0);
477  ASSERT_EQ(result[4].physical_y, 44.0);
478  ASSERT_EQ(result[4].synthesized, 0);
479 
480  ASSERT_EQ(result[5].change, PointerData::Change::kCancel);
481  ASSERT_EQ(result[5].device, 0);
482  ASSERT_EQ(result[5].physical_x, 0.0);
483  ASSERT_EQ(result[5].physical_y, 0.0);
484  ASSERT_EQ(result[5].synthesized, 0);
485  // Third cancel should be dropped
486 }
487 
488 TEST(PointerDataPacketConverterTest, CanConvetScroll) {
489  PointerDataPacketConverter converter;
490  auto packet = std::make_unique<PointerDataPacket>(5);
491  PointerData data;
493  PointerData::SignalKind::kNone, 0, 0.0, 0.0,
494  0.0, 0.0);
495  packet->SetPointerData(0, data);
497  PointerData::SignalKind::kNone, 1, 0.0, 0.0,
498  0.0, 0.0);
499  packet->SetPointerData(1, data);
501  PointerData::SignalKind::kNone, 1, 0.0, 0.0,
502  0.0, 0.0);
503  packet->SetPointerData(2, data);
506  34.0, 30.0, 0.0);
507  packet->SetPointerData(3, data);
510  49.0, 50.0, 0.0);
511  packet->SetPointerData(4, data);
512  auto converted_packet = converter.Convert(std::move(packet));
513 
514  std::vector<PointerData> result;
515  UnpackPointerPacket(result, std::move(converted_packet));
516 
517  ASSERT_EQ(result.size(), (size_t)7);
518  ASSERT_EQ(result[0].change, PointerData::Change::kAdd);
519  ASSERT_EQ(result[0].signal_kind, PointerData::SignalKind::kNone);
520  ASSERT_EQ(result[0].device, 0);
521  ASSERT_EQ(result[0].physical_x, 0.0);
522  ASSERT_EQ(result[0].physical_y, 0.0);
523  ASSERT_EQ(result[0].synthesized, 0);
524 
525  ASSERT_EQ(result[1].change, PointerData::Change::kAdd);
526  ASSERT_EQ(result[1].signal_kind, PointerData::SignalKind::kNone);
527  ASSERT_EQ(result[1].device, 1);
528  ASSERT_EQ(result[1].physical_x, 0.0);
529  ASSERT_EQ(result[1].physical_y, 0.0);
530  ASSERT_EQ(result[1].synthesized, 0);
531 
532  ASSERT_EQ(result[2].change, PointerData::Change::kDown);
533  ASSERT_EQ(result[2].signal_kind, PointerData::SignalKind::kNone);
534  ASSERT_EQ(result[2].device, 1);
535  ASSERT_EQ(result[2].physical_x, 0.0);
536  ASSERT_EQ(result[2].physical_y, 0.0);
537  ASSERT_EQ(result[2].synthesized, 0);
538 
539  // Converter will synthesize a hover to position.
540  ASSERT_EQ(result[3].change, PointerData::Change::kHover);
541  ASSERT_EQ(result[3].signal_kind, PointerData::SignalKind::kNone);
542  ASSERT_EQ(result[3].device, 0);
543  ASSERT_EQ(result[3].physical_x, 34.0);
544  ASSERT_EQ(result[3].physical_y, 34.0);
545  ASSERT_EQ(result[3].physical_delta_x, 34.0);
546  ASSERT_EQ(result[3].physical_delta_y, 34.0);
547  ASSERT_EQ(result[3].synthesized, 1);
548 
549  ASSERT_EQ(result[4].change, PointerData::Change::kHover);
550  ASSERT_EQ(result[4].signal_kind, PointerData::SignalKind::kScroll);
551  ASSERT_EQ(result[4].device, 0);
552  ASSERT_EQ(result[4].physical_x, 34.0);
553  ASSERT_EQ(result[4].physical_y, 34.0);
554  ASSERT_EQ(result[4].scroll_delta_x, 30.0);
555  ASSERT_EQ(result[4].scroll_delta_y, 0.0);
556 
557  // Converter will synthesize a move to position.
558  ASSERT_EQ(result[5].change, PointerData::Change::kMove);
559  ASSERT_EQ(result[5].signal_kind, PointerData::SignalKind::kNone);
560  ASSERT_EQ(result[5].device, 1);
561  ASSERT_EQ(result[5].physical_x, 49.0);
562  ASSERT_EQ(result[5].physical_y, 49.0);
563  ASSERT_EQ(result[5].physical_delta_x, 49.0);
564  ASSERT_EQ(result[5].physical_delta_y, 49.0);
565  ASSERT_EQ(result[5].synthesized, 1);
566 
567  ASSERT_EQ(result[6].change, PointerData::Change::kHover);
568  ASSERT_EQ(result[6].signal_kind, PointerData::SignalKind::kScroll);
569  ASSERT_EQ(result[6].device, 1);
570  ASSERT_EQ(result[6].physical_x, 49.0);
571  ASSERT_EQ(result[6].physical_y, 49.0);
572  ASSERT_EQ(result[6].scroll_delta_x, 50.0);
573  ASSERT_EQ(result[6].scroll_delta_y, 0.0);
574 }
575 
576 } // namespace testing
577 } // namespace flutter
static constexpr int kBytesPerField
Definition: pointer_data.h:14
static constexpr int kPointerDataFieldCount
Definition: pointer_data.h:13
SignalKind signal_kind
Definition: pointer_data.h:65
int64_t pointer_identifier
Definition: pointer_data.h:67
std::unique_ptr< PointerDataPacket > Convert(std::unique_ptr< PointerDataPacket > packet)
Converts pointer data packet into a form that framework understands. The raw pointer data packet from...
void UnpackPointerPacket(std::vector< PointerData > &output, std::unique_ptr< PointerDataPacket > packet)
void CreateSimulatedPointerData(PointerData &data, PointerData::Change change, int64_t device, double dx, double dy)
void CreateSimulatedMousePointerData(PointerData &data, PointerData::Change change, PointerData::SignalKind signal_kind, int64_t device, double dx, double dy, double scroll_delta_x, double scroll_delta_y)
TEST(EmbeddedViewParams, GetBoundingRectAfterMutationsWithNoMutations)