~hikiko/mir/mir.unity8-desktop-session

« back to all changes in this revision

Viewing changes to tests/unit-tests/input/android/test_android_input_registrar.cpp

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt, Ubuntu daily release
  • Date: 2014-01-08 02:04:38 UTC
  • mfrom: (1.1.54)
  • Revision ID: package-import@ubuntu.com-20140108020438-ikbu7qqm9v2l026y
Tags: 0.1.3+14.04.20140108-0ubuntu1
[ Daniel van Vugt ]
* Preparing for release 0.1.3

[ Ubuntu daily release ]
* Automatic snapshot from revision 1170

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
    void SetUp() override
52
52
    {
53
53
        test_input_fd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
54
 
        
 
54
 
55
55
        dispatcher = new mtd::MockInputDispatcher();
56
56
    }
57
57
    void TearDown() override
93
93
}
94
94
 
95
95
TEST_F(AndroidInputRegistrarFdSetup, input_channel_opened_behavior)
96
 
{    
 
96
{
97
97
    using namespace ::testing;
98
98
 
99
99
    auto channel = std::make_shared<mtd::StubInputChannel>(test_input_fd);
103
103
        .WillOnce(Return(droidinput::OK));
104
104
 
105
105
    mia::InputRegistrar registrar(dispatcher);
106
 
    
 
106
 
107
107
    registrar.input_channel_opened(channel, surface, mi::InputReceptionMode::normal);
108
108
    EXPECT_THROW({
109
109
            // We can't open a surface twice
122
122
        .WillOnce(Return(droidinput::OK));
123
123
    EXPECT_CALL(*dispatcher, unregisterInputChannel(_)).Times(1);
124
124
    mia::InputRegistrar registrar(dispatcher);
125
 
    
 
125
 
126
126
    EXPECT_THROW({
127
127
            // We can't close a surface which hasn't been opened
128
128
            registrar.input_channel_closed(channel);
146
146
        .WillOnce(Return(droidinput::OK));
147
147
 
148
148
    mia::InputRegistrar registrar(dispatcher);
149
 
    
 
149
 
150
150
    registrar.input_channel_opened(channel, surface, mi::InputReceptionMode::receives_all_input);
151
151
}