~mir-team/mir/fix-1546933-3

« back to all changes in this revision

Viewing changes to tests/acceptance-tests/test_client_cookie.cpp

  • Committer: Daniel van Vugt
  • Date: 2016-03-03 07:24:16 UTC
  • mfrom: (3324.1.34 development-branch)
  • Revision ID: daniel.van.vugt@canonical.com-20160303072416-u3u60nx38bu4wpgq
Merge latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "mir/test/spin_wait.h"
26
26
#include "mir/test/wait_condition.h"
27
27
#include "mir/cookie/authority.h"
 
28
#include "mir_test_framework/visible_surface.h"
28
29
 
29
30
#include "boost/throw_exception.hpp"
30
31
 
43
44
void cookie_capturing_callback(MirSurface*, MirEvent const* ev, void* ctx);
44
45
}
45
46
 
46
 
class ClientCookies : public mtf::ConnectedClientWithASurface
 
47
class ClientCookies : public mtf::ConnectedClientHeadlessServer
47
48
{
48
49
public:
49
50
    ClientCookies()
54
55
 
55
56
    void SetUp() override
56
57
    {
57
 
        mtf::ConnectedClientWithASurface::SetUp();
 
58
        mtf::ConnectedClientHeadlessServer::SetUp();
58
59
 
59
60
        // Need fullscreen for the cursor events
60
 
        auto const spec = mir_connection_create_spec_for_changes(connection);
 
61
        auto const spec = mir_connection_create_spec_for_normal_surface(
 
62
            connection, 100, 100, mir_pixel_format_abgr_8888);
61
63
        mir_surface_spec_set_fullscreen_on_output(spec, 1);
62
 
        mir_surface_apply_spec(surface, spec);
 
64
        mir_surface_spec_set_event_handler(spec, &cookie_capturing_callback, this);
 
65
        surface = mir_surface_create_sync(spec);
63
66
        mir_surface_spec_release(spec);
64
67
 
65
 
        mir_surface_set_event_handler(surface, &cookie_capturing_callback, this);
66
68
        mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface));
67
69
 
68
70
        ready_to_accept_events.wait_for_at_most_seconds(max_wait);
88
90
    mutable std::mutex mutex;
89
91
    bool exposed{false};
90
92
    bool focused{false};
 
93
    MirSurface* surface;
91
94
};
92
95
 
93
96
namespace