~oif-team/frame/saucy

« back to all changes in this revision

Viewing changes to test/regular/frame-x11-fixture.cpp

  • Committer: Daniel d'Andrada
  • Date: 2012-11-27 12:48:29 UTC
  • mfrom: (102.1.5 lp1080819)
  • Revision ID: daniel.dandrada@canonical.com-20121127124829-3fav4qcvcdqgffoj
Building the X11 backend is now optional

Frame must still be available and useful in platforms that doesn't have X11.
In such cases frame_backend.h is used.

configure script output has also been embellished

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "frame-fixture.h"
 
1
#include "frame-x11-fixture.h"
2
2
#include "x11_mocks.h"
3
3
 
4
 
FrameFixture::FrameFixture()
 
4
FrameX11Fixture::FrameX11Fixture()
5
5
  : frame_handle(nullptr),
6
6
    _xevent_serial_number(1)
7
7
{
8
8
}
9
9
 
10
 
void FrameFixture::SetUp()
 
10
void FrameX11Fixture::SetUp()
11
11
{
12
12
  xmock_touch_acceptance.clear();
13
13
}
14
14
 
15
 
void FrameFixture::TearDown()
 
15
void FrameX11Fixture::TearDown()
16
16
{
17
17
  ASSERT_EQ(nullptr, frame_handle);
18
18
}
19
19
 
20
 
void FrameFixture::CreateXMockTouchScreenDevice()
 
20
void FrameX11Fixture::CreateXMockTouchScreenDevice()
21
21
{
22
22
  xmock_devices_count = 1;
23
23
  xmock_devices = (XIDeviceInfo*) calloc(xmock_devices_count,
59
59
  xmock_devices[0].classes = classes;
60
60
}
61
61
 
62
 
void FrameFixture::DestroyXMockDevices()
 
62
void FrameX11Fixture::DestroyXMockDevices()
63
63
{
64
64
  for (int i = 0; i < xmock_devices_count; ++i)
65
65
  {
70
70
  free(xmock_devices);
71
71
}
72
72
 
73
 
void FrameFixture::SendTouchEvent(
 
73
void FrameX11Fixture::SendTouchEvent(
74
74
    int event_type, int touch_id, float x, float y)
75
75
{
76
76
  UFStatus status;
112
112
  free(device_event);
113
113
}
114
114
 
115
 
void FrameFixture::SendTouchOwnershipEvent(int touch_id)
 
115
void FrameX11Fixture::SendTouchOwnershipEvent(int touch_id)
116
116
{
117
117
  UFStatus status;
118
118
  XGenericEventCookie xcookie;
141
141
  free(ownership_event);
142
142
}
143
143
 
144
 
void FrameFixture::FetchDeviceAddedEvent(UFDevice *device)
 
144
void FrameX11Fixture::FetchDeviceAddedEvent(UFDevice *device)
145
145
{
146
146
  UFEvent event;
147
147
  UFStatus status;
157
157
  frame_event_unref(event);
158
158
}
159
159
 
160
 
void FrameFixture::AssertNoMoreEvents()
 
160
void FrameX11Fixture::AssertNoMoreEvents()
161
161
{
162
162
  UFEvent event;
163
163
  UFStatus status;