Mir
mock_client_context.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 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 2 or 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: Alexandros Frantzis <alexandros.frantzis@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DOUBLES_MOCK_CLIENT_CONTEXT_H_
20 #define MIR_TEST_DOUBLES_MOCK_CLIENT_CONTEXT_H_
21 
23 #include "mir/client/client_context.h"
24 
25 #include <gmock/gmock.h>
26 
27 namespace mir
28 {
29 namespace test
30 {
31 namespace doubles
32 {
33 struct MockClientContext : public client::ClientContext
34 {
36  {
37  using namespace testing;
38 
39  EXPECT_CALL(*this, populate_server_package(_)).Times(AtLeast(0));
40  }
41 
42  MOCK_METHOD1(populate_server_package, void(MirPlatformPackage&));
43  MOCK_METHOD1(populate_graphics_module, void(MirModuleProperties&));
44  MOCK_METHOD3(platform_operation, MirWaitHandle*(
46  MOCK_METHOD4(allocate_buffer, void(geometry::Size, MirPixelFormat, MirBufferCallback, void*));
47  MOCK_METHOD5(allocate_buffer, void(geometry::Size, uint32_t, uint32_t, MirBufferCallback, void*));
48  MOCK_METHOD1(release_buffer, void(mir::client::MirBuffer*));
49 };
50 
51 }
52 }
53 }
54 
55 #endif /* MIR_TEST_DOUBLES_MOCK_CLIENT_CONTEXT_H_ */
Definition: size.h:30
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
Definition: client_types.h:237
struct MirBuffer MirBuffer
Definition: client_types.h:56
Definition: mock_client_context.h:33
void(* MirPlatformOperationCallback)(MirConnection *connection, MirPlatformMessage *reply, void *context)
Callback called when a platform operation completes.
Definition: client_types.h:480
MOCK_METHOD3(platform_operation, MirWaitHandle *(MirPlatformMessage const *, MirPlatformOperationCallback, void *))
struct MirWaitHandle MirWaitHandle
Returned by asynchronous functions.
Definition: client_types.h:79
Retrieved information about a loadable module.
Definition: client_types.h:253
MOCK_METHOD4(allocate_buffer, void(geometry::Size, MirPixelFormat, MirBufferCallback, void *))
struct MirPlatformMessage MirPlatformMessage
Definition: client_types.h:81
MockClientContext()
Definition: mock_client_context.h:35
void(* MirBufferCallback)(MirBuffer *, void *context)
Definition: client_types.h:497
MirPixelFormat
32-bit pixel formats (8888): The order of components in the enum matches the order of the components ...
Definition: common.h:241
MOCK_METHOD1(populate_server_package, void(MirPlatformPackage &))
MOCK_METHOD5(allocate_buffer, void(geometry::Size, uint32_t, uint32_t, MirBufferCallback, void *))

Copyright © 2012-2017 Canonical Ltd.
Generated on Mon Oct 30 19:44:55 UTC 2017