2
* Copyright (C) 2015 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
#ifndef MOCKMAINLOOP_H
18
#define MOCKMAINLOOP_H
20
#include <mir/main_loop.h>
21
#include "gmock_fixes.h"
23
class MockMainLoop : public mir::MainLoop
27
~MockMainLoop() noexcept;
32
MOCK_METHOD2(register_signal_handler,
33
void(std::initializer_list<int>,
34
std::function<void(int)> const&));
36
MOCK_METHOD3(register_fd_handler,
37
void(std::initializer_list<int>, void const*,
38
std::function<void(int)> const&));
40
MOCK_METHOD1(unregister_fd_handler, void(void const*));
42
MOCK_METHOD2(enqueue, void(void const*, mir::ServerAction const&));
43
MOCK_METHOD1(pause_processing_for,void (void const*));
44
MOCK_METHOD1(resume_processing_for,void (void const*));
46
MOCK_METHOD1(create_alarm, std::unique_ptr<mir::time::Alarm>(std::function<void()> const& callback));
47
MOCK_METHOD1(create_alarm, std::unique_ptr<mir::time::Alarm>(std::shared_ptr<mir::LockableCallback> const& callback));
50
#endif // MOCKMAINLOOP_H