[PATCH xorg-gtest 5/5] Add xorg::testing::evemu::{Device,Recording}
Peter Hutterer
peter.hutterer at who-t.net
Mon Mar 5 23:14:04 PST 2012
On Mon, Mar 05, 2012 at 09:39:45PM -0800, Chase Douglas wrote:
> On 03/05/2012 06:25 PM, Stephen M. Webb wrote:
> >On 03/05/2012 02:47 PM, Chase Douglas wrote:
> >>These new classes use utouch-evemu for input device recording playback.
> >>
> >>Signed-off-by: Chase Douglas<chase.douglas at canonical.com>
> >>---
> >> configure.ac | 13 +++++
> >> include/Makefile.am | 6 ++
> >> include/xorg/gtest/evemu/device.h | 85 ++++++++++++++++++++++++++++++++
> >> include/xorg/gtest/evemu/recording.h | 89 ++++++++++++++++++++++++++++++++++
> >> src/Makefile.am | 8 +++
> >> src/device.cpp | 84 ++++++++++++++++++++++++++++++++
> >> src/recording.cpp | 51 +++++++++++++++++++
> >
> >I find it a little unusual that the recording and playback operations
> >are a separate object than the device they operate on.
>
> Usually, a test instantiates a device and plays back one recording.
> However, it's conceivable that a test would instantiate one device
> and play back two separate recordings in sequence. Or one recording
> twice. Or one recording through two separate devices. The idea here
> is to create a wrapper object around the devices and the recordings
> separately so they can be interchanged.
I agree, please keep them separate, having more than one recording will be
quite useful when you use single-event recordings to assemble sequences.
e.g. click pause click, with a variable pause to test for doubleclick
timeouts.
Cheers,
Peter
> There's no real runtime overhead, and code wise there shouldn't be
> much overhead. The code is as simple as:
>
> Device device("device.prop");
> Recording recording("device.recording");
> recording.playback(device);
>
> As I'm typing this I'm realizing that the API doesn't really allow
> for one recording, multiple devices (without having to instantiate
> two recording objects). I'll think about refactoring it a little.
>
> Thanks,
>
> -- Chase
More information about the xorg-devel
mailing list