~thomas-voss/unity-system-compositor/fallback-gracefully-if-hw-api-is-missing-take-2

« back to all changes in this revision

Viewing changes to tests/include/usc/test/mock_screen.h

  • Committer: CI Train Bot
  • Author(s): CI Train Bot, Kevin DuBois, Alexandros Frantzis
  • Date: 2016-01-21 17:58:56 UTC
  • mfrom: (200.45.12 0.3)
  • Revision ID: ci-train-bot@canonical.com-20160121175856-m9rosowob03a105o
Release 0.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright © 2015 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 as
 
6
 * 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 USC_TEST_MOCK_SCREEN_H_
 
20
#define USC_TEST_MOCK_SCREEN_H_
 
21
 
 
22
#include "src/screen.h"
 
23
 
 
24
#include <gtest/gtest.h>
 
25
#include <gmock/gmock.h>
 
26
namespace usc
 
27
{
 
28
namespace test
 
29
{
 
30
 
 
31
struct MockScreen : usc::Screen
 
32
{
 
33
    MOCK_METHOD1(enable_inactivity_timers, void(bool enable));
 
34
    MOCK_METHOD0(keep_display_on_temporarily, void());
 
35
 
 
36
    MOCK_METHOD0(get_screen_power_mode, MirPowerMode());
 
37
    MOCK_METHOD2(set_screen_power_mode, void(MirPowerMode mode, PowerStateChangeReason reason));
 
38
    MOCK_METHOD1(keep_display_on, void(bool on));
 
39
    MOCK_METHOD1(set_brightness, void(int brightness));
 
40
    MOCK_METHOD1(enable_auto_brightness, void(bool enable));
 
41
    MOCK_METHOD2(set_inactivity_timeouts, void(int power_off_timeout, int dimmer_timeout));
 
42
 
 
43
    MOCK_METHOD1(set_touch_visualization_enabled, void(bool enabled));
 
44
 
 
45
    void register_power_state_change_handler(
 
46
        usc::PowerStateChangeHandler const& handler)
 
47
    {
 
48
        power_state_change_handler = handler;
 
49
    }
 
50
 
 
51
    usc::PowerStateChangeHandler power_state_change_handler;
 
52
};
 
53
 
 
54
}
 
55
}
 
56
 
 
57
#endif