Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mock_scene.h
Go to the documentation of this file.
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: Daniel van Vugt <daniel.van.vugt@canonical.com>
17  */
18 
19 #ifndef MIR_TEST_DOUBLES_MOCK_SCENE_H_
20 #define MIR_TEST_DOUBLES_MOCK_SCENE_H_
21 
22 #include "mir/compositor/scene.h"
23 #include <gmock/gmock.h>
24 
25 namespace mir
26 {
27 namespace test
28 {
29 namespace doubles
30 {
31 
33 {
34 public:
36  {
37  ON_CALL(*this, generate_renderable_list())
38  .WillByDefault(testing::Return(graphics::RenderableList{}));
39  }
43  MOCK_METHOD1(set_change_callback, void(std::function<void()> const&));
44  MOCK_METHOD0(lock, void());
45  MOCK_METHOD0(unlock, void());
46 };
47 
48 } // namespace doubles
49 } // namespace test
50 } // namespace mir
51 
52 #endif /* MIR_TEST_DOUBLES_MOCK_SCENE_H_ */
virtual void for_each_if(FilterForScene &filter, OperatorForScene &op)=0
Definition: scene.h:34
MOCK_CONST_METHOD0(generate_renderable_list, graphics::RenderableList())
Definition: mock_scene.h:32
MOCK_METHOD2(for_each_if, void(compositor::FilterForScene &, compositor::OperatorForScene &))
Definition: scene.h:61
MockScene()
Definition: mock_scene.h:35
std::list< std::shared_ptr< Renderable > > RenderableList
Definition: renderable.h:88
MOCK_METHOD1(set_change_callback, void(std::function< void()> const &))
virtual void lock()=0
virtual graphics::RenderableList generate_renderable_list() const =0
Generate a valid list of renderables based on the current state of the Scene.
Definition: scene.h:47
virtual void set_change_callback(std::function< void()> const &f)=0
Sets a callback to be called whenever the state of the Scene changes.
virtual void unlock()=0

Copyright © 2012,2013 Canonical Ltd.
Generated on Fri Apr 11 21:14:53 UTC 2014