1
/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
3
* Copyright (C) 2010 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by Mirco Müller <mirco.mueller@canonical.com>
27
namespace Unity.Tests.UI
29
public class HomeButtonSuite : Object, Shell
31
private const string DOMAIN = "/UI/HomeButton";
33
Unity.Testing.Window? window;
35
Unity.Testing.Director director;
36
Unity.Panel.HomeButton home_button;
37
public bool super_key_active {get; set;}
38
public bool is_starting {get; set;}
40
public HomeButtonSuite ()
42
Logging.init_fatal_handler ();
44
/* Testup the test window */
45
window = new Unity.Testing.Window (true, 1024, 600);
46
window.init_test_mode ();
48
window.title = "HomeButton Test";
51
home_button = new Unity.Panel.HomeButton (this);
52
director = new Unity.Testing.Director (stage);
54
Test.add_data_func (DOMAIN + "/HomeButton", test_click_home_button);
58
private void test_click_home_button ()
60
director.button_press (home_button, 1, true, 1.0f, 1.0f, false);
62
Logging.init_fatal_handler ();
64
assert (g_flag == true);
68
// mostly a dummy shell-implementation to satisfy the interface
70
public bool menus_swallow_events { get { return true; } }
72
public void get_window_details (uint32 xid, out bool a, out bool b)
77
public void do_window_action (uint32 xid, WindowAction action)
85
return ShellMode.MINIMIZED;
107
get_indicators_width ()
114
get_launcher_width_foobar ()
121
get_panel_height_foobar ()
128
ensure_input_region ()
134
add_fullscreen_request (Object o)
140
remove_fullscreen_request (Object o)
147
grab_keyboard (bool grab, uint32 timestamp)
153
about_to_show_places ()
159
close_xids (Array<uint32> xids)
165
show_window (uint32 xid)
171
expose_xids (Array<uint32> xids)
182
public uint32 get_current_time ()
184
return Clutter.get_current_event_time ();