Mir
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
input_testing_client_configuration.h
Go to the documentation of this file.
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>n
17  */
18 
19 #ifndef MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION
20 #define MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION
21 
25 
26 #include <mir_toolkit/event.h>
27 
28 #include <gmock/gmock.h>
29 
30 #include <string>
31 
32 namespace mir_test_framework
33 {
34 
39 {
40 public:
41  InputTestingClientConfiguration(std::string const& client_name, CrossProcessSync const& input_cb_setup_fence);
42  virtual ~InputTestingClientConfiguration() = default;
43 
44  void exec();
45 
47  {
48  MOCK_METHOD1(handle_input, void(MirEvent const*));
49  };
50  // This function will be called at an appropriate time for input expectations to be set.
51  // on handler. It is expected that mt::WakeUp(all_events_received) will be triggered by
52  // the last expectation, as this is what triggers the verification of the Mock and
53  // termination of the testing client.
54  virtual void expect_input(MockInputHandler &handler, mir::test::WaitCondition& all_events_received) = 0;
55 
56  // This fixture is intended to be used with InputTestingServer
57  // which allows for setting surface sizes as part of the
58  // input-testing shell.
59  static int const surface_width = 100;
60  static int const surface_height = 100;
61 private:
62  std::string const client_name;
63  CrossProcessSync input_cb_setup_fence;
64 };
65 
66 }
67 #endif /* MIR_TEST_FRAMEWORK_INPUT_TESTING_CLIENT_CONFIGURATION */
Definition: cross_process_sync.h:28
static int const surface_height
Definition: input_testing_client_configuration.h:60
virtual void expect_input(MockInputHandler &handler, mir::test::WaitCondition &all_events_received)=0
static int const surface_width
Definition: input_testing_client_configuration.h:59
A fixture to be used with InputTestingServerConfiguration for input acceptance testing scenarios...
Definition: input_testing_client_configuration.h:38
Definition: wait_condition.h:32
Definition: testing_client_configuration.h:27
InputTestingClientConfiguration(std::string const &client_name, CrossProcessSync const &input_cb_setup_fence)
Definition: event.h:207
Definition: input_testing_client_configuration.h:46

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