~chasedouglas/frame/ubuntu-upstream-xi

« back to all changes in this revision

Viewing changes to test/x11/recording.cpp

  • Committer: Chase Douglas
  • Date: 2011-12-09 01:36:45 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: chase.douglas@ubuntu.com-20111209013645-n24l4myiumblzsfu
* New upstream release.
  - Version 2 adds a new API built on top of XInput multitouch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 *
 
3
 * utouch-frame - Touch Frame Library
 
4
 *
 
5
 * Copyright (C) 2011 Canonical Ltd.
 
6
 *
 
7
 * This program is free software: you can redistribute it and/or modify it
 
8
 * under the terms of the GNU General Public License as published by the
 
9
 * Free Software Foundation, either version 3 of the License, or (at your
 
10
 * option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 ****************************************************************************/
 
21
 
 
22
#include <map>
 
23
#include <memory>
 
24
#include <stdexcept>
 
25
#include <future>
 
26
 
 
27
#include <gtest/gtest.h>
 
28
 
 
29
#include "device.h"
 
30
#include "events.h"
 
31
#include "recording.h"
 
32
#include "x11/fixture.h"
 
33
#include "utouch/frame_x11.h"
 
34
 
 
35
using namespace utouch::frame::x11::testing;
 
36
 
 
37
class FrameRecordingTest : public Test {
 
38
 public:
 
39
  FrameRecordingTest() : device_(NULL), step_(0), saved_event_(NULL),
 
40
                         last_event_time_(0) {}
 
41
 
 
42
 protected:
 
43
  static const utouch::frame::testing::Events events_;
 
44
 
 
45
  virtual void ProcessFrameEvents();
 
46
  void CheckFrame(UFFrame frame, uint64_t event_time);
 
47
  void CheckTouch(UFFrame frame, unsigned int touch_index, uint64_t event_time);
 
48
  void CheckProperty(const utouch::frame::testing::Property& property,
 
49
                     UFTouch touch, UFFrame frame, int touch_index,
 
50
                     bool check_prev);
 
51
  void CheckAxisValue(const utouch::frame::testing::AxisValue& axis_value,
 
52
                      UFTouch touch, UFFrame frame, int touch_index,
 
53
                      bool check_prev);
 
54
 
 
55
  UFDevice device_;
 
56
  unsigned int step_;
 
57
  std::map<UFTouchId, int> touch_map_;
 
58
  UFEvent saved_event_; /* Holds a ref'd event to double check at the end */
 
59
  uint64_t last_event_time_;
 
60
  std::map<UFTouchId, uint64_t> touch_start_times_;
 
61
  std::map<UFTouchId, uint64_t> touch_times_;
 
62
};
 
63
 
 
64
void FrameRecordingTest::ProcessFrameEvents() {
 
65
  UFEvent event;
 
66
 
 
67
  UFStatus status;
 
68
  while ((status = frame_get_event(handle(), &event)) == UFStatusSuccess) {
 
69
    switch (frame_event_get_type(event)) {
 
70
      case UFEventTypeFrame: {
 
71
        UFFrame frame;
 
72
        ASSERT_EQ(UFStatusSuccess,
 
73
                  frame_event_get_property(event, UFEventPropertyFrame,
 
74
                                           &frame));
 
75
 
 
76
        if (step_ == 0) {
 
77
          frame_event_ref(event);
 
78
          saved_event_ = event;
 
79
        }
 
80
 
 
81
        CheckFrame(frame, frame_event_get_time(event));
 
82
        break;
 
83
      }
 
84
      case UFEventTypeDeviceAdded: {
 
85
        UFDevice device;
 
86
        ASSERT_EQ(UFStatusSuccess,
 
87
                  frame_event_get_property(event, UFEventPropertyDevice,
 
88
                                           &device));
 
89
 
 
90
        const char* name;
 
91
        ASSERT_EQ(UFStatusSuccess,
 
92
                  frame_device_get_property(device, UFDevicePropertyName,
 
93
                                            &name));
 
94
        if (strcmp(name, "N-Trig-MultiTouch-Virtual-Device") == 0) {
 
95
          EXPECT_EQ(NULL, device_);
 
96
          device_ = device;
 
97
        }
 
98
        break;
 
99
      }
 
100
      default:
 
101
        break;
 
102
    }
 
103
 
 
104
    /* FIXME: The X server is spitting out bad event times, re-enable when
 
105
     * upstream XI multitouch support is merged */
 
106
    /*EXPECT_GE(frame_event_get_time(event), last_event_time_);*/
 
107
    last_event_time_ = frame_event_get_time(event);
 
108
 
 
109
    frame_event_unref(event);
 
110
  }
 
111
 
 
112
  EXPECT_EQ(UFStatusErrorNoEvent, status);
 
113
}
 
114
 
 
115
void FrameRecordingTest::CheckFrame(UFFrame frame, uint64_t event_time) {
 
116
  ASSERT_LT(step_, events_.size()) << "Received too many frame events";
 
117
 
 
118
  /* Ensure we got a device addition event first */
 
119
  EXPECT_NE(nullptr, device_);
 
120
 
 
121
  EXPECT_EQ(device_, frame_frame_get_device(frame));
 
122
 
 
123
  UFWindowId window_id = frame_frame_get_window_id(frame);
 
124
  EXPECT_EQ(DefaultRootWindow(Display()), frame_x11_get_window_id(window_id));
 
125
 
 
126
  /* The number of active touches should match the number of provided touches
 
127
   * for an N-Trig display */
 
128
  unsigned int active_touches;
 
129
  EXPECT_EQ(UFStatusSuccess,
 
130
            frame_frame_get_property(frame, UFFramePropertyActiveTouches,
 
131
                                     &active_touches));
 
132
  EXPECT_EQ(frame_frame_get_num_touches(frame), active_touches);
 
133
 
 
134
  /* Check that the number of touches matches the expected amount for this step
 
135
   */
 
136
  ASSERT_EQ(events_[step_].size(), active_touches);
 
137
 
 
138
  /* Check each touch */
 
139
  for (unsigned int touch_index = 0;
 
140
       touch_index < events_[step_].size();
 
141
       ++touch_index)
 
142
    CheckTouch(frame, touch_index, event_time);
 
143
 
 
144
  /* Update touch map if a touch ended in the previous frame event. This allows
 
145
   * us to properly check the previous property and axis values. */
 
146
  if (step_ > 0) {
 
147
    for (const auto& pair : touch_map_) {
 
148
      const utouch::frame::testing::Touch* touch = &events_[step_][pair.second];
 
149
      const utouch::frame::testing::Properties* properties = &touch->first;
 
150
 
 
151
      UFTouchState state = properties->find(UFTouchPropertyState)->second.state;
 
152
 
 
153
      /* If touch is new in current step, skip */
 
154
      if (state == UFTouchStateBegin)
 
155
        continue;
 
156
 
 
157
      touch = &events_[step_ - 1][pair.second];
 
158
      properties = &touch->first;
 
159
 
 
160
      state = properties->find(UFTouchPropertyState)->second.state;
 
161
 
 
162
      if (state == UFTouchStateEnd) { /* If touch ended in previous step */
 
163
        /* Recalculate slot values for touches that come after this touch */
 
164
        for (auto& pair2 : touch_map_)
 
165
          if (pair2.second > pair.second)
 
166
            pair2.second--;
 
167
 
 
168
        /* Remove ended touch from touch map */
 
169
        touch_map_.erase(pair.first);
 
170
 
 
171
        break; /* In the X11 implementation, only one touch ends at a time */
 
172
      }
 
173
    }
 
174
  }
 
175
 
 
176
  /* Check for out of range touch indexes and IDs */
 
177
  UFTouch touch;
 
178
  EXPECT_EQ(UFStatusErrorInvalidTouch,
 
179
            frame_frame_get_touch_by_index(frame, active_touches, &touch));
 
180
  EXPECT_EQ(UFStatusErrorInvalidTouch,
 
181
            frame_frame_get_touch_by_id(frame, 83492, &touch));
 
182
 
 
183
  /* All touches are pending end at step 22, accept or reject them */
 
184
  if (step_ == 22) {
 
185
    ASSERT_EQ(4, touch_map_.size());
 
186
 
 
187
    UFWindowId window_id =
 
188
        frame_x11_create_window_id(DefaultRootWindow(Display()));
 
189
 
 
190
    int i = 0;
 
191
    for (const auto& pair : touch_map_) {
 
192
      if (i++ % 2)
 
193
        frame_x11_reject_touch(device_, window_id, pair.first);
 
194
      else
 
195
        frame_x11_accept_touch(device_, window_id, pair.first);
 
196
    }
 
197
  }
 
198
 
 
199
  ++step_;
 
200
}
 
201
 
 
202
void FrameRecordingTest::CheckTouch(
 
203
    UFFrame frame,
 
204
    unsigned int touch_index,
 
205
    uint64_t event_time) {
 
206
  UFTouch touch;
 
207
 
 
208
  ASSERT_EQ(UFStatusSuccess,
 
209
            frame_frame_get_touch_by_index(frame, touch_index, &touch));
 
210
 
 
211
  UFTouchId id = frame_touch_get_id(touch);
 
212
  const utouch::frame::testing::Touch& expected = events_[step_][touch_index];
 
213
 
 
214
  /* Check each property */
 
215
  for (const auto& property : expected.first)
 
216
    CheckProperty(property, touch, frame, touch_index, false);
 
217
 
 
218
  /* Check each axis value */
 
219
  for (const auto& axis_value : expected.second)
 
220
    CheckAxisValue(axis_value, touch, frame, touch_index, false);
 
221
 
 
222
  if (frame_touch_get_state(touch) == UFTouchStateBegin) {
 
223
    /* Update touch map for new touch */
 
224
    touch_map_[id] = touch_index;
 
225
 
 
226
    /* Ensure that the touch times match the current event time */
 
227
    EXPECT_EQ(event_time, frame_touch_get_start_time(touch));
 
228
    EXPECT_EQ(event_time, frame_touch_get_time(touch));
 
229
 
 
230
    /* Update touch times for this touch */
 
231
    touch_start_times_[id] = frame_touch_get_start_time(touch);
 
232
    touch_times_[id] = frame_touch_get_time(touch);
 
233
  } else {
 
234
 
 
235
    /* Check that the touch start time is still correct */
 
236
    EXPECT_EQ(touch_start_times_[id], frame_touch_get_start_time(touch))
 
237
        << "Step " << step_ << ", Touch " << id;
 
238
 
 
239
    int slot = touch_map_[id];
 
240
    const utouch::frame::testing::Touch& prev_expected =
 
241
        events_[step_ - 1][slot];
 
242
 
 
243
    if (utouch::frame::testing::IsEqual(expected, prev_expected)) {
 
244
      EXPECT_EQ(touch_times_[id], frame_touch_get_time(touch));
 
245
    } else {
 
246
      EXPECT_EQ(event_time, frame_touch_get_time(touch));
 
247
      touch_times_[id] = frame_touch_get_time(touch);
 
248
    }
 
249
 
 
250
    /* Check each property's previous value */
 
251
    for (const auto& property : prev_expected.first)
 
252
      CheckProperty(property, touch, frame, touch_index, true);
 
253
 
 
254
    /* Check each axis' previous value */
 
255
    for (const auto& axis_value : prev_expected.second)
 
256
      CheckAxisValue(axis_value, touch, frame, touch_index, true);
 
257
  }
 
258
 
 
259
  UFTouch check_touch;
 
260
  EXPECT_EQ(UFStatusSuccess,
 
261
            frame_frame_get_touch_by_id(frame, id, &check_touch));
 
262
  EXPECT_EQ(touch, check_touch);
 
263
}
 
264
 
 
265
void FrameRecordingTest::CheckProperty(
 
266
    const utouch::frame::testing::Property& property,
 
267
    UFTouch touch,
 
268
    UFFrame frame,
 
269
    int touch_index,
 
270
    bool check_prev) {
 
271
  switch(property.first) {
 
272
    case UFTouchPropertyState:
 
273
      UFTouchState state;
 
274
      if (!check_prev)
 
275
        ASSERT_EQ(UFStatusSuccess,
 
276
                  frame_touch_get_property(touch, property.first,
 
277
                                           &state));
 
278
      else
 
279
        ASSERT_EQ(UFStatusSuccess,
 
280
                  frame_frame_get_previous_touch_property(frame, touch,
 
281
                                                          property.first,
 
282
                                                          &state));
 
283
      EXPECT_EQ(property.second.state, state) << "Step " << step_ << ", Touch "
 
284
                                              << touch_index << ", Property " 
 
285
                                              << property.first << ", Prev "
 
286
                                              << check_prev;
 
287
      break;
 
288
 
 
289
    case UFTouchPropertyWindowX:
 
290
    case UFTouchPropertyWindowY:
 
291
      float floating;
 
292
      if (!check_prev) {
 
293
        if (property.first == UFTouchPropertyWindowX)
 
294
          floating = frame_touch_get_window_x(touch);
 
295
        else
 
296
          floating = frame_touch_get_window_y(touch);
 
297
      } else {
 
298
        ASSERT_EQ(UFStatusSuccess,
 
299
                  frame_frame_get_previous_touch_property(frame, touch,
 
300
                                                          property.first,
 
301
                                                          &floating));
 
302
      }
 
303
      EXPECT_FLOAT_EQ(property.second.floating, floating) << "Step " << step_
 
304
                                                          << ", Touch "
 
305
                                                          << touch_index
 
306
                                                          << ", Property "
 
307
                                                          << property.first
 
308
                                                          << ", Prev "
 
309
                                                          << check_prev;
 
310
      break;
 
311
 
 
312
    case UFTouchPropertyOwned:
 
313
    case UFTouchPropertyPendingEnd:
 
314
      int boolean;
 
315
      if (!check_prev)
 
316
        ASSERT_EQ(UFStatusSuccess,
 
317
                  frame_touch_get_property(touch, property.first,
 
318
                                           &boolean));
 
319
      else
 
320
        ASSERT_EQ(UFStatusSuccess,
 
321
                  frame_frame_get_previous_touch_property(frame, touch,
 
322
                                                          property.first,
 
323
                                                          &boolean));
 
324
      if (property.second.boolean)
 
325
        EXPECT_TRUE(boolean) << "Step " << step_ << ", Touch " << touch_index
 
326
                             << ", Property " << property.first << ", Prev "
 
327
                             << check_prev;
 
328
      else
 
329
        EXPECT_FALSE(boolean) << "Step " << step_ << ", Touch " << touch_index
 
330
                              << ", Property " << property.first << ", Prev "
 
331
                              << check_prev;
 
332
      break;
 
333
 
 
334
    default:
 
335
      ADD_FAILURE() << "Unimplemented touch property check for "
 
336
                    << property.first;
 
337
      break;
 
338
  }
 
339
}
 
340
 
 
341
void FrameRecordingTest::CheckAxisValue(
 
342
    const utouch::frame::testing::AxisValue& axis_value,
 
343
    UFTouch touch,
 
344
    UFFrame frame,
 
345
    int touch_index,
 
346
    bool check_prev) {
 
347
  float floating;
 
348
 
 
349
  if (!check_prev) {
 
350
    switch (axis_value.first) {
 
351
      case UFAxisTypeX:
 
352
        floating = frame_touch_get_device_x(touch);
 
353
        break;
 
354
      case UFAxisTypeY:
 
355
        floating = frame_touch_get_device_y(touch);
 
356
        break;
 
357
      default:
 
358
        ASSERT_EQ(UFStatusSuccess,
 
359
                  frame_touch_get_value(touch, axis_value.first, &floating));
 
360
        break;
 
361
    }
 
362
  } else {
 
363
    ASSERT_EQ(UFStatusSuccess,
 
364
              frame_frame_get_previous_touch_value(frame, touch,
 
365
                                                   axis_value.first,
 
366
                                                   &floating));
 
367
  }
 
368
 
 
369
  EXPECT_FLOAT_EQ(axis_value.second, floating) << "Step " << step_ << ", Touch "
 
370
                                               << touch_index << ", Axis "
 
371
                                               << axis_value.first << ", Prev "
 
372
                                               << check_prev;
 
373
}
 
374
 
 
375
TEST_F(FrameRecordingTest, Recording) {
 
376
  utouch::evemu::Device device("recordings/ntrig-dell-xt2.prop");
 
377
 
 
378
  /* Pump once to ensure the X server has initialized the device */
 
379
  PumpEvents();
 
380
  ASSERT_NE(nullptr, device_) << "X server failed to initialize touchscreen";
 
381
 
 
382
  utouch::evemu::Recording recording(device, "recordings/ntrig-dell-xt2.event");
 
383
 
 
384
  /* We use the c++11 future module so any exceptions thrown by the thread can
 
385
   * be caught later on. If we used the thread module, exceptions would take the
 
386
   * whole thing down. */
 
387
  std::future<void> future = std::async(std::launch::async,
 
388
                                        &utouch::evemu::Recording::Play,
 
389
                                        &recording);
 
390
 
 
391
  PumpEvents();
 
392
 
 
393
  future.wait();
 
394
 
 
395
  EXPECT_EQ(events_.size(), step_) << "Failed to receive all frame events for "
 
396
                                      "touchscreen";
 
397
 
 
398
  ASSERT_NE(nullptr, saved_event_);
 
399
 
 
400
  UFFrame frame;
 
401
  ASSERT_EQ(UFStatusSuccess,
 
402
            frame_event_get_property(saved_event_, UFEventPropertyFrame,
 
403
                                     &frame));
 
404
 
 
405
  step_ = 0;
 
406
  last_event_time_ = 0;
 
407
  CheckFrame(frame, frame_event_get_time(saved_event_));
 
408
 
 
409
  frame_event_unref(saved_event_);
 
410
  saved_event_ = NULL;
 
411
}
 
412
 
 
413
/* Construct the expected events */
 
414
namespace {
 
415
 
 
416
using namespace utouch::frame::testing;
 
417
 
 
418
const Touch ConstructTouch(UFTouchState state, float window_x, float window_y,
 
419
                           bool owned, bool pending_end, float x, float y,
 
420
                           float touch_major, float touch_minor,
 
421
                           float orientation) {
 
422
  Properties properties;
 
423
  AxisValues values;
 
424
 
 
425
  properties[UFTouchPropertyState] = NewValue(state);
 
426
  properties[UFTouchPropertyWindowX] = NewValue(window_x);
 
427
  properties[UFTouchPropertyWindowY] = NewValue(window_y);
 
428
  properties[UFTouchPropertyOwned] = NewValue(owned);
 
429
  properties[UFTouchPropertyPendingEnd] = NewValue(pending_end);
 
430
  values[UFAxisTypeX] = x;
 
431
  values[UFAxisTypeY] = y;
 
432
  values[UFAxisTypeTouchMajor] = touch_major;
 
433
  values[UFAxisTypeTouchMinor] = touch_minor;
 
434
  values[UFAxisTypeOrientation] = orientation;
 
435
 
 
436
  return Touch(properties, values);
 
437
}
 
438
 
 
439
const Events ConstructEvents() {
 
440
  Events events;
 
441
  Touches touches;
 
442
 
 
443
  touches.push_back(ConstructTouch(UFTouchStateBegin, 790.506653, 498.880005,
 
444
                                   false, false, 7411, 4677, 462, 360, 1));
 
445
  events.push_back(touches);
 
446
 
 
447
  touches.clear();
 
448
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
449
                                   true, false, 7411, 4677, 462, 360, 1));
 
450
  events.push_back(touches);
 
451
 
 
452
  touches.clear();
 
453
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
454
                                   true, false, 7411, 4677, 462, 360, 1));
 
455
  touches.push_back(ConstructTouch(UFTouchStateBegin, 785.173340, 351.040009,
 
456
                                   false, false, 7361, 3291, 462, 360, 1));
 
457
  events.push_back(touches);
 
458
 
 
459
  touches.clear();
 
460
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
461
                                   true, false, 7411, 4677, 462, 360, 1));
 
462
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 785.173340, 351.040009,
 
463
                                   true, false, 7361, 3291, 462, 360, 1));
 
464
  events.push_back(touches);
 
465
 
 
466
  touches.clear();
 
467
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
468
                                   true, false, 7411, 4677, 462, 360, 1));
 
469
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 785.173340, 351.040009,
 
470
                                   true, false, 7361, 3291, 462, 360, 1));
 
471
  touches.push_back(ConstructTouch(UFTouchStateBegin, 630.613342, 158.186661,
 
472
                                   false, false, 5912, 1483, 540, 462, 1));
 
473
  events.push_back(touches);
 
474
 
 
475
  touches.clear();
 
476
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
477
                                   true, false, 7411, 4677, 462, 360, 1));
 
478
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 785.173340, 351.040009,
 
479
                                   true, false, 7361, 3291, 462, 360, 1));
 
480
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
481
                                   true, false, 5912, 1483, 540, 462, 1));
 
482
  events.push_back(touches);
 
483
 
 
484
  touches.clear();
 
485
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
486
                                   true, false, 7411, 4677, 462, 360, 1));
 
487
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
488
                                   true, false, 7371, 3291, 436, 360, 0));
 
489
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
490
                                   true, false, 5912, 1483, 540, 462, 1));
 
491
  events.push_back(touches);
 
492
 
 
493
  touches.clear();
 
494
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
495
                                   true, false, 7411, 4677, 462, 360, 1));
 
496
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
497
                                   true, false, 7371, 3291, 436, 360, 0));
 
498
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
499
                                   true, false, 5912, 1483, 540, 385, 1));
 
500
  events.push_back(touches);
 
501
 
 
502
  touches.clear();
 
503
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
504
                                   true, false, 7411, 4677, 436, 360, 0));
 
505
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
506
                                   true, false, 7371, 3291, 436, 360, 0));
 
507
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
508
                                   true, false, 5912, 1483, 540, 385, 1));
 
509
  events.push_back(touches);
 
510
 
 
511
  touches.clear();
 
512
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
513
                                   true, false, 7411, 4677, 436, 360, 0));
 
514
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
515
                                   true, false, 7371, 3291, 436, 360, 1));
 
516
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
517
                                   true, false, 5912, 1483, 540, 385, 1));
 
518
  events.push_back(touches);
 
519
 
 
520
  touches.clear();
 
521
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
522
                                   true, false, 7411, 4677, 436, 360, 0));
 
523
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
524
                                   true, false, 7371, 3291, 436, 360, 1));
 
525
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
526
                                   true, false, 5912, 1483, 540, 404, 1));
 
527
  events.push_back(touches);
 
528
 
 
529
  touches.clear();
 
530
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
531
                                   true, false, 7411, 4677, 436, 360, 0));
 
532
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
533
                                   true, false, 7371, 3291, 436, 360, 0));
 
534
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
535
                                   true, false, 5912, 1483, 540, 404, 1));
 
536
  events.push_back(touches);
 
537
 
 
538
  touches.clear();
 
539
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
540
                                   true, false, 7411, 4677, 436, 360, 0));
 
541
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
542
                                   true, false, 7371, 3291, 436, 360, 0));
 
543
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
544
                                   true, false, 5912, 1483, 540, 404, 1));
 
545
  events.push_back(touches);
 
546
 
 
547
  touches.clear();
 
548
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
549
                                   true, false, 7411, 4677, 436, 360, 0));
 
550
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
551
                                   true, false, 7371, 3291, 436, 360, 0));
 
552
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
553
                                   true, false, 5912, 1483, 540, 404, 1));
 
554
  touches.push_back(ConstructTouch(UFTouchStateBegin, 729.280029, 284.693329,
 
555
                                   false, false, 6837, 2669, 462, 360, 1));
 
556
  events.push_back(touches);
 
557
 
 
558
  touches.clear();
 
559
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
560
                                   true, false, 7411, 4677, 436, 360, 0));
 
561
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
562
                                   true, false, 7371, 3291, 436, 360, 0));
 
563
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
564
                                   true, false, 5912, 1483, 540, 404, 1));
 
565
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
566
                                   true, false, 6837, 2669, 462, 360, 1));
 
567
  events.push_back(touches);
 
568
 
 
569
  touches.clear();
 
570
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
571
                                   true, false, 7411, 4677, 436, 360, 0));
 
572
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 351.040009,
 
573
                                   true, false, 7371, 3291, 436, 360, 0));
 
574
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
575
                                   true, false, 5912, 1483, 540, 404, 0));
 
576
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
577
                                   true, false, 6837, 2669, 462, 360, 1));
 
578
  events.push_back(touches);
 
579
 
 
580
  touches.clear();
 
581
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
582
                                   true, false, 7411, 4677, 436, 360, 0));
 
583
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
584
                                   true, false, 7371, 3281, 436, 360, 0));
 
585
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
586
                                   true, false, 5912, 1483, 540, 404, 0));
 
587
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
588
                                   true, false, 6837, 2669, 462, 360, 1));
 
589
  events.push_back(touches);
 
590
 
 
591
  touches.clear();
 
592
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
593
                                   true, false, 7411, 4677, 436, 360, 0));
 
594
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
595
                                   true, false, 7371, 3281, 436, 360, 0));
 
596
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
597
                                   true, false, 5912, 1483, 540, 404, 0));
 
598
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
599
                                   true, false, 6837, 2669, 436, 257, 0));
 
600
  events.push_back(touches);
 
601
 
 
602
  touches.clear();
 
603
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
604
                                   true, false, 7411, 4677, 436, 360, 0));
 
605
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
606
                                   true, false, 7371, 3281, 436, 360, 0));
 
607
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
608
                                   true, false, 5912, 1483, 540, 380, 0));
 
609
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
610
                                   true, false, 6837, 2669, 436, 257, 0));
 
611
  events.push_back(touches);
 
612
 
 
613
  touches.clear();
 
614
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
615
                                   true, true, 7411, 4677, 436, 360, 0));
 
616
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
617
                                   true, false, 7371, 3281, 436, 360, 0));
 
618
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
619
                                   true, false, 5912, 1483, 540, 380, 0));
 
620
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
621
                                   true, false, 6837, 2669, 436, 257, 0));
 
622
  events.push_back(touches);
 
623
 
 
624
  touches.clear();
 
625
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
626
                                   true, true, 7411, 4677, 436, 360, 0));
 
627
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
628
                                   true, true, 7371, 3281, 436, 360, 0));
 
629
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
630
                                   true, false, 5912, 1483, 540, 380, 0));
 
631
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
632
                                   true, false, 6837, 2669, 436, 257, 0));
 
633
  events.push_back(touches);
 
634
 
 
635
  touches.clear();
 
636
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
637
                                   true, true, 7411, 4677, 436, 360, 0));
 
638
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
639
                                   true, true, 7371, 3281, 436, 360, 0));
 
640
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
641
                                   true, false, 5912, 1483, 540, 380, 0));
 
642
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
643
                                   true, true, 6837, 2669, 436, 257, 0));
 
644
  events.push_back(touches);
 
645
 
 
646
  touches.clear();
 
647
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 790.506653, 498.880005,
 
648
                                   true, true, 7411, 4677, 436, 360, 0));
 
649
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
650
                                   true, true, 7371, 3281, 436, 360, 0));
 
651
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
652
                                   true, true, 5912, 1483, 540, 380, 0));
 
653
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
654
                                   true, true, 6837, 2669, 436, 257, 0));
 
655
  events.push_back(touches);
 
656
 
 
657
  touches.clear();
 
658
  touches.push_back(ConstructTouch(UFTouchStateEnd, 0, 0,
 
659
                                   true, false, 7411, 4677, 436, 360, 0));
 
660
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 786.239990, 349.973328,
 
661
                                   true, true, 7371, 3281, 436, 360, 0));
 
662
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
663
                                   true, true, 5912, 1483, 540, 380, 0));
 
664
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
665
                                   true, true, 6837, 2669, 436, 257, 0));
 
666
  events.push_back(touches);
 
667
 
 
668
  touches.clear();
 
669
  touches.push_back(ConstructTouch(UFTouchStateEnd, 0, 0,
 
670
                                   true, false, 7371, 3281, 436, 360, 0));
 
671
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 630.613342, 158.186661,
 
672
                                   true, true, 5912, 1483, 540, 380, 0));
 
673
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
674
                                   true, true, 6837, 2669, 436, 257, 0));
 
675
  events.push_back(touches);
 
676
 
 
677
  touches.clear();
 
678
  touches.push_back(ConstructTouch(UFTouchStateEnd, 0, 0,
 
679
                                   true, false, 5912, 1483, 540, 380, 0));
 
680
  touches.push_back(ConstructTouch(UFTouchStateUpdate, 729.280029, 284.693329,
 
681
                                   true, true, 6837, 2669, 436, 257, 0));
 
682
  events.push_back(touches);
 
683
 
 
684
  touches.clear();
 
685
  touches.push_back(ConstructTouch(UFTouchStateEnd, 0, 0,
 
686
                                   true, false, 6837, 2669, 436, 257, 0));
 
687
  events.push_back(touches);
 
688
 
 
689
  return events;
 
690
}
 
691
 
 
692
} // namespace
 
693
 
 
694
/* Now initialize the static test fixture member */
 
695
const utouch::frame::testing::Events
 
696
    FrameRecordingTest::events_(ConstructEvents());