~mir-team/mir/trunk

« back to all changes in this revision

Viewing changes to tests/unit-tests/frontend/test_event_pipe.cpp

  • Committer: Tarmac
  • Author(s): Alan Griffiths
  • Date: 2013-04-25 23:50:01 UTC
  • mfrom: (526.2.22 mir1)
  • Revision ID: tarmac-20130425235001-c3b3x2yyb3eldyx1
frontend, shell, tests: surface-states updated to avoid supplying dependencies through public member functions.

Approved by PS Jenkins bot, Chris Halse Rogers, Robert Ancell, Kevin DuBois.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 * Authored by: Daniel van Vugt <daniel.van.vugt@canonical.com>
17
17
 */
18
18
 
 
19
#include "src/server/frontend/event_pipe.h"
 
20
#include <cstring>
 
21
 
19
22
#include <gtest/gtest.h>
20
 
#include "mir/event_queue.h"
21
 
#include "mir/event_sink.h"
22
 
#include <cstring>
23
 
 
24
 
TEST(EventQueue, no_sink)
 
23
 
 
24
using mir::frontend::EventPipe;
 
25
 
 
26
 
 
27
TEST(EventPipe, no_sink)
25
28
{
26
 
    mir::EventQueue q;
 
29
    EventPipe q;
27
30
    MirEvent e;
28
31
 
29
32
    e.type = mir_event_type_key;
38
41
 
39
42
namespace
40
43
{
41
 
    class TestSink : public mir::EventSink
 
44
    class TestSink : public mir::events::EventSink
42
45
    {
43
46
    public:
44
47
        TestSink()
61
64
    };
62
65
}
63
66
 
64
 
TEST(EventQueue, events_get_handled)
 
67
TEST(EventPipe, events_get_handled)
65
68
{
66
 
    mir::EventQueue q;
 
69
    EventPipe q;
67
70
    std::shared_ptr<TestSink> s(new TestSink);
68
71
 
69
72
    q.set_target(s);
84
87
    EXPECT_EQ(mir_event_type_surface, s->last_event_handled().type);
85
88
}
86
89
 
87
 
TEST(EventQueue, sink_is_changeable)
 
90
TEST(EventPipe, sink_is_changeable)
88
91
{
89
 
    mir::EventQueue q;
 
92
    EventPipe q;
90
93
    std::shared_ptr<TestSink> a(new TestSink);
91
94
    std::shared_ptr<TestSink> b(new TestSink);
92
95