Mir

Merge lp:~brandontschaefer/mir/no-android-input-channel into lp:mir

Proposed by Brandon Schaefer
Status: Rejected
Rejected by: Brandon Schaefer
Proposed branch: lp:~brandontschaefer/mir/no-android-input-channel
Merge into: lp:mir
Diff against target: 818 lines (+222/-263)
20 files modified
3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h (+0/-6)
3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp (+0/-29)
src/server/input/CMakeLists.txt (+2/-0)
src/server/input/android/CMakeLists.txt (+0/-2)
src/server/input/android/android_input_channel.cpp (+0/-48)
src/server/input/android/android_input_channel.h (+0/-59)
src/server/input/android/input_channel_factory.cpp (+0/-28)
src/server/input/android/input_channel_factory.h (+0/-44)
src/server/input/channel.cpp (+64/-0)
src/server/input/channel.h (+48/-0)
src/server/input/channel_factory.cpp (+28/-0)
src/server/input/channel_factory.h (+43/-0)
src/server/input/default_configuration.cpp (+2/-2)
tests/unit-tests/client/input/test_android_input_receiver.cpp (+19/-28)
tests/unit-tests/input/CMakeLists.txt (+1/-0)
tests/unit-tests/input/android/CMakeLists.txt (+0/-1)
tests/unit-tests/input/android/test_android_communication_package.cpp (+4/-5)
tests/unit-tests/input/android/test_android_input_sender.cpp (+2/-3)
tests/unit-tests/input/android/test_input_consumer.cpp (+3/-2)
tests/unit-tests/input/test_input_channel_factory.cpp (+6/-6)
To merge this branch: bzr merge lp:~brandontschaefer/mir/no-android-input-channel
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Kevin DuBois (community) Approve
Cemil Azizoglu (community) Needs Fixing
Review via email: mp+290942@code.launchpad.net

Commit message

Remove the usage of android input channel. Slowly removing all usage of the android input sender/receiver as well as the input channel.

Description of the change

Remove the usage of android input channel. Slowly removing all usage of the android input sender/receiver as well as the input channel.

To post a comment you must log in.
3440. By Brandon Schaefer

* Should have just bzr mv'ed those files... but fix copyright headers

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3439
https://mir-jenkins.ubuntu.com/job/mir-ci/747/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/723/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/760
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/751
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/751
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/732/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/732
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/732/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/732/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/732/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/732
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/732/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/747/rebuild

review: Needs Fixing (continuous-integration)
3441. By Brandon Schaefer

* Not sure why i used auto

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3440
https://mir-jenkins.ubuntu.com/job/mir-ci/748/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/724/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/761
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/753
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/753
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/734/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/734
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/734/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/734/console
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/734/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/734
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/734/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/748/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:3441
https://mir-jenkins.ubuntu.com/job/mir-ci/750/
Executed test runs:
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-mir/727/console
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/764
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/755
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/755
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/736
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/736/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/736
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/736/artifact/output/*zip*/output.zip
    FAILURE: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/736/console
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/736/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/736
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/736/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/736
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/736/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/750/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Now that this code is out of the Android realm and is in the Mir realm, we should use Mir facilities, i.e. use 'mir::fd' instead of 'int'.

review: Needs Fixing
Revision history for this message
Cemil Azizoglu (cemil-azizoglu) wrote :

Rather, 'mir::Fd'

3442. By Brandon Schaefer

* Use mir::Fd

Revision history for this message
Kevin DuBois (kdub) wrote :

nit:
+ mir::Fd server_fd_;
no need for mir::, already in correct namespace

Diff size would be much reduced with bzr mv. If its not too much trouble, it could still be done.

The rest looks alright to me.

nb:
+mi::Channel::Channel()
Although I don't think I see an opportunity for an exception to be thrown between the socketpair and setting mir::Fd (only C functions are used), in general the fd's should be put in the RAII wrapper right after the resource is acquired for exception safety.

review: Approve
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:3442
https://mir-jenkins.ubuntu.com/job/mir-ci/759/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/742
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/779
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/770
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/770
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/751
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=vivid+overlay/751/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/751
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial/751/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/751
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/751/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/751
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/751/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/751
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial/751/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/759/rebuild

review: Approve (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Unmerged revisions

3442. By Brandon Schaefer

* Use mir::Fd

3441. By Brandon Schaefer

* Not sure why i used auto

3440. By Brandon Schaefer

* Should have just bzr mv'ed those files... but fix copyright headers

3439. By Brandon Schaefer

* Remove the dependency on the android input channel and just create our own.
* The start of slowly removing all the android input sender/receiver!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h'
--- 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h 2016-01-29 08:18:22 +0000
+++ 3rd_party/android-input/android/frameworks/base/include/androidfw/InputTransport.h 2016-04-05 19:30:54 +0000
@@ -141,12 +141,6 @@
141public:141public:
142 InputChannel(const String8& name, int fd);142 InputChannel(const String8& name, int fd);
143143
144 /* Creates a pair of input channels.
145 *
146 * Returns OK on success.
147 */
148 static status_t openInputFdPair(int& server_fd, int& client_fd);
149
150 inline String8 getName() const { return mName; }144 inline String8 getName() const { return mName; }
151 inline int getFd() const { return mFd; }145 inline int getFd() const { return mFd; }
152146
153147
=== modified file '3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp'
--- 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp 2016-03-23 06:39:56 +0000
+++ 3rd_party/android-input/android/frameworks/base/services/input/InputTransport.cpp 2016-04-05 19:30:54 +0000
@@ -32,12 +32,6 @@
3232
33namespace android {33namespace android {
3434
35// Socket buffer size. The default is typically about 128KB, which is much larger than
36// we really need. So we make it smaller. It just needs to be big enough to hold
37// a few dozen large multi-finger motion events in the case where an application gets
38// behind processing touches.
39static const size_t SOCKET_BUFFER_SIZE = 32 * 1024;
40
41// Nanoseconds per milliseconds.35// Nanoseconds per milliseconds.
42static constexpr const std::chrono::nanoseconds NANOS_PER_MS = std::chrono::nanoseconds(1000000);36static constexpr const std::chrono::nanoseconds NANOS_PER_MS = std::chrono::nanoseconds(1000000);
4337
@@ -117,29 +111,6 @@
117#endif111#endif
118}112}
119113
120status_t InputChannel::openInputFdPair(int& server_fd, int& client_fd) {
121 int sockets[2];
122 if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sockets)) {
123 status_t result = -errno;
124 ALOGE("InputChannel ~ Could not create socket pair. errno=%d",
125 errno);
126 server_fd = client_fd = 0;
127
128 return result;
129 }
130
131 int bufferSize = SOCKET_BUFFER_SIZE;
132 setsockopt(sockets[0], SOL_SOCKET, SO_SNDBUF, &bufferSize, sizeof(bufferSize));
133 setsockopt(sockets[0], SOL_SOCKET, SO_RCVBUF, &bufferSize, sizeof(bufferSize));
134 setsockopt(sockets[1], SOL_SOCKET, SO_SNDBUF, &bufferSize, sizeof(bufferSize));
135 setsockopt(sockets[1], SOL_SOCKET, SO_RCVBUF, &bufferSize, sizeof(bufferSize));
136
137 server_fd = sockets[0];
138 client_fd = sockets[1];
139
140 return OK;
141}
142
143status_t InputChannel::sendMessage(const InputMessage* msg) {114status_t InputChannel::sendMessage(const InputMessage* msg) {
144 size_t msgLength = msg->size();115 size_t msgLength = msg->size();
145 ssize_t nWrite;116 ssize_t nWrite;
146117
=== modified file 'src/server/input/CMakeLists.txt'
--- src/server/input/CMakeLists.txt 2016-03-23 06:39:56 +0000
+++ src/server/input/CMakeLists.txt 2016-04-05 19:30:54 +0000
@@ -6,6 +6,8 @@
66
7 basic_seat.cpp7 basic_seat.cpp
8 builtin_cursor_images.cpp8 builtin_cursor_images.cpp
9 channel.cpp
10 channel_factory.cpp
9 cursor_controller.cpp11 cursor_controller.cpp
10 default_configuration.cpp12 default_configuration.cpp
11 default_device.cpp13 default_device.cpp
1214
=== modified file 'src/server/input/android/CMakeLists.txt'
--- src/server/input/android/CMakeLists.txt 2016-01-29 08:18:22 +0000
+++ src/server/input/android/CMakeLists.txt 2016-04-05 19:30:54 +0000
@@ -1,7 +1,5 @@
1list(1list(
2 APPEND INPUT_SOURCES2 APPEND INPUT_SOURCES
3 ${CMAKE_CURRENT_SOURCE_DIR}/android_input_channel.cpp
4 ${CMAKE_CURRENT_SOURCE_DIR}/input_channel_factory.cpp
5 ${CMAKE_CURRENT_SOURCE_DIR}/input_sender.cpp3 ${CMAKE_CURRENT_SOURCE_DIR}/input_sender.cpp
6)4)
75
86
=== removed file 'src/server/input/android/android_input_channel.cpp'
--- src/server/input/android/android_input_channel.cpp 2014-03-06 06:05:17 +0000
+++ src/server/input/android/android_input_channel.cpp 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#include "android_input_channel.h"
20
21#include <androidfw/InputTransport.h>
22
23#include <unistd.h>
24
25namespace mia = mir::input::android;
26namespace droidinput = android;
27
28mia::AndroidInputChannel::AndroidInputChannel()
29{
30
31 droidinput::InputChannel::openInputFdPair(s_fd, c_fd);
32}
33
34mia::AndroidInputChannel::~AndroidInputChannel()
35{
36 close(s_fd);
37 close(c_fd);
38}
39
40int mia::AndroidInputChannel::client_fd() const
41{
42 return c_fd;
43}
44
45int mia::AndroidInputChannel::server_fd() const
46{
47 return s_fd;
48}
490
=== removed file 'src/server/input/android/android_input_channel.h'
--- src/server/input/android/android_input_channel.h 2015-02-22 07:46:25 +0000
+++ src/server/input/android/android_input_channel.h 1970-01-01 00:00:00 +0000
@@ -1,59 +0,0 @@
1/*
2 * Copyright © 2013 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */
18
19#ifndef MIR_INPUT_ANDROID_INPUT_CHANNEL_H_
20#define MIR_INPUT_ANDROID_INPUT_CHANNEL_H_
21
22#include "mir/input/input_channel.h"
23
24namespace android
25{
26class InputChannel;
27}
28
29namespace droidinput = android;
30
31namespace mir
32{
33namespace input
34{
35namespace android
36{
37
38class AndroidInputChannel : public InputChannel
39{
40public:
41 explicit AndroidInputChannel();
42 virtual ~AndroidInputChannel();
43
44 int client_fd() const;
45 int server_fd() const;
46
47protected:
48 AndroidInputChannel(AndroidInputChannel const&) = delete;
49 AndroidInputChannel& operator=(AndroidInputChannel const&) = delete;
50
51private:
52 int s_fd, c_fd;
53};
54
55}
56}
57} // namespace mir
58
59#endif // MIR_INPUT_ANDROID_INPUT_CHANNEL_H_
600
=== removed file 'src/server/input/android/input_channel_factory.cpp'
--- src/server/input/android/input_channel_factory.cpp 2014-04-10 12:59:14 +0000
+++ src/server/input/android/input_channel_factory.cpp 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1/*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#include "input_channel_factory.h"
20#include "android_input_channel.h"
21
22namespace mi = mir::input;
23namespace mia = mi::android;
24
25std::shared_ptr<mi::InputChannel> mia::InputChannelFactory::make_input_channel()
26{
27 return std::make_shared<mia::AndroidInputChannel>();
28}
290
=== removed file 'src/server/input/android/input_channel_factory.h'
--- src/server/input/android/input_channel_factory.h 2014-04-10 12:59:14 +0000
+++ src/server/input/android/input_channel_factory.h 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1/*
2 * Copyright © 2014 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
17 */
18
19#ifndef MIR_INPUT_ANDROID_INPUT_CHANNEL_FACTORY_H_
20#define MIR_INPUT_ANDROID_INPUT_CHANNEL_FACTORY_H_
21
22#include "mir/input/input_channel_factory.h"
23
24namespace mir
25{
26namespace input
27{
28namespace android
29{
30class InputChannelFactory : public mir::input::InputChannelFactory
31{
32public:
33 std::shared_ptr<mir::input::InputChannel> make_input_channel() override;
34
35 InputChannelFactory() = default;
36 InputChannelFactory(InputChannelFactory const&) = delete;
37 InputChannelFactory& operator=(InputChannelFactory const&) = delete;
38};
39
40}
41}
42} // namespace mir
43
44#endif
450
=== added file 'src/server/input/channel.cpp'
--- src/server/input/channel.cpp 1970-01-01 00:00:00 +0000
+++ src/server/input/channel.cpp 2016-04-05 19:30:54 +0000
@@ -0,0 +1,64 @@
1/*
2 * Copyright © 2013-2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 * Brandon Schaefer <brandon.schaefer@canonical.com>
18 */
19
20#include <system_error>
21#include <sys/types.h>
22#include <sys/socket.h>
23
24#include "channel.h"
25
26#include <boost/throw_exception.hpp>
27
28namespace mi = mir::input;
29
30namespace
31{
32// Default is 128KB which is larger then we need. Use a smaller size.
33int const buffer_size{32 * 1024};
34}
35
36mi::Channel::Channel()
37{
38 int sockets[2];
39 if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, sockets)) {
40 BOOST_THROW_EXCEPTION(std::system_error(
41 errno,
42 std::system_category(),
43 "Could not create socket pair."));
44 }
45
46 int size = buffer_size;
47 setsockopt(sockets[0], SOL_SOCKET, SO_SNDBUF, &size, sizeof(size));
48 setsockopt(sockets[0], SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
49 setsockopt(sockets[1], SOL_SOCKET, SO_SNDBUF, &size, sizeof(size));
50 setsockopt(sockets[1], SOL_SOCKET, SO_RCVBUF, &size, sizeof(size));
51
52 server_fd_ = mir::Fd(sockets[0]);
53 client_fd_ = mir::Fd(sockets[1]);
54}
55
56int mi::Channel::server_fd() const
57{
58 return server_fd_;
59}
60
61int mi::Channel::client_fd() const
62{
63 return client_fd_;
64}
065
=== added file 'src/server/input/channel.h'
--- src/server/input/channel.h 1970-01-01 00:00:00 +0000
+++ src/server/input/channel.h 2016-04-05 19:30:54 +0000
@@ -0,0 +1,48 @@
1/*
2 * Copyright © 2013-2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 * Brandon Schaefer <brandon.schaefer@canonical.com>
18 */
19
20#ifndef MIR_INPUT_CHANNEL_H_
21#define MIR_INPUT_CHANNEL_H_
22
23#include "mir/fd.h"
24#include "mir/input/input_channel.h"
25
26namespace mir
27{
28namespace input
29{
30
31class Channel : public InputChannel
32{
33public:
34 Channel();
35 virtual ~Channel() override = default;
36
37 int client_fd() const override;
38 int server_fd() const override;
39
40private:
41 mir::Fd server_fd_;
42 mir::Fd client_fd_;
43};
44
45}
46}
47
48#endif /* MIR_INPUT_CHANNEL_H_ */
049
=== added file 'src/server/input/channel_factory.cpp'
--- src/server/input/channel_factory.cpp 1970-01-01 00:00:00 +0000
+++ src/server/input/channel_factory.cpp 2016-04-05 19:30:54 +0000
@@ -0,0 +1,28 @@
1/*
2 * Copyright © 2014-2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
17 *
18 */
19
20#include "channel.h"
21#include "channel_factory.h"
22
23namespace mi = mir::input;
24
25std::shared_ptr<mi::InputChannel> mi::ChannelFactory::make_input_channel()
26{
27 return std::make_shared<mi::Channel>();
28}
029
=== added file 'src/server/input/channel_factory.h'
--- src/server/input/channel_factory.h 1970-01-01 00:00:00 +0000
+++ src/server/input/channel_factory.h 2016-04-05 19:30:54 +0000
@@ -0,0 +1,43 @@
1/*
2 * Copyright © 2014-2016 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3,
6 * as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
17 *
18 */
19
20#ifndef MIR_INPUT_CHANNEL_FACTORY_H_
21#define MIR_INPUT_CHANNEL_FACTORY_H_
22
23#include "mir/input/input_channel_factory.h"
24
25namespace mir
26{
27namespace input
28{
29
30class ChannelFactory : public InputChannelFactory
31{
32public:
33 virtual std::shared_ptr<InputChannel> make_input_channel() override;
34
35 ChannelFactory() = default;
36 ChannelFactory(ChannelFactory const&) = delete;
37 ChannelFactory& operator=(ChannelFactory const&) = delete;
38};
39
40}
41}
42
43#endif /* MIR_INPUT_CHANNEL_FACTORY_H_ */
044
=== modified file 'src/server/input/default_configuration.cpp'
--- src/server/input/default_configuration.cpp 2016-03-23 06:39:56 +0000
+++ src/server/input/default_configuration.cpp 2016-04-05 19:30:54 +0000
@@ -19,10 +19,10 @@
19#include "mir/default_server_configuration.h"19#include "mir/default_server_configuration.h"
2020
21#include "android/input_sender.h"21#include "android/input_sender.h"
22#include "android/input_channel_factory.h"
23#include "key_repeat_dispatcher.h"22#include "key_repeat_dispatcher.h"
24#include "display_input_region.h"23#include "display_input_region.h"
25#include "event_filter_chain_dispatcher.h"24#include "event_filter_chain_dispatcher.h"
25#include "channel_factory.h"
26#include "cursor_controller.h"26#include "cursor_controller.h"
27#include "touchspot_controller.h"27#include "touchspot_controller.h"
28#include "null_input_manager.h"28#include "null_input_manager.h"
@@ -161,7 +161,7 @@
161 if (!options->get<bool>(options::enable_input_opt))161 if (!options->get<bool>(options::enable_input_opt))
162 return std::make_shared<mi::NullInputChannelFactory>();162 return std::make_shared<mi::NullInputChannelFactory>();
163 else163 else
164 return std::make_shared<mia::InputChannelFactory>();164 return std::make_shared<mi::ChannelFactory>();
165}165}
166166
167std::shared_ptr<mi::CursorListener>167std::shared_ptr<mi::CursorListener>
168168
=== modified file 'tests/unit-tests/client/input/test_android_input_receiver.cpp'
--- tests/unit-tests/client/input/test_android_input_receiver.cpp 2016-03-29 03:41:45 +0000
+++ tests/unit-tests/client/input/test_android_input_receiver.cpp 2016-04-05 19:30:54 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19#include "src/client/input/android/android_input_receiver.h"19#include "src/client/input/android/android_input_receiver.h"
20#include "src/server/input/channel.h"
20#include "mir/input/null_input_receiver_report.h"21#include "mir/input/null_input_receiver_report.h"
21#include "mir/input/xkb_mapper.h"22#include "mir/input/xkb_mapper.h"
22#include "mir/events/event_private.h"23#include "mir/events/event_private.h"
@@ -40,6 +41,7 @@
40namespace mircva = mircv::android;41namespace mircva = mircv::android;
41namespace md = mir::dispatch;42namespace md = mir::dispatch;
42namespace mt = mir::test;43namespace mt = mir::test;
44namespace mi = mir::input;
4345
44namespace droidinput = android;46namespace droidinput = android;
4547
@@ -130,24 +132,13 @@
130class AndroidInputReceiverSetup : public testing::Test132class AndroidInputReceiverSetup : public testing::Test
131{133{
132public:134public:
133 AndroidInputReceiverSetup()
134 {
135 auto status = droidinput::InputChannel::openInputFdPair(server_fd, client_fd);
136 EXPECT_EQ(droidinput::OK, status);
137 }
138 ~AndroidInputReceiverSetup()
139 {
140 close(server_fd);
141 close(client_fd);
142 }
143
144 void flush_channels()135 void flush_channels()
145 {136 {
146 fsync(server_fd);137 fsync(channel.server_fd());
147 fsync(client_fd);138 fsync(channel.client_fd());
148 }139 }
149140
150 int server_fd, client_fd;141 mi::Channel channel;
151142
152 static std::chrono::milliseconds const next_event_timeout;143 static std::chrono::milliseconds const next_event_timeout;
153 std::function<void(MirEvent*)> event_handler{[](MirEvent*){}};144 std::function<void(MirEvent*)> event_handler{[](MirEvent*){}};
@@ -159,7 +150,7 @@
159TEST_F(AndroidInputReceiverSetup, receiver_receives_key_events)150TEST_F(AndroidInputReceiverSetup, receiver_receives_key_events)
160{151{
161 MirKeyboardEvent last_event;152 MirKeyboardEvent last_event;
162 mircva::InputReceiver receiver{client_fd,153 mircva::InputReceiver receiver{channel.client_fd(),
163 std::make_shared<mircv::XKBMapper>(),154 std::make_shared<mircv::XKBMapper>(),
164 [&last_event](MirEvent* ev)155 [&last_event](MirEvent* ev)
165 {156 {
@@ -169,7 +160,7 @@
169 }160 }
170 },161 },
171 std::make_shared<mircv::NullInputReceiverReport>()};162 std::make_shared<mircv::NullInputReceiverReport>()};
172 TestingInputProducer producer{server_fd};163 TestingInputProducer producer{channel.server_fd()};
173164
174 producer.produce_a_key_event();165 producer.produce_a_key_event();
175166
@@ -184,11 +175,11 @@
184175
185TEST_F(AndroidInputReceiverSetup, receiver_handles_events)176TEST_F(AndroidInputReceiverSetup, receiver_handles_events)
186{177{
187 mircva::InputReceiver receiver{client_fd,178 mircva::InputReceiver receiver{channel.client_fd(),
188 std::make_shared<mircv::XKBMapper>(),179 std::make_shared<mircv::XKBMapper>(),
189 event_handler,180 event_handler,
190 std::make_shared<mircv::NullInputReceiverReport>()};181 std::make_shared<mircv::NullInputReceiverReport>()};
191 TestingInputProducer producer(server_fd);182 TestingInputProducer producer(channel.server_fd());
192183
193 producer.produce_a_key_event();184 producer.produce_a_key_event();
194 flush_channels();185 flush_channels();
@@ -203,12 +194,12 @@
203194
204TEST_F(AndroidInputReceiverSetup, receiver_consumes_batched_motion_events)195TEST_F(AndroidInputReceiverSetup, receiver_consumes_batched_motion_events)
205{196{
206 mircva::InputReceiver receiver{client_fd,197 mircva::InputReceiver receiver{channel.client_fd(),
207 std::make_shared<mircv::XKBMapper>(),198 std::make_shared<mircv::XKBMapper>(),
208 event_handler,199 event_handler,
209 std::make_shared<mircv::NullInputReceiverReport>()};200 std::make_shared<mircv::NullInputReceiverReport>()};
210201
211 TestingInputProducer producer(server_fd);202 TestingInputProducer producer(channel.server_fd());
212203
213 // Produce 3 motion events before client handles any.204 // Produce 3 motion events before client handles any.
214 producer.produce_a_pointer_event(0, 0, std::chrono::nanoseconds(0));205 producer.produce_a_pointer_event(0, 0, std::chrono::nanoseconds(0));
@@ -235,7 +226,7 @@
235 std::unique_ptr<MirEvent> ev;226 std::unique_ptr<MirEvent> ev;
236 bool handler_called{false};227 bool handler_called{false};
237228
238 mircva::InputReceiver receiver{client_fd,229 mircva::InputReceiver receiver{channel.client_fd(),
239 std::make_shared<mircv::XKBMapper>(),230 std::make_shared<mircv::XKBMapper>(),
240 [&ev, &handler_called](MirEvent* event)231 [&ev, &handler_called](MirEvent* event)
241 {232 {
@@ -247,7 +238,7 @@
247 {238 {
248 return t;239 return t;
249 }};240 }};
250 TestingInputProducer producer(server_fd);241 TestingInputProducer producer(channel.server_fd());
251242
252 nanoseconds const one_frame = duration_cast<nanoseconds>(1s) / 60;243 nanoseconds const one_frame = duration_cast<nanoseconds>(1s) / 60;
253244
@@ -293,9 +284,9 @@
293{284{
294 bool handler_called = false;285 bool handler_called = false;
295286
296 TestingInputProducer producer(server_fd);287 TestingInputProducer producer(channel.server_fd());
297 mircva::InputReceiver receiver{288 mircva::InputReceiver receiver{
298 client_fd,289 channel.client_fd(),
299 std::make_shared<mircv::XKBMapper>(),290 std::make_shared<mircv::XKBMapper>(),
300 [&handler_called, &producer](MirEvent*)291 [&handler_called, &producer](MirEvent*)
301 {292 {
@@ -322,7 +313,7 @@
322313
323 int frames_triggered = 0;314 int frames_triggered = 0;
324315
325 mircva::InputReceiver receiver{client_fd,316 mircva::InputReceiver receiver{channel.client_fd(),
326 std::make_shared<mircv::XKBMapper>(),317 std::make_shared<mircv::XKBMapper>(),
327 [&frames_triggered](MirEvent*)318 [&frames_triggered](MirEvent*)
328 {319 {
@@ -333,7 +324,7 @@
333 {324 {
334 return t;325 return t;
335 }};326 }};
336 TestingInputProducer producer(server_fd);327 TestingInputProducer producer(channel.server_fd());
337328
338 std::chrono::nanoseconds const device_sample_interval = duration_cast<nanoseconds>(1s) / 250;329 std::chrono::nanoseconds const device_sample_interval = duration_cast<nanoseconds>(1s) / 250;
339 std::chrono::nanoseconds const frame_interval = duration_cast<nanoseconds>(1s) / 60;330 std::chrono::nanoseconds const frame_interval = duration_cast<nanoseconds>(1s) / 60;
@@ -375,12 +366,12 @@
375 std::chrono::nanoseconds t;366 std::chrono::nanoseconds t;
376367
377 mircva::InputReceiver receiver{368 mircva::InputReceiver receiver{
378 client_fd,369 channel.client_fd(),
379 std::make_shared<mircv::XKBMapper>(),370 std::make_shared<mircv::XKBMapper>(),
380 event_handler,371 event_handler,
381 std::make_shared<mircv::NullInputReceiverReport>(),372 std::make_shared<mircv::NullInputReceiverReport>(),
382 };373 };
383 TestingInputProducer producer(server_fd);374 TestingInputProducer producer(channel.server_fd());
384375
385 std::chrono::nanoseconds const one_millisecond = std::chrono::nanoseconds(1000000ULL);376 std::chrono::nanoseconds const one_millisecond = std::chrono::nanoseconds(1000000ULL);
386 std::chrono::nanoseconds const one_second = 1000 * one_millisecond;377 std::chrono::nanoseconds const one_second = 1000 * one_millisecond;
387378
=== modified file 'tests/unit-tests/input/CMakeLists.txt'
--- tests/unit-tests/input/CMakeLists.txt 2016-03-23 06:39:56 +0000
+++ tests/unit-tests/input/CMakeLists.txt 2016-04-05 19:30:54 +0000
@@ -7,6 +7,7 @@
7 ${CMAKE_CURRENT_SOURCE_DIR}/test_cursor_controller.cpp7 ${CMAKE_CURRENT_SOURCE_DIR}/test_cursor_controller.cpp
8 ${CMAKE_CURRENT_SOURCE_DIR}/test_xcursor_loader.cpp8 ${CMAKE_CURRENT_SOURCE_DIR}/test_xcursor_loader.cpp
9 ${CMAKE_CURRENT_SOURCE_DIR}/test_touchspot_controller.cpp9 ${CMAKE_CURRENT_SOURCE_DIR}/test_touchspot_controller.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/test_input_channel_factory.cpp
10 ${CMAKE_CURRENT_SOURCE_DIR}/test_input_event.cpp11 ${CMAKE_CURRENT_SOURCE_DIR}/test_input_event.cpp
11 ${CMAKE_CURRENT_SOURCE_DIR}/test_event_builders.cpp12 ${CMAKE_CURRENT_SOURCE_DIR}/test_event_builders.cpp
12 ${CMAKE_CURRENT_SOURCE_DIR}/test_default_device.cpp13 ${CMAKE_CURRENT_SOURCE_DIR}/test_default_device.cpp
1314
=== modified file 'tests/unit-tests/input/android/CMakeLists.txt'
--- tests/unit-tests/input/android/CMakeLists.txt 2016-03-23 06:39:56 +0000
+++ tests/unit-tests/input/android/CMakeLists.txt 2016-04-05 19:30:54 +0000
@@ -1,6 +1,5 @@
1list(APPEND UNIT_TEST_SOURCES1list(APPEND UNIT_TEST_SOURCES
2 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_input_lexicon.cpp2 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_input_lexicon.cpp
3 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_input_channel_factory.cpp
4 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_communication_package.cpp3 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_communication_package.cpp
5 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_input_sender.cpp4 ${CMAKE_CURRENT_SOURCE_DIR}/test_android_input_sender.cpp
6 ${CMAKE_CURRENT_SOURCE_DIR}/test_input_consumer.cpp5 ${CMAKE_CURRENT_SOURCE_DIR}/test_input_consumer.cpp
76
=== modified file 'tests/unit-tests/input/android/test_android_communication_package.cpp'
--- tests/unit-tests/input/android/test_android_communication_package.cpp 2014-03-06 06:05:17 +0000
+++ tests/unit-tests/input/android/test_android_communication_package.cpp 2016-04-05 19:30:54 +0000
@@ -16,7 +16,7 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#include "src/server/input/android/android_input_channel.h"19#include "src/server/input/channel.h"
2020
21#include <gtest/gtest.h>21#include <gtest/gtest.h>
22#include <gmock/gmock.h>22#include <gmock/gmock.h>
@@ -24,14 +24,13 @@
24#include <unistd.h>24#include <unistd.h>
25#include <fcntl.h>25#include <fcntl.h>
2626
27namespace droidinput = android;27namespace mi = mir::input;
28namespace mia = mir::input::android;
2928
30TEST(AndroidInputChannel, packages_own_valid_fds)29TEST(InputChannel, packages_own_valid_fds)
31{30{
32 int server_fd, client_fd;31 int server_fd, client_fd;
33 {32 {
34 mia::AndroidInputChannel package;33 mi::Channel package;
3534
36 server_fd = package.server_fd();35 server_fd = package.server_fd();
37 client_fd = package.client_fd();36 client_fd = package.client_fd();
3837
=== modified file 'tests/unit-tests/input/android/test_android_input_sender.cpp'
--- tests/unit-tests/input/android/test_android_input_sender.cpp 2016-03-23 06:39:56 +0000
+++ tests/unit-tests/input/android/test_android_input_sender.cpp 2016-04-05 19:30:54 +0000
@@ -18,7 +18,7 @@
1818
19#include "mir/events/event_private.h"19#include "mir/events/event_private.h"
2020
21#include "src/server/input/android/android_input_channel.h"21#include "src/server/input/channel.h"
22#include "src/server/input/android/input_sender.h"22#include "src/server/input/android/input_sender.h"
23#include "src/server/input/default_event_builder.h"23#include "src/server/input/default_event_builder.h"
24#include "src/server/report/null_report_factory.h"24#include "src/server/report/null_report_factory.h"
@@ -44,7 +44,6 @@
4444
45#include <boost/exception/all.hpp>45#include <boost/exception/all.hpp>
4646
47//#include <algorithm>
48#include <cstring>47#include <cstring>
4948
50namespace mi = mir::input;49namespace mi = mir::input;
@@ -140,7 +139,7 @@
140 fake_scene.observer->surface_removed(&stub_surface);139 fake_scene.observer->surface_removed(&stub_surface);
141 }140 }
142141
143 std::shared_ptr<mi::InputChannel> channel = std::make_shared<mia::AndroidInputChannel>();142 std::shared_ptr<mi::InputChannel> channel = std::make_shared<mi::Channel>();
144 mtd::StubSceneSurface stub_surface{channel->server_fd()};143 mtd::StubSceneSurface stub_surface{channel->server_fd()};
145 droidinput::sp<droidinput::InputChannel> client_channel{new droidinput::InputChannel(droidinput::String8("test"), channel->client_fd())};144 droidinput::sp<droidinput::InputChannel> client_channel{new droidinput::InputChannel(droidinput::String8("test"), channel->client_fd())};
146 droidinput::InputConsumer consumer{client_channel};145 droidinput::InputConsumer consumer{client_channel};
147146
=== modified file 'tests/unit-tests/input/android/test_input_consumer.cpp'
--- tests/unit-tests/input/android/test_input_consumer.cpp 2016-03-23 06:39:56 +0000
+++ tests/unit-tests/input/android/test_input_consumer.cpp 2016-04-05 19:30:54 +0000
@@ -18,7 +18,7 @@
1818
19#include "androidfw/Input.h"19#include "androidfw/Input.h"
20#include "androidfw/InputTransport.h"20#include "androidfw/InputTransport.h"
21#include "src/server/input/android/android_input_channel.h"21#include "src/server/input/channel.h"
22#include "mir/input/android/event_conversion_helpers.h"22#include "mir/input/android/event_conversion_helpers.h"
23#include "mir/input/android/android_input_lexicon.h"23#include "mir/input/android/android_input_lexicon.h"
24#include "mir/geometry/displacement.h"24#include "mir/geometry/displacement.h"
@@ -32,6 +32,7 @@
3232
33using namespace std::literals::chrono_literals;33using namespace std::literals::chrono_literals;
34namespace mia = mir::input::android;34namespace mia = mir::input::android;
35namespace mi = mir::input;
35namespace geom = mir::geometry;36namespace geom = mir::geometry;
3637
37namespace38namespace
@@ -58,7 +59,7 @@
58 mir::cookie::Blob default_cookie;59 mir::cookie::Blob default_cookie;
59 EventFactory events;60 EventFactory events;
60 std::chrono::milliseconds current_frame_time = 0ms;61 std::chrono::milliseconds current_frame_time = 0ms;
61 mia::AndroidInputChannel channel;62 mi::Channel channel;
62 geom::Displacement no_move{0,0};63 geom::Displacement no_move{0,0};
63 geom::Displacement no_scroll{0,0};64 geom::Displacement no_scroll{0,0};
64 geom::Point origin{0,0};65 geom::Point origin{0,0};
6566
=== renamed file 'tests/unit-tests/input/android/test_android_input_channel_factory.cpp' => 'tests/unit-tests/input/test_input_channel_factory.cpp'
--- tests/unit-tests/input/android/test_android_input_channel_factory.cpp 2015-06-17 05:20:42 +0000
+++ tests/unit-tests/input/test_input_channel_factory.cpp 2016-04-05 19:30:54 +0000
@@ -16,20 +16,20 @@
16 * Authored by: Robert Carr <robert.carr@canonical.com>16 * Authored by: Robert Carr <robert.carr@canonical.com>
17 */17 */
1818
19#include "src/server/input/android/android_input_channel.h"19#include "src/server/input/channel.h"
20#include "src/server/input/android/input_channel_factory.h"20#include "src/server/input/channel_factory.h"
2121
22#include <gtest/gtest.h>22#include <gtest/gtest.h>
23#include <gmock/gmock.h>23#include <gmock/gmock.h>
2424
25#include <initializer_list>25#include <initializer_list>
2626
27namespace mia = mir::input::android;27namespace mi = mir::input;
2828
29TEST(AndroidInputChannelFactory, channel_factory_returns_input_channel_with_fds)29TEST(InputChannelFactory, channel_factory_returns_input_channel_with_fds)
30{30{
31 mia::InputChannelFactory factory;31 mi::ChannelFactory factory;
3232
33 auto package = factory.make_input_channel();33 auto package = factory.make_input_channel();
34 EXPECT_NE(nullptr, std::dynamic_pointer_cast<mia::AndroidInputChannel>(package));34 EXPECT_NE(nullptr, std::dynamic_pointer_cast<mi::Channel>(package));
35}35}

Subscribers

People subscribed via source and target branches