~mial/ubuntu/oneiric/unity/bug-791810

« back to all changes in this revision

Viewing changes to tests/ui/test-ui.vala

Import the work done so far with Compiz

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010 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 Neil Jagdish Patel <neil.patel@canonical.com>
 
17
 *
 
18
 */
 
19
using Gee;
 
20
using Unity;
 
21
using Unity.Testing;
 
22
using Unity.Tests.UI;
 
23
 
 
24
namespace Unity.Tests.UI
 
25
{
 
26
public class TestFavorites : Unity.Favorites
 
27
  {
 
28
    public override ArrayList<string> get_favorites ()
 
29
    {
 
30
      var retlist = new ArrayList<string> ();
 
31
      retlist.add ("app-firefox");
 
32
      return retlist;
 
33
    }
 
34
 
 
35
    public override string find_uid_for_desktop_file (string desktop_file)
 
36
    {
 
37
      return "app-firefox";
 
38
    }
 
39
 
 
40
    public override void add_favorite (string uid)
 
41
    {
 
42
    }
 
43
    public override void remove_favorite (string uid)
 
44
    {
 
45
    }
 
46
    public override bool is_favorite (string uid)
 
47
    {
 
48
      return true;
 
49
    }
 
50
 
 
51
    public override string? get_string (string uid, string name)
 
52
    {
 
53
      if (name == "type")
 
54
        return "application";
 
55
 
 
56
      return "/usr/share/applications/firefox.desktop";
 
57
    }
 
58
 
 
59
    public override void set_string (string uid, string name, string value)
 
60
    {
 
61
    }
 
62
 
 
63
    public override int? get_int (string uid, string name)
 
64
    {
 
65
      return null;
 
66
    }
 
67
    public override void set_int (string uid, string name, int value)
 
68
    {
 
69
    }
 
70
 
 
71
 
 
72
    public override float? get_float (string uid, string name)
 
73
    {
 
74
      return null;
 
75
    }
 
76
    public override void set_float (string uid, string name, float value)
 
77
    {
 
78
    }
 
79
 
 
80
    public override bool? get_bool (string uid, string name)
 
81
    {
 
82
      return null;
 
83
    }
 
84
 
 
85
    public override void set_bool (string uid, string name, bool value)
 
86
    {
 
87
    }
 
88
  }
 
89
}
 
90
 
 
91
public class Main
 
92
{
 
93
  public static int main (string[] args)
 
94
  {
 
95
    Logging         logger;
 
96
    QuicklistSuite  quicklist_suite;
 
97
    HomeButtonSuite home_button_suite;
 
98
    AutomationBasicTestSuite basic_test_suite;
 
99
    IndicatorTestSuite indicator_test_suite;
 
100
 
 
101
 
 
102
    Environment.set_variable ("UNITY_DISABLE_TRAY", "1", true);
 
103
    Environment.set_variable ("UNITY_DISABLE_IDLES", "1", true);
 
104
    Environment.set_variable ("UNITY_PANEL_INDICATORS_SKIP", "all", true);
 
105
 
 
106
    Gtk.init (ref args);
 
107
    Gtk.Settings.get_default ().gtk_xft_dpi = 96 * 1024;
 
108
 
 
109
    Ctk.init (ref args);
 
110
    Test.init (ref args);
 
111
 
 
112
    logger = new Logging ();
 
113
 
 
114
    basic_test_suite = new AutomationBasicTestSuite ();
 
115
    quicklist_suite = new QuicklistSuite ();
 
116
    home_button_suite = new HomeButtonSuite ();
 
117
    indicator_test_suite = new IndicatorTestSuite ();
 
118
 
 
119
    Timeout.add_seconds (3, ()=> {
 
120
      Test.run ();
 
121
      Gtk.main_quit ();
 
122
      return false;
 
123
    });
 
124
 
 
125
    Gtk.main ();
 
126
 
 
127
    return 0;
 
128
  }
 
129
}