~ubuntu-multiseat/ubuntu/saucy/unity-greeter/bug1201122

« back to all changes in this revision

Viewing changes to tests/test.c

Tags: upstream-12.10.3
ImportĀ upstreamĀ versionĀ 12.10.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* test.c generated by valac 0.16.1, the Vala compiler
 
2
 * generated from test.vala, do not modify */
 
3
 
 
4
 
 
5
#include <glib.h>
 
6
#include <glib-object.h>
 
7
#include <gtk/gtk.h>
 
8
#include <unistd.h>
 
9
#include <gdk/gdk.h>
 
10
#include <stdlib.h>
 
11
#include <string.h>
 
12
#include <lightdm.h>
 
13
#include <glib/gstdio.h>
 
14
#include <gobject/gvaluecollector.h>
 
15
 
 
16
 
 
17
#define TYPE_TEST (test_get_type ())
 
18
#define TEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST, Test))
 
19
#define TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST, TestClass))
 
20
#define IS_TEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST))
 
21
#define IS_TEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST))
 
22
#define TEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST, TestClass))
 
23
 
 
24
typedef struct _Test Test;
 
25
typedef struct _TestClass TestClass;
 
26
typedef struct _TestPrivate TestPrivate;
 
27
 
 
28
#define TYPE_MAIN_WINDOW (main_window_get_type ())
 
29
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
 
30
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
 
31
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
 
32
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
 
33
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))
 
34
 
 
35
typedef struct _MainWindow MainWindow;
 
36
typedef struct _MainWindowClass MainWindowClass;
 
37
 
 
38
#define TYPE_TEST_MAIN_WINDOW (test_main_window_get_type ())
 
39
#define TEST_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_MAIN_WINDOW, TestMainWindow))
 
40
#define TEST_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_MAIN_WINDOW, TestMainWindowClass))
 
41
#define IS_TEST_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_MAIN_WINDOW))
 
42
#define IS_TEST_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_MAIN_WINDOW))
 
43
#define TEST_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_MAIN_WINDOW, TestMainWindowClass))
 
44
 
 
45
typedef struct _TestMainWindow TestMainWindow;
 
46
typedef struct _TestMainWindowClass TestMainWindowClass;
 
47
 
 
48
#define TYPE_BACKGROUND (background_get_type ())
 
49
#define BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_BACKGROUND, Background))
 
50
#define BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_BACKGROUND, BackgroundClass))
 
51
#define IS_BACKGROUND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_BACKGROUND))
 
52
#define IS_BACKGROUND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_BACKGROUND))
 
53
#define BACKGROUND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_BACKGROUND, BackgroundClass))
 
54
 
 
55
typedef struct _Background Background;
 
56
typedef struct _BackgroundClass BackgroundClass;
 
57
typedef struct _MainWindowPrivate MainWindowPrivate;
 
58
 
 
59
#define TYPE_FADABLE_BOX (fadable_box_get_type ())
 
60
#define FADABLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_FADABLE_BOX, FadableBox))
 
61
#define FADABLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_FADABLE_BOX, FadableBoxClass))
 
62
#define IS_FADABLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_FADABLE_BOX))
 
63
#define IS_FADABLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_FADABLE_BOX))
 
64
#define FADABLE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_FADABLE_BOX, FadableBoxClass))
 
65
 
 
66
typedef struct _FadableBox FadableBox;
 
67
typedef struct _FadableBoxClass FadableBoxClass;
 
68
 
 
69
#define TYPE_GREETER_LIST (greeter_list_get_type ())
 
70
#define GREETER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_GREETER_LIST, GreeterList))
 
71
#define GREETER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_GREETER_LIST, GreeterListClass))
 
72
#define IS_GREETER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_GREETER_LIST))
 
73
#define IS_GREETER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_GREETER_LIST))
 
74
#define GREETER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_GREETER_LIST, GreeterListClass))
 
75
 
 
76
typedef struct _GreeterList GreeterList;
 
77
typedef struct _GreeterListClass GreeterListClass;
 
78
 
 
79
#define TYPE_USER_LIST (user_list_get_type ())
 
80
#define USER_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_USER_LIST, UserList))
 
81
#define USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_USER_LIST, UserListClass))
 
82
#define IS_USER_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_USER_LIST))
 
83
#define IS_USER_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_USER_LIST))
 
84
#define USER_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_USER_LIST, UserListClass))
 
85
 
 
86
typedef struct _UserList UserList;
 
87
typedef struct _UserListClass UserListClass;
 
88
 
 
89
#define TYPE_MENU_BAR (menu_bar_get_type ())
 
90
#define MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MENU_BAR, MenuBar))
 
91
#define MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MENU_BAR, MenuBarClass))
 
92
#define IS_MENU_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MENU_BAR))
 
93
#define IS_MENU_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MENU_BAR))
 
94
#define MENU_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MENU_BAR, MenuBarClass))
 
95
 
 
96
typedef struct _MenuBar MenuBar;
 
97
typedef struct _MenuBarClass MenuBarClass;
 
98
 
 
99
#define TYPE_LIST_STACK (list_stack_get_type ())
 
100
#define LIST_STACK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_LIST_STACK, ListStack))
 
101
#define LIST_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_LIST_STACK, ListStackClass))
 
102
#define IS_LIST_STACK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_LIST_STACK))
 
103
#define IS_LIST_STACK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_LIST_STACK))
 
104
#define LIST_STACK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_LIST_STACK, ListStackClass))
 
105
 
 
106
typedef struct _ListStack ListStack;
 
107
typedef struct _ListStackClass ListStackClass;
 
108
 
 
109
#define TYPE_TEST_LIST (test_list_get_type ())
 
110
#define TEST_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_TEST_LIST, TestList))
 
111
#define TEST_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_TEST_LIST, TestListClass))
 
112
#define IS_TEST_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_TEST_LIST))
 
113
#define IS_TEST_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_TEST_LIST))
 
114
#define TEST_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_TEST_LIST, TestListClass))
 
115
 
 
116
typedef struct _TestList TestList;
 
117
typedef struct _TestListClass TestListClass;
 
118
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
119
 
 
120
#define TYPE_DASH_ENTRY (dash_entry_get_type ())
 
121
#define DASH_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_DASH_ENTRY, DashEntry))
 
122
#define DASH_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_DASH_ENTRY, DashEntryClass))
 
123
#define IS_DASH_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_DASH_ENTRY))
 
124
#define IS_DASH_ENTRY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_DASH_ENTRY))
 
125
#define DASH_ENTRY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_DASH_ENTRY, DashEntryClass))
 
126
 
 
127
typedef struct _DashEntry DashEntry;
 
128
typedef struct _DashEntryClass DashEntryClass;
 
129
 
 
130
#define TYPE_PROMPT_BOX (prompt_box_get_type ())
 
131
#define PROMPT_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PROMPT_BOX, PromptBox))
 
132
#define PROMPT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PROMPT_BOX, PromptBoxClass))
 
133
#define IS_PROMPT_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PROMPT_BOX))
 
134
#define IS_PROMPT_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PROMPT_BOX))
 
135
#define PROMPT_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PROMPT_BOX, PromptBoxClass))
 
136
 
 
137
typedef struct _PromptBox PromptBox;
 
138
typedef struct _PromptBoxClass PromptBoxClass;
 
139
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
 
140
 
 
141
#define GREETER_LIST_TYPE_SCROLL_TARGET (greeter_list_scroll_target_get_type ())
 
142
#define __vala_GdkEvent_free0(var) ((var == NULL) ? NULL : (var = (_vala_GdkEvent_free (var), NULL)))
 
143
typedef struct _Block1Data Block1Data;
 
144
typedef struct _Block2Data Block2Data;
 
145
#define _g_free0(var) (var = (g_free (var), NULL))
 
146
typedef struct _Block3Data Block3Data;
 
147
typedef struct _Block4Data Block4Data;
 
148
typedef struct _Block5Data Block5Data;
 
149
typedef struct _Block6Data Block6Data;
 
150
 
 
151
#define TYPE_UNITY_GREETER (unity_greeter_get_type ())
 
152
#define UNITY_GREETER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_UNITY_GREETER, UnityGreeter))
 
153
#define UNITY_GREETER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_UNITY_GREETER, UnityGreeterClass))
 
154
#define IS_UNITY_GREETER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_UNITY_GREETER))
 
155
#define IS_UNITY_GREETER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_UNITY_GREETER))
 
156
#define UNITY_GREETER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_UNITY_GREETER, UnityGreeterClass))
 
157
 
 
158
typedef struct _UnityGreeter UnityGreeter;
 
159
typedef struct _UnityGreeterClass UnityGreeterClass;
 
160
typedef struct _UnityGreeterPrivate UnityGreeterPrivate;
 
161
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
162
#define _unity_greeter_unref0(var) ((var == NULL) ? NULL : (var = (unity_greeter_unref (var), NULL)))
 
163
typedef struct _ParamSpecTest ParamSpecTest;
 
164
 
 
165
struct _Test {
 
166
        GTypeInstance parent_instance;
 
167
        volatile int ref_count;
 
168
        TestPrivate * priv;
 
169
};
 
170
 
 
171
struct _TestClass {
 
172
        GTypeClass parent_class;
 
173
        void (*finalize) (Test *self);
 
174
};
 
175
 
 
176
struct _MainWindow {
 
177
        GtkWindow parent_instance;
 
178
        MainWindowPrivate * priv;
 
179
        UserList* user_list;
 
180
        MenuBar* menubar;
 
181
        ListStack* stack;
 
182
};
 
183
 
 
184
struct _MainWindowClass {
 
185
        GtkWindowClass parent_class;
 
186
};
 
187
 
 
188
typedef enum  {
 
189
        GREETER_LIST_SCROLL_TARGET_START,
 
190
        GREETER_LIST_SCROLL_TARGET_END,
 
191
        GREETER_LIST_SCROLL_TARGET_UP,
 
192
        GREETER_LIST_SCROLL_TARGET_DOWN
 
193
} GreeterListScrollTarget;
 
194
 
 
195
struct _Block1Data {
 
196
        int _ref_count_;
 
197
        TestList* list;
 
198
        gboolean done;
 
199
};
 
200
 
 
201
struct _Block2Data {
 
202
        int _ref_count_;
 
203
        TestList* list;
 
204
        gchar* nonRemoteEntry;
 
205
        gboolean done;
 
206
};
 
207
 
 
208
struct _Block3Data {
 
209
        int _ref_count_;
 
210
        TestList* list;
 
211
        gboolean done;
 
212
};
 
213
 
 
214
struct _Block4Data {
 
215
        int _ref_count_;
 
216
        TestList* list;
 
217
        gboolean done;
 
218
};
 
219
 
 
220
struct _Block5Data {
 
221
        int _ref_count_;
 
222
        TestList* list;
 
223
        gboolean done;
 
224
};
 
225
 
 
226
struct _Block6Data {
 
227
        int _ref_count_;
 
228
        TestList* list;
 
229
        gchar* nonRemoteEntry;
 
230
        gboolean done;
 
231
};
 
232
 
 
233
struct _UnityGreeter {
 
234
        GTypeInstance parent_instance;
 
235
        volatile int ref_count;
 
236
        UnityGreeterPrivate * priv;
 
237
        gboolean test_mode;
 
238
        gboolean session_started;
 
239
        gchar* last_respond_response;
 
240
};
 
241
 
 
242
struct _UnityGreeterClass {
 
243
        GTypeClass parent_class;
 
244
        void (*finalize) (UnityGreeter *self);
 
245
};
 
246
 
 
247
struct _ParamSpecTest {
 
248
        GParamSpec parent_instance;
 
249
};
 
250
 
 
251
 
 
252
static gpointer test_parent_class = NULL;
 
253
extern UnityGreeter* unity_greeter_singleton;
 
254
 
 
255
gpointer test_ref (gpointer instance);
 
256
void test_unref (gpointer instance);
 
257
GParamSpec* param_spec_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 
258
void value_set_test (GValue* value, gpointer v_object);
 
259
void value_take_test (GValue* value, gpointer v_object);
 
260
gpointer value_get_test (const GValue* value);
 
261
GType test_get_type (void) G_GNUC_CONST;
 
262
enum  {
 
263
        TEST_DUMMY_PROPERTY
 
264
};
 
265
GType main_window_get_type (void) G_GNUC_CONST;
 
266
static MainWindow* test_setup (void);
 
267
TestMainWindow* test_main_window_new (void);
 
268
TestMainWindow* test_main_window_construct (GType object_type);
 
269
GType test_main_window_get_type (void) G_GNUC_CONST;
 
270
GType background_get_type (void) G_GNUC_CONST;
 
271
Background* test_main_window_get_background (TestMainWindow* self);
 
272
GType fadable_box_get_type (void) G_GNUC_CONST;
 
273
GType greeter_list_get_type (void) G_GNUC_CONST;
 
274
GType user_list_get_type (void) G_GNUC_CONST;
 
275
GType menu_bar_get_type (void) G_GNUC_CONST;
 
276
GType list_stack_get_type (void) G_GNUC_CONST;
 
277
TestList* test_list_new (Background* bg, MenuBar* mb);
 
278
TestList* test_list_construct (GType object_type, Background* bg, MenuBar* mb);
 
279
GType test_list_get_type (void) G_GNUC_CONST;
 
280
void main_window_push_list (MainWindow* self, GreeterList* widget);
 
281
static void test_process_events (void);
 
282
static void test_wait_for_scrolling_end (TestList* list);
 
283
gboolean test_list_is_scrolling (TestList* self);
 
284
GType dash_entry_get_type (void) G_GNUC_CONST;
 
285
static DashEntry* test_remote_directory_entry_email_field (TestList* list);
 
286
GType prompt_box_get_type (void) G_GNUC_CONST;
 
287
PromptBox* greeter_list_get_selected_entry (GreeterList* self);
 
288
static DashEntry* test_remote_directory_entry_password_field (TestList* list);
 
289
static DashEntry* test_remote_login_entry_domain_field (TestList* list);
 
290
static DashEntry* test_remote_login_entry_username_field (TestList* list);
 
291
static DashEntry* test_remote_login_entry_password_field (TestList* list);
 
292
GType greeter_list_scroll_target_get_type (void) G_GNUC_CONST;
 
293
static void test_do_scroll (TestList* list, GreeterListScrollTarget direction);
 
294
static void test_inject_key (GtkWidget* w, gint keyval);
 
295
static void test_scroll_to_remote_login (TestList* list);
 
296
const gchar* prompt_box_get_id (PromptBox* self);
 
297
static void _vala_GdkEvent_free (GdkEvent* self);
 
298
static void test_wait_for_focus (GtkWidget* w);
 
299
void test_simple_navigation (void);
 
300
GreeterList* list_stack_top (ListStack* self);
 
301
guint test_list_num_entries (TestList* self);
 
302
void test_remote_login (void);
 
303
gboolean prompt_box_get_has_errors (PromptBox* self);
 
304
void test_remote_login_servers_updated_signal (void);
 
305
static Block1Data* block1_data_ref (Block1Data* _data1_);
 
306
static void block1_data_unref (void * _userdata_);
 
307
static gboolean __lambda34_ (Block1Data* _data1_);
 
308
static gboolean ___lambda34__gsource_func (gpointer self);
 
309
void test_remote_login_servers_updated_signal_focus_not_in_remote_server (void);
 
310
static Block2Data* block2_data_ref (Block2Data* _data2_);
 
311
static void block2_data_unref (void * _userdata_);
 
312
static gboolean __lambda35_ (Block2Data* _data2_);
 
313
static gboolean ___lambda35__gsource_func (gpointer self);
 
314
void test_remote_login_login_servers_updated_signal (void);
 
315
static Block3Data* block3_data_ref (Block3Data* _data3_);
 
316
static void block3_data_unref (void * _userdata_);
 
317
static gboolean __lambda36_ (Block3Data* _data3_);
 
318
static gboolean ___lambda36__gsource_func (gpointer self);
 
319
void test_remote_login_login_servers_updated_signal_focus_not_in_removed_server (void);
 
320
static Block4Data* block4_data_ref (Block4Data* _data4_);
 
321
static void block4_data_unref (void * _userdata_);
 
322
static gboolean __lambda37_ (Block4Data* _data4_);
 
323
static gboolean ___lambda37__gsource_func (gpointer self);
 
324
void test_remote_login_remote_login_changed_signal (void);
 
325
static Block5Data* block5_data_ref (Block5Data* _data5_);
 
326
static void block5_data_unref (void * _userdata_);
 
327
static gboolean __lambda38_ (Block5Data* _data5_);
 
328
static gboolean ___lambda38__gsource_func (gpointer self);
 
329
void test_remote_login_remote_login_changed_signalfocus_not_in_changed_server (void);
 
330
static Block6Data* block6_data_ref (Block6Data* _data6_);
 
331
static void block6_data_unref (void * _userdata_);
 
332
static gboolean __lambda39_ (Block6Data* _data6_);
 
333
static gboolean ___lambda39__gsource_func (gpointer self);
 
334
void test_remote_login_authentication (void);
 
335
gpointer unity_greeter_ref (gpointer instance);
 
336
void unity_greeter_unref (gpointer instance);
 
337
GParamSpec* param_spec_unity_greeter (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags);
 
338
void value_set_unity_greeter (GValue* value, gpointer v_object);
 
339
void value_take_unity_greeter (GValue* value, gpointer v_object);
 
340
gpointer value_get_unity_greeter (const GValue* value);
 
341
GType unity_greeter_get_type (void) G_GNUC_CONST;
 
342
void test_remote_login_cancel_authentication (void);
 
343
gboolean dash_entry_get_did_respond (DashEntry* self);
 
344
void greeter_list_cancel_authentication (GreeterList* self);
 
345
void test_email_autocomplete (void);
 
346
void test_greeter_communcation (void);
 
347
void test_unsupported_server_type (void);
 
348
static void test_setup_gsettings (void);
 
349
gint test_main (gchar** args, int args_length1);
 
350
UnityGreeter* unity_greeter_new (void);
 
351
UnityGreeter* unity_greeter_construct (GType object_type);
 
352
static void _test_simple_navigation_gcallback (void);
 
353
static void _test_remote_login_gcallback (void);
 
354
static void _test_remote_login_servers_updated_signal_gcallback (void);
 
355
static void _test_remote_login_servers_updated_signal_focus_not_in_remote_server_gcallback (void);
 
356
static void _test_remote_login_login_servers_updated_signal_gcallback (void);
 
357
static void _test_remote_login_login_servers_updated_signal_focus_not_in_removed_server_gcallback (void);
 
358
static void _test_remote_login_remote_login_changed_signal_gcallback (void);
 
359
static void _test_remote_login_remote_login_changed_signalfocus_not_in_changed_server_gcallback (void);
 
360
static void _test_remote_login_authentication_gcallback (void);
 
361
static void _test_remote_login_cancel_authentication_gcallback (void);
 
362
static void _test_email_autocomplete_gcallback (void);
 
363
static void _test_greeter_communcation_gcallback (void);
 
364
static void _test_unsupported_server_type_gcallback (void);
 
365
Test* test_new (void);
 
366
Test* test_construct (GType object_type);
 
367
static void test_finalize (Test* obj);
 
368
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
369
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
370
 
 
371
 
 
372
static MainWindow* test_setup (void) {
 
373
        MainWindow* result = NULL;
 
374
        TestMainWindow* _tmp0_;
 
375
        TestMainWindow* _tmp1_;
 
376
        TestMainWindow* main_window;
 
377
        Background* _tmp2_ = NULL;
 
378
        Background* _tmp3_;
 
379
        MenuBar* _tmp4_;
 
380
        TestList* _tmp5_;
 
381
        TestList* _tmp6_;
 
382
        TestList* _tmp7_;
 
383
        TestList* list;
 
384
        _tmp0_ = test_main_window_new ();
 
385
        _tmp1_ = g_object_ref_sink (_tmp0_);
 
386
        main_window = _tmp1_;
 
387
        _tmp2_ = test_main_window_get_background (main_window);
 
388
        _tmp3_ = _tmp2_;
 
389
        _tmp4_ = ((MainWindow*) main_window)->menubar;
 
390
        _tmp5_ = test_list_new (_tmp3_, _tmp4_);
 
391
        _tmp6_ = g_object_ref_sink (_tmp5_);
 
392
        _tmp7_ = _tmp6_;
 
393
        _g_object_unref0 (_tmp3_);
 
394
        list = _tmp7_;
 
395
        main_window_push_list ((MainWindow*) main_window, (GreeterList*) list);
 
396
        gtk_widget_show_all ((GtkWidget*) main_window);
 
397
        test_process_events ();
 
398
        result = (MainWindow*) main_window;
 
399
        _g_object_unref0 (list);
 
400
        return result;
 
401
}
 
402
 
 
403
 
 
404
static void test_process_events (void) {
 
405
        while (TRUE) {
 
406
                gboolean _tmp0_ = FALSE;
 
407
                _tmp0_ = gtk_events_pending ();
 
408
                if (!_tmp0_) {
 
409
                        break;
 
410
                }
 
411
                gtk_main_iteration ();
 
412
        }
 
413
}
 
414
 
 
415
 
 
416
static void test_wait_for_scrolling_end (TestList* list) {
 
417
        g_return_if_fail (list != NULL);
 
418
        while (TRUE) {
 
419
                TestList* _tmp0_;
 
420
                gboolean _tmp1_ = FALSE;
 
421
                _tmp0_ = list;
 
422
                _tmp1_ = test_list_is_scrolling (_tmp0_);
 
423
                if (!_tmp1_) {
 
424
                        break;
 
425
                }
 
426
                test_process_events ();
 
427
                usleep ((guint) 10000);
 
428
        }
 
429
}
 
430
 
 
431
 
 
432
static gpointer _g_object_ref0 (gpointer self) {
 
433
        return self ? g_object_ref (self) : NULL;
 
434
}
 
435
 
 
436
 
 
437
static DashEntry* test_remote_directory_entry_email_field (TestList* list) {
 
438
        DashEntry* result = NULL;
 
439
        TestList* _tmp0_;
 
440
        PromptBox* _tmp1_;
 
441
        PromptBox* _tmp2_;
 
442
        GtkWidget* _tmp3_ = NULL;
 
443
        GtkFixed* _tmp4_;
 
444
        GtkFixed* fixed;
 
445
        GList* _tmp5_ = NULL;
 
446
        GList* _tmp6_;
 
447
        gconstpointer _tmp7_ = NULL;
 
448
        GtkGrid* _tmp8_;
 
449
        GtkGrid* _tmp9_;
 
450
        GtkGrid* grid;
 
451
        GtkWidget* _tmp10_ = NULL;
 
452
        DashEntry* _tmp11_;
 
453
        g_return_val_if_fail (list != NULL, NULL);
 
454
        _tmp0_ = list;
 
455
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
456
        _tmp2_ = _tmp1_;
 
457
        _tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
 
458
        _tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
 
459
        fixed = _tmp4_;
 
460
        _tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
 
461
        _tmp6_ = _tmp5_;
 
462
        _tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
 
463
        _tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
 
464
        _tmp9_ = _tmp8_;
 
465
        _g_list_free0 (_tmp6_);
 
466
        grid = _tmp9_;
 
467
        _tmp10_ = gtk_grid_get_child_at (grid, 1, 1);
 
468
        _tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
 
469
        result = _tmp11_;
 
470
        _g_object_unref0 (grid);
 
471
        _g_object_unref0 (fixed);
 
472
        return result;
 
473
}
 
474
 
 
475
 
 
476
static DashEntry* test_remote_directory_entry_password_field (TestList* list) {
 
477
        DashEntry* result = NULL;
 
478
        TestList* _tmp0_;
 
479
        PromptBox* _tmp1_;
 
480
        PromptBox* _tmp2_;
 
481
        GtkWidget* _tmp3_ = NULL;
 
482
        GtkFixed* _tmp4_;
 
483
        GtkFixed* fixed;
 
484
        GList* _tmp5_ = NULL;
 
485
        GList* _tmp6_;
 
486
        gconstpointer _tmp7_ = NULL;
 
487
        GtkGrid* _tmp8_;
 
488
        GtkGrid* _tmp9_;
 
489
        GtkGrid* grid;
 
490
        GtkWidget* _tmp10_ = NULL;
 
491
        DashEntry* _tmp11_;
 
492
        g_return_val_if_fail (list != NULL, NULL);
 
493
        _tmp0_ = list;
 
494
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
495
        _tmp2_ = _tmp1_;
 
496
        _tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
 
497
        _tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
 
498
        fixed = _tmp4_;
 
499
        _tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
 
500
        _tmp6_ = _tmp5_;
 
501
        _tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
 
502
        _tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
 
503
        _tmp9_ = _tmp8_;
 
504
        _g_list_free0 (_tmp6_);
 
505
        grid = _tmp9_;
 
506
        _tmp10_ = gtk_grid_get_child_at (grid, 1, 2);
 
507
        _tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
 
508
        result = _tmp11_;
 
509
        _g_object_unref0 (grid);
 
510
        _g_object_unref0 (fixed);
 
511
        return result;
 
512
}
 
513
 
 
514
 
 
515
static DashEntry* test_remote_login_entry_domain_field (TestList* list) {
 
516
        DashEntry* result = NULL;
 
517
        TestList* _tmp0_;
 
518
        PromptBox* _tmp1_;
 
519
        PromptBox* _tmp2_;
 
520
        GtkWidget* _tmp3_ = NULL;
 
521
        GtkFixed* _tmp4_;
 
522
        GtkFixed* fixed;
 
523
        GList* _tmp5_ = NULL;
 
524
        GList* _tmp6_;
 
525
        gconstpointer _tmp7_ = NULL;
 
526
        GtkGrid* _tmp8_;
 
527
        GtkGrid* _tmp9_;
 
528
        GtkGrid* grid;
 
529
        GtkWidget* _tmp10_ = NULL;
 
530
        DashEntry* _tmp11_;
 
531
        g_return_val_if_fail (list != NULL, NULL);
 
532
        _tmp0_ = list;
 
533
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
534
        _tmp2_ = _tmp1_;
 
535
        _tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
 
536
        _tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
 
537
        fixed = _tmp4_;
 
538
        _tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
 
539
        _tmp6_ = _tmp5_;
 
540
        _tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
 
541
        _tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
 
542
        _tmp9_ = _tmp8_;
 
543
        _g_list_free0 (_tmp6_);
 
544
        grid = _tmp9_;
 
545
        _tmp10_ = gtk_grid_get_child_at (grid, 1, 1);
 
546
        _tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
 
547
        result = _tmp11_;
 
548
        _g_object_unref0 (grid);
 
549
        _g_object_unref0 (fixed);
 
550
        return result;
 
551
}
 
552
 
 
553
 
 
554
static DashEntry* test_remote_login_entry_username_field (TestList* list) {
 
555
        DashEntry* result = NULL;
 
556
        TestList* _tmp0_;
 
557
        PromptBox* _tmp1_;
 
558
        PromptBox* _tmp2_;
 
559
        GtkWidget* _tmp3_ = NULL;
 
560
        GtkFixed* _tmp4_;
 
561
        GtkFixed* fixed;
 
562
        GList* _tmp5_ = NULL;
 
563
        GList* _tmp6_;
 
564
        gconstpointer _tmp7_ = NULL;
 
565
        GtkGrid* _tmp8_;
 
566
        GtkGrid* _tmp9_;
 
567
        GtkGrid* grid;
 
568
        GtkWidget* _tmp10_ = NULL;
 
569
        DashEntry* _tmp11_;
 
570
        g_return_val_if_fail (list != NULL, NULL);
 
571
        _tmp0_ = list;
 
572
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
573
        _tmp2_ = _tmp1_;
 
574
        _tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
 
575
        _tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
 
576
        fixed = _tmp4_;
 
577
        _tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
 
578
        _tmp6_ = _tmp5_;
 
579
        _tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
 
580
        _tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
 
581
        _tmp9_ = _tmp8_;
 
582
        _g_list_free0 (_tmp6_);
 
583
        grid = _tmp9_;
 
584
        _tmp10_ = gtk_grid_get_child_at (grid, 1, 2);
 
585
        _tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
 
586
        result = _tmp11_;
 
587
        _g_object_unref0 (grid);
 
588
        _g_object_unref0 (fixed);
 
589
        return result;
 
590
}
 
591
 
 
592
 
 
593
static DashEntry* test_remote_login_entry_password_field (TestList* list) {
 
594
        DashEntry* result = NULL;
 
595
        TestList* _tmp0_;
 
596
        PromptBox* _tmp1_;
 
597
        PromptBox* _tmp2_;
 
598
        GtkWidget* _tmp3_ = NULL;
 
599
        GtkFixed* _tmp4_;
 
600
        GtkFixed* fixed;
 
601
        GList* _tmp5_ = NULL;
 
602
        GList* _tmp6_;
 
603
        gconstpointer _tmp7_ = NULL;
 
604
        GtkGrid* _tmp8_;
 
605
        GtkGrid* _tmp9_;
 
606
        GtkGrid* grid;
 
607
        GtkWidget* _tmp10_ = NULL;
 
608
        DashEntry* _tmp11_;
 
609
        g_return_val_if_fail (list != NULL, NULL);
 
610
        _tmp0_ = list;
 
611
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
612
        _tmp2_ = _tmp1_;
 
613
        _tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
 
614
        _tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
 
615
        fixed = _tmp4_;
 
616
        _tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
 
617
        _tmp6_ = _tmp5_;
 
618
        _tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
 
619
        _tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
 
620
        _tmp9_ = _tmp8_;
 
621
        _g_list_free0 (_tmp6_);
 
622
        grid = _tmp9_;
 
623
        _tmp10_ = gtk_grid_get_child_at (grid, 1, 3);
 
624
        _tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
 
625
        result = _tmp11_;
 
626
        _g_object_unref0 (grid);
 
627
        _g_object_unref0 (fixed);
 
628
        return result;
 
629
}
 
630
 
 
631
 
 
632
static void test_do_scroll (TestList* list, GreeterListScrollTarget direction) {
 
633
        GreeterListScrollTarget _tmp0_;
 
634
        TestList* _tmp5_;
 
635
        g_return_if_fail (list != NULL);
 
636
        test_process_events ();
 
637
        _tmp0_ = direction;
 
638
        switch (_tmp0_) {
 
639
                case GREETER_LIST_SCROLL_TARGET_START:
 
640
                {
 
641
                        TestList* _tmp1_;
 
642
                        _tmp1_ = list;
 
643
                        test_inject_key ((GtkWidget*) _tmp1_, GDK_KEY_Page_Up);
 
644
                        break;
 
645
                }
 
646
                case GREETER_LIST_SCROLL_TARGET_END:
 
647
                {
 
648
                        TestList* _tmp2_;
 
649
                        _tmp2_ = list;
 
650
                        test_inject_key ((GtkWidget*) _tmp2_, GDK_KEY_Page_Down);
 
651
                        break;
 
652
                }
 
653
                case GREETER_LIST_SCROLL_TARGET_UP:
 
654
                {
 
655
                        TestList* _tmp3_;
 
656
                        _tmp3_ = list;
 
657
                        test_inject_key ((GtkWidget*) _tmp3_, GDK_KEY_Up);
 
658
                        break;
 
659
                }
 
660
                case GREETER_LIST_SCROLL_TARGET_DOWN:
 
661
                {
 
662
                        TestList* _tmp4_;
 
663
                        _tmp4_ = list;
 
664
                        test_inject_key ((GtkWidget*) _tmp4_, GDK_KEY_Down);
 
665
                        break;
 
666
                }
 
667
                default:
 
668
                break;
 
669
        }
 
670
        _tmp5_ = list;
 
671
        test_wait_for_scrolling_end (_tmp5_);
 
672
}
 
673
 
 
674
 
 
675
static void test_scroll_to_remote_login (TestList* list) {
 
676
        TestList* _tmp0_;
 
677
        g_return_if_fail (list != NULL);
 
678
        _tmp0_ = list;
 
679
        test_do_scroll (_tmp0_, GREETER_LIST_SCROLL_TARGET_END);
 
680
        while (TRUE) {
 
681
                TestList* _tmp1_;
 
682
                PromptBox* _tmp2_;
 
683
                PromptBox* _tmp3_;
 
684
                const gchar* _tmp4_;
 
685
                const gchar* _tmp5_;
 
686
                TestList* _tmp6_;
 
687
                _tmp1_ = list;
 
688
                _tmp2_ = greeter_list_get_selected_entry ((GreeterList*) _tmp1_);
 
689
                _tmp3_ = _tmp2_;
 
690
                _tmp4_ = prompt_box_get_id (_tmp3_);
 
691
                _tmp5_ = _tmp4_;
 
692
                if (!(g_strcmp0 (_tmp5_, "*guest") == 0)) {
 
693
                        break;
 
694
                }
 
695
                _tmp6_ = list;
 
696
                test_do_scroll (_tmp6_, GREETER_LIST_SCROLL_TARGET_END);
 
697
                test_process_events ();
 
698
                usleep ((guint) 10000);
 
699
        }
 
700
}
 
701
 
 
702
 
 
703
static void _vala_GdkEvent_free (GdkEvent* self) {
 
704
        g_boxed_free (gdk_event_get_type (), self);
 
705
}
 
706
 
 
707
 
 
708
static void test_inject_key (GtkWidget* w, gint keyval) {
 
709
        GdkKeymapKey* keys = NULL;
 
710
        gint keys_length1 = 0;
 
711
        gint _keys_size_ = 0;
 
712
        GdkKeymap* _tmp0_ = NULL;
 
713
        gint _tmp1_;
 
714
        GdkKeymapKey* _tmp2_ = NULL;
 
715
        gint _tmp3_ = 0;
 
716
        gboolean _tmp4_ = FALSE;
 
717
        gboolean success;
 
718
        GdkEvent* _tmp5_;
 
719
        GdkEvent* event;
 
720
        GtkWidget* _tmp6_;
 
721
        GdkWindow* _tmp7_ = NULL;
 
722
        GdkKeymapKey _tmp8_;
 
723
        guint _tmp9_;
 
724
        gint _tmp10_;
 
725
        GdkDisplay* _tmp11_ = NULL;
 
726
        GdkDeviceManager* _tmp12_ = NULL;
 
727
        GdkDevice* _tmp13_ = NULL;
 
728
        g_return_if_fail (w != NULL);
 
729
        test_process_events ();
 
730
        _tmp0_ = gdk_keymap_get_default ();
 
731
        _tmp1_ = keyval;
 
732
        _tmp4_ = gdk_keymap_get_entries_for_keyval (_tmp0_, (guint) _tmp1_, &_tmp2_, &_tmp3_);
 
733
        keys = (g_free (keys), NULL);
 
734
        keys = _tmp2_;
 
735
        keys_length1 = _tmp3_;
 
736
        _keys_size_ = keys_length1;
 
737
        success = _tmp4_;
 
738
        g_assert (success);
 
739
        _tmp5_ = gdk_event_new (GDK_KEY_PRESS);
 
740
        event = _tmp5_;
 
741
        _tmp6_ = w;
 
742
        _tmp7_ = gtk_widget_get_parent_window (_tmp6_);
 
743
        event->key.window = _tmp7_;
 
744
        _tmp8_ = keys[0];
 
745
        _tmp9_ = _tmp8_.keycode;
 
746
        event->key.hardware_keycode = (guint16) ((gint16) _tmp9_);
 
747
        _tmp10_ = keyval;
 
748
        event->key.keyval = (guint) _tmp10_;
 
749
        _tmp11_ = gdk_display_get_default ();
 
750
        _tmp12_ = gdk_display_get_device_manager (_tmp11_);
 
751
        _tmp13_ = gdk_device_manager_get_client_pointer (_tmp12_);
 
752
        gdk_event_set_device (event, _tmp13_);
 
753
        event->key.time = (guint32) GDK_CURRENT_TIME;
 
754
        gtk_main_do_event (event);
 
755
        __vala_GdkEvent_free0 (event);
 
756
        keys = (g_free (keys), NULL);
 
757
}
 
758
 
 
759
 
 
760
static void test_wait_for_focus (GtkWidget* w) {
 
761
        g_return_if_fail (w != NULL);
 
762
        while (TRUE) {
 
763
                GtkWidget* _tmp0_;
 
764
                gboolean _tmp1_ = FALSE;
 
765
                gboolean _tmp2_;
 
766
                _tmp0_ = w;
 
767
                g_object_get (_tmp0_, "has-focus", &_tmp1_, NULL);
 
768
                _tmp2_ = _tmp1_;
 
769
                if (!(!_tmp2_)) {
 
770
                        break;
 
771
                }
 
772
                test_process_events ();
 
773
                usleep ((guint) 10000);
 
774
        }
 
775
}
 
776
 
 
777
 
 
778
void test_simple_navigation (void) {
 
779
        MainWindow* _tmp0_ = NULL;
 
780
        MainWindow* mw;
 
781
        ListStack* _tmp1_;
 
782
        GreeterList* _tmp2_ = NULL;
 
783
        TestList* list;
 
784
        guint _tmp3_ = 0U;
 
785
        PromptBox* _tmp4_;
 
786
        PromptBox* _tmp5_;
 
787
        const gchar* _tmp6_;
 
788
        const gchar* _tmp7_;
 
789
        PromptBox* _tmp8_;
 
790
        PromptBox* _tmp9_;
 
791
        const gchar* _tmp10_;
 
792
        const gchar* _tmp11_;
 
793
        PromptBox* _tmp12_;
 
794
        PromptBox* _tmp13_;
 
795
        const gchar* _tmp14_;
 
796
        const gchar* _tmp15_;
 
797
        PromptBox* _tmp16_;
 
798
        PromptBox* _tmp17_;
 
799
        const gchar* _tmp18_;
 
800
        const gchar* _tmp19_;
 
801
        _tmp0_ = test_setup ();
 
802
        mw = _tmp0_;
 
803
        _tmp1_ = mw->stack;
 
804
        _tmp2_ = list_stack_top (_tmp1_);
 
805
        list = IS_TEST_LIST (_tmp2_) ? ((TestList*) _tmp2_) : NULL;
 
806
        test_scroll_to_remote_login (list);
 
807
        _tmp3_ = test_list_num_entries (list);
 
808
        g_assert (_tmp3_ == ((guint) 30));
 
809
        test_do_scroll (list, GREETER_LIST_SCROLL_TARGET_START);
 
810
        _tmp4_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
811
        _tmp5_ = _tmp4_;
 
812
        _tmp6_ = prompt_box_get_id (_tmp5_);
 
813
        _tmp7_ = _tmp6_;
 
814
        g_assert (g_strcmp0 (_tmp7_, "active") == 0);
 
815
        test_do_scroll (list, GREETER_LIST_SCROLL_TARGET_UP);
 
816
        _tmp8_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
817
        _tmp9_ = _tmp8_;
 
818
        _tmp10_ = prompt_box_get_id (_tmp9_);
 
819
        _tmp11_ = _tmp10_;
 
820
        g_assert (g_strcmp0 (_tmp11_, "active") == 0);
 
821
        test_do_scroll (list, GREETER_LIST_SCROLL_TARGET_DOWN);
 
822
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
823
        _tmp13_ = _tmp12_;
 
824
        _tmp14_ = prompt_box_get_id (_tmp13_);
 
825
        _tmp15_ = _tmp14_;
 
826
        g_assert (g_strcmp0 (_tmp15_, "auth-error") == 0);
 
827
        test_do_scroll (list, GREETER_LIST_SCROLL_TARGET_END);
 
828
        _tmp16_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
829
        _tmp17_ = _tmp16_;
 
830
        _tmp18_ = prompt_box_get_id (_tmp17_);
 
831
        _tmp19_ = _tmp18_;
 
832
        g_assert (g_strcmp0 (_tmp19_, "*remote_directory*http://crazyurl.com") == 0);
 
833
        gtk_widget_hide ((GtkWidget*) mw);
 
834
        _g_object_unref0 (list);
 
835
        _g_object_unref0 (mw);
 
836
}
 
837
 
 
838
 
 
839
void test_remote_login (void) {
 
840
        MainWindow* _tmp0_ = NULL;
 
841
        MainWindow* mw;
 
842
        MainWindow* _tmp1_;
 
843
        ListStack* _tmp2_;
 
844
        GreeterList* _tmp3_ = NULL;
 
845
        TestList* list;
 
846
        TestList* _tmp4_;
 
847
        TestList* _tmp5_;
 
848
        PromptBox* _tmp6_;
 
849
        PromptBox* _tmp7_;
 
850
        const gchar* _tmp8_;
 
851
        const gchar* _tmp9_;
 
852
        TestList* _tmp10_;
 
853
        PromptBox* _tmp11_;
 
854
        PromptBox* _tmp12_;
 
855
        gboolean _tmp13_;
 
856
        gboolean _tmp14_;
 
857
        TestList* _tmp15_;
 
858
        PromptBox* _tmp16_;
 
859
        PromptBox* _tmp17_;
 
860
        gchar** _tmp18_ = NULL;
 
861
        gchar** _tmp19_;
 
862
        gint _tmp19__length1;
 
863
        TestList* _tmp20_;
 
864
        PromptBox* _tmp21_;
 
865
        PromptBox* _tmp22_;
 
866
        gboolean _tmp23_;
 
867
        gboolean _tmp24_;
 
868
        TestList* _tmp25_;
 
869
        TestList* _tmp26_;
 
870
        TestList* _tmp27_;
 
871
        PromptBox* _tmp28_;
 
872
        PromptBox* _tmp29_;
 
873
        gboolean _tmp30_;
 
874
        gboolean _tmp31_;
 
875
        TestList* _tmp32_;
 
876
        DashEntry* _tmp33_ = NULL;
 
877
        DashEntry* email;
 
878
        TestList* _tmp34_;
 
879
        DashEntry* _tmp35_ = NULL;
 
880
        DashEntry* pwd;
 
881
        DashEntry* _tmp36_;
 
882
        DashEntry* _tmp37_;
 
883
        TestList* _tmp38_;
 
884
        PromptBox* _tmp39_;
 
885
        PromptBox* _tmp40_;
 
886
        gchar** _tmp41_ = NULL;
 
887
        gchar** _tmp42_;
 
888
        gint _tmp42__length1;
 
889
        TestList* _tmp43_;
 
890
        PromptBox* _tmp44_;
 
891
        PromptBox* _tmp45_;
 
892
        gboolean _tmp46_;
 
893
        gboolean _tmp47_;
 
894
        TestList* _tmp48_;
 
895
        PromptBox* _tmp49_;
 
896
        PromptBox* _tmp50_;
 
897
        const gchar* _tmp51_;
 
898
        const gchar* _tmp52_;
 
899
        TestList* _tmp53_;
 
900
        TestList* _tmp61_;
 
901
        DashEntry* _tmp62_ = NULL;
 
902
        TestList* _tmp63_;
 
903
        DashEntry* _tmp64_ = NULL;
 
904
        DashEntry* _tmp65_;
 
905
        DashEntry* _tmp66_;
 
906
        TestList* _tmp67_;
 
907
        PromptBox* _tmp68_;
 
908
        PromptBox* _tmp69_;
 
909
        gchar** _tmp70_ = NULL;
 
910
        gchar** _tmp71_;
 
911
        gint _tmp71__length1;
 
912
        TestList* _tmp72_;
 
913
        PromptBox* _tmp73_;
 
914
        PromptBox* _tmp74_;
 
915
        gboolean _tmp75_;
 
916
        gboolean _tmp76_;
 
917
        TestList* _tmp77_;
 
918
        PromptBox* _tmp78_;
 
919
        PromptBox* _tmp79_;
 
920
        const gchar* _tmp80_;
 
921
        const gchar* _tmp81_;
 
922
        MainWindow* _tmp82_;
 
923
        _tmp0_ = test_setup ();
 
924
        mw = _tmp0_;
 
925
        _tmp1_ = mw;
 
926
        _tmp2_ = _tmp1_->stack;
 
927
        _tmp3_ = list_stack_top (_tmp2_);
 
928
        list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
929
        _tmp4_ = list;
 
930
        test_scroll_to_remote_login (_tmp4_);
 
931
        _tmp5_ = list;
 
932
        _tmp6_ = greeter_list_get_selected_entry ((GreeterList*) _tmp5_);
 
933
        _tmp7_ = _tmp6_;
 
934
        _tmp8_ = prompt_box_get_id (_tmp7_);
 
935
        _tmp9_ = _tmp8_;
 
936
        g_assert (g_strcmp0 (_tmp9_, "*remote_directory*http://crazyurl.com") == 0);
 
937
        _tmp10_ = list;
 
938
        _tmp11_ = greeter_list_get_selected_entry ((GreeterList*) _tmp10_);
 
939
        _tmp12_ = _tmp11_;
 
940
        _tmp13_ = prompt_box_get_has_errors (_tmp12_);
 
941
        _tmp14_ = _tmp13_;
 
942
        g_assert (!_tmp14_);
 
943
        _tmp15_ = list;
 
944
        _tmp16_ = greeter_list_get_selected_entry ((GreeterList*) _tmp15_);
 
945
        _tmp17_ = _tmp16_;
 
946
        _tmp18_ = g_new0 (gchar*, 0 + 1);
 
947
        _tmp19_ = _tmp18_;
 
948
        _tmp19__length1 = 0;
 
949
        g_signal_emit_by_name (_tmp17_, "respond", _tmp19_, 0);
 
950
        _tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) g_free), NULL);
 
951
        _tmp20_ = list;
 
952
        _tmp21_ = greeter_list_get_selected_entry ((GreeterList*) _tmp20_);
 
953
        _tmp22_ = _tmp21_;
 
954
        _tmp23_ = prompt_box_get_has_errors (_tmp22_);
 
955
        _tmp24_ = _tmp23_;
 
956
        g_assert (_tmp24_);
 
957
        _tmp25_ = list;
 
958
        test_do_scroll (_tmp25_, GREETER_LIST_SCROLL_TARGET_START);
 
959
        _tmp26_ = list;
 
960
        test_do_scroll (_tmp26_, GREETER_LIST_SCROLL_TARGET_END);
 
961
        _tmp27_ = list;
 
962
        _tmp28_ = greeter_list_get_selected_entry ((GreeterList*) _tmp27_);
 
963
        _tmp29_ = _tmp28_;
 
964
        _tmp30_ = prompt_box_get_has_errors (_tmp29_);
 
965
        _tmp31_ = _tmp30_;
 
966
        g_assert (!_tmp31_);
 
967
        _tmp32_ = list;
 
968
        _tmp33_ = test_remote_directory_entry_email_field (_tmp32_);
 
969
        email = _tmp33_;
 
970
        _tmp34_ = list;
 
971
        _tmp35_ = test_remote_directory_entry_password_field (_tmp34_);
 
972
        pwd = _tmp35_;
 
973
        _tmp36_ = email;
 
974
        gtk_entry_set_text ((GtkEntry*) _tmp36_, "a@canonical.com");
 
975
        _tmp37_ = pwd;
 
976
        gtk_entry_set_text ((GtkEntry*) _tmp37_, "password");
 
977
        _tmp38_ = list;
 
978
        _tmp39_ = greeter_list_get_selected_entry ((GreeterList*) _tmp38_);
 
979
        _tmp40_ = _tmp39_;
 
980
        _tmp41_ = g_new0 (gchar*, 0 + 1);
 
981
        _tmp42_ = _tmp41_;
 
982
        _tmp42__length1 = 0;
 
983
        g_signal_emit_by_name (_tmp40_, "respond", _tmp42_, 0);
 
984
        _tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_free), NULL);
 
985
        _tmp43_ = list;
 
986
        _tmp44_ = greeter_list_get_selected_entry ((GreeterList*) _tmp43_);
 
987
        _tmp45_ = _tmp44_;
 
988
        _tmp46_ = prompt_box_get_has_errors (_tmp45_);
 
989
        _tmp47_ = _tmp46_;
 
990
        g_assert (!_tmp47_);
 
991
        _tmp48_ = list;
 
992
        _tmp49_ = greeter_list_get_selected_entry ((GreeterList*) _tmp48_);
 
993
        _tmp50_ = _tmp49_;
 
994
        _tmp51_ = prompt_box_get_id (_tmp50_);
 
995
        _tmp52_ = _tmp51_;
 
996
        g_assert (g_strcmp0 (_tmp52_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
997
        _tmp53_ = list;
 
998
        test_wait_for_scrolling_end (_tmp53_);
 
999
        while (TRUE) {
 
1000
                TestList* _tmp54_;
 
1001
                PromptBox* _tmp55_;
 
1002
                PromptBox* _tmp56_;
 
1003
                const gchar* _tmp57_;
 
1004
                const gchar* _tmp58_;
 
1005
                gboolean _tmp59_ = FALSE;
 
1006
                TestList* _tmp60_;
 
1007
                _tmp54_ = list;
 
1008
                _tmp55_ = greeter_list_get_selected_entry ((GreeterList*) _tmp54_);
 
1009
                _tmp56_ = _tmp55_;
 
1010
                _tmp57_ = prompt_box_get_id (_tmp56_);
 
1011
                _tmp58_ = _tmp57_;
 
1012
                _tmp59_ = g_str_has_prefix (_tmp58_, "*remote_directory*http://crazyurl.com");
 
1013
                if (!(!_tmp59_)) {
 
1014
                        break;
 
1015
                }
 
1016
                _tmp60_ = list;
 
1017
                test_do_scroll (_tmp60_, GREETER_LIST_SCROLL_TARGET_UP);
 
1018
        }
 
1019
        _tmp61_ = list;
 
1020
        _tmp62_ = test_remote_directory_entry_email_field (_tmp61_);
 
1021
        _g_object_unref0 (email);
 
1022
        email = _tmp62_;
 
1023
        _tmp63_ = list;
 
1024
        _tmp64_ = test_remote_directory_entry_password_field (_tmp63_);
 
1025
        _g_object_unref0 (pwd);
 
1026
        pwd = _tmp64_;
 
1027
        _tmp65_ = email;
 
1028
        gtk_entry_set_text ((GtkEntry*) _tmp65_, "a @ foobar");
 
1029
        _tmp66_ = pwd;
 
1030
        gtk_entry_set_text ((GtkEntry*) _tmp66_, "password");
 
1031
        _tmp67_ = list;
 
1032
        _tmp68_ = greeter_list_get_selected_entry ((GreeterList*) _tmp67_);
 
1033
        _tmp69_ = _tmp68_;
 
1034
        _tmp70_ = g_new0 (gchar*, 0 + 1);
 
1035
        _tmp71_ = _tmp70_;
 
1036
        _tmp71__length1 = 0;
 
1037
        g_signal_emit_by_name (_tmp69_, "respond", _tmp71_, 0);
 
1038
        _tmp71_ = (_vala_array_free (_tmp71_, _tmp71__length1, (GDestroyNotify) g_free), NULL);
 
1039
        _tmp72_ = list;
 
1040
        _tmp73_ = greeter_list_get_selected_entry ((GreeterList*) _tmp72_);
 
1041
        _tmp74_ = _tmp73_;
 
1042
        _tmp75_ = prompt_box_get_has_errors (_tmp74_);
 
1043
        _tmp76_ = _tmp75_;
 
1044
        g_assert (_tmp76_);
 
1045
        _tmp77_ = list;
 
1046
        _tmp78_ = greeter_list_get_selected_entry ((GreeterList*) _tmp77_);
 
1047
        _tmp79_ = _tmp78_;
 
1048
        _tmp80_ = prompt_box_get_id (_tmp79_);
 
1049
        _tmp81_ = _tmp80_;
 
1050
        g_assert (g_strcmp0 (_tmp81_, "*remote_directory*http://crazyurl.com") == 0);
 
1051
        _tmp82_ = mw;
 
1052
        gtk_widget_hide ((GtkWidget*) _tmp82_);
 
1053
        _g_object_unref0 (pwd);
 
1054
        _g_object_unref0 (email);
 
1055
        _g_object_unref0 (list);
 
1056
        _g_object_unref0 (mw);
 
1057
}
 
1058
 
 
1059
 
 
1060
static Block1Data* block1_data_ref (Block1Data* _data1_) {
 
1061
        g_atomic_int_inc (&_data1_->_ref_count_);
 
1062
        return _data1_;
 
1063
}
 
1064
 
 
1065
 
 
1066
static void block1_data_unref (void * _userdata_) {
 
1067
        Block1Data* _data1_;
 
1068
        _data1_ = (Block1Data*) _userdata_;
 
1069
        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
 
1070
                _g_object_unref0 (_data1_->list);
 
1071
                g_slice_free (Block1Data, _data1_);
 
1072
        }
 
1073
}
 
1074
 
 
1075
 
 
1076
static gboolean __lambda34_ (Block1Data* _data1_) {
 
1077
        gboolean result = FALSE;
 
1078
        TestList* _tmp0_;
 
1079
        TestList* _tmp1_;
 
1080
        PromptBox* _tmp2_;
 
1081
        PromptBox* _tmp3_;
 
1082
        const gchar* _tmp4_;
 
1083
        const gchar* _tmp5_;
 
1084
        _tmp0_ = _data1_->list;
 
1085
        test_wait_for_scrolling_end (_tmp0_);
 
1086
        _tmp1_ = _data1_->list;
 
1087
        _tmp2_ = greeter_list_get_selected_entry ((GreeterList*) _tmp1_);
 
1088
        _tmp3_ = _tmp2_;
 
1089
        _tmp4_ = prompt_box_get_id (_tmp3_);
 
1090
        _tmp5_ = _tmp4_;
 
1091
        g_assert (g_strcmp0 (_tmp5_, "*remote_directory*http://internalcompayserver.com") == 0);
 
1092
        _data1_->done = TRUE;
 
1093
        result = FALSE;
 
1094
        return result;
 
1095
}
 
1096
 
 
1097
 
 
1098
static gboolean ___lambda34__gsource_func (gpointer self) {
 
1099
        gboolean result;
 
1100
        result = __lambda34_ (self);
 
1101
        return result;
 
1102
}
 
1103
 
 
1104
 
 
1105
void test_remote_login_servers_updated_signal (void) {
 
1106
        Block1Data* _data1_;
 
1107
        MainWindow* _tmp0_ = NULL;
 
1108
        MainWindow* mw;
 
1109
        MainWindow* _tmp1_;
 
1110
        ListStack* _tmp2_;
 
1111
        GreeterList* _tmp3_ = NULL;
 
1112
        TestList* _tmp4_;
 
1113
        TestList* _tmp5_;
 
1114
        DashEntry* _tmp6_ = NULL;
 
1115
        DashEntry* email;
 
1116
        TestList* _tmp7_;
 
1117
        DashEntry* _tmp8_ = NULL;
 
1118
        DashEntry* pwd;
 
1119
        DashEntry* _tmp9_;
 
1120
        DashEntry* _tmp10_;
 
1121
        TestList* _tmp11_;
 
1122
        PromptBox* _tmp12_;
 
1123
        PromptBox* _tmp13_;
 
1124
        gchar** _tmp14_ = NULL;
 
1125
        gchar** _tmp15_;
 
1126
        gint _tmp15__length1;
 
1127
        TestList* _tmp16_;
 
1128
        PromptBox* _tmp17_;
 
1129
        PromptBox* _tmp18_;
 
1130
        gboolean _tmp19_;
 
1131
        gboolean _tmp20_;
 
1132
        TestList* _tmp21_;
 
1133
        PromptBox* _tmp22_;
 
1134
        PromptBox* _tmp23_;
 
1135
        const gchar* _tmp24_;
 
1136
        const gchar* _tmp25_;
 
1137
        MainWindow* _tmp27_;
 
1138
        _data1_ = g_slice_new0 (Block1Data);
 
1139
        _data1_->_ref_count_ = 1;
 
1140
        _tmp0_ = test_setup ();
 
1141
        mw = _tmp0_;
 
1142
        _tmp1_ = mw;
 
1143
        _tmp2_ = _tmp1_->stack;
 
1144
        _tmp3_ = list_stack_top (_tmp2_);
 
1145
        _data1_->list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
1146
        _tmp4_ = _data1_->list;
 
1147
        test_scroll_to_remote_login (_tmp4_);
 
1148
        _tmp5_ = _data1_->list;
 
1149
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
1150
        email = _tmp6_;
 
1151
        _tmp7_ = _data1_->list;
 
1152
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
1153
        pwd = _tmp8_;
 
1154
        _tmp9_ = email;
 
1155
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
1156
        _tmp10_ = pwd;
 
1157
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay1");
 
1158
        _tmp11_ = _data1_->list;
 
1159
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
1160
        _tmp13_ = _tmp12_;
 
1161
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
1162
        _tmp15_ = _tmp14_;
 
1163
        _tmp15__length1 = 0;
 
1164
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
1165
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
1166
        _tmp16_ = _data1_->list;
 
1167
        _tmp17_ = greeter_list_get_selected_entry ((GreeterList*) _tmp16_);
 
1168
        _tmp18_ = _tmp17_;
 
1169
        _tmp19_ = prompt_box_get_has_errors (_tmp18_);
 
1170
        _tmp20_ = _tmp19_;
 
1171
        g_assert (!_tmp20_);
 
1172
        _tmp21_ = _data1_->list;
 
1173
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
 
1174
        _tmp23_ = _tmp22_;
 
1175
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
1176
        _tmp25_ = _tmp24_;
 
1177
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
1178
        _data1_->done = FALSE;
 
1179
        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda34__gsource_func, block1_data_ref (_data1_), block1_data_unref);
 
1180
        while (TRUE) {
 
1181
                gboolean _tmp26_;
 
1182
                _tmp26_ = _data1_->done;
 
1183
                if (!(!_tmp26_)) {
 
1184
                        break;
 
1185
                }
 
1186
                test_process_events ();
 
1187
                usleep ((guint) 10000);
 
1188
        }
 
1189
        _tmp27_ = mw;
 
1190
        gtk_widget_hide ((GtkWidget*) _tmp27_);
 
1191
        _g_object_unref0 (pwd);
 
1192
        _g_object_unref0 (email);
 
1193
        _g_object_unref0 (mw);
 
1194
        block1_data_unref (_data1_);
 
1195
        _data1_ = NULL;
 
1196
}
 
1197
 
 
1198
 
 
1199
static Block2Data* block2_data_ref (Block2Data* _data2_) {
 
1200
        g_atomic_int_inc (&_data2_->_ref_count_);
 
1201
        return _data2_;
 
1202
}
 
1203
 
 
1204
 
 
1205
static void block2_data_unref (void * _userdata_) {
 
1206
        Block2Data* _data2_;
 
1207
        _data2_ = (Block2Data*) _userdata_;
 
1208
        if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
 
1209
                _g_free0 (_data2_->nonRemoteEntry);
 
1210
                _g_object_unref0 (_data2_->list);
 
1211
                g_slice_free (Block2Data, _data2_);
 
1212
        }
 
1213
}
 
1214
 
 
1215
 
 
1216
static gboolean __lambda35_ (Block2Data* _data2_) {
 
1217
        gboolean result = FALSE;
 
1218
        TestList* _tmp0_;
 
1219
        PromptBox* _tmp1_;
 
1220
        PromptBox* _tmp2_;
 
1221
        const gchar* _tmp3_;
 
1222
        const gchar* _tmp4_;
 
1223
        const gchar* _tmp5_;
 
1224
        TestList* _tmp6_;
 
1225
        TestList* _tmp7_;
 
1226
        PromptBox* _tmp8_;
 
1227
        PromptBox* _tmp9_;
 
1228
        const gchar* _tmp10_;
 
1229
        const gchar* _tmp11_;
 
1230
        _tmp0_ = _data2_->list;
 
1231
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
1232
        _tmp2_ = _tmp1_;
 
1233
        _tmp3_ = prompt_box_get_id (_tmp2_);
 
1234
        _tmp4_ = _tmp3_;
 
1235
        _tmp5_ = _data2_->nonRemoteEntry;
 
1236
        g_assert (g_strcmp0 (_tmp4_, _tmp5_) == 0);
 
1237
        _tmp6_ = _data2_->list;
 
1238
        test_do_scroll (_tmp6_, GREETER_LIST_SCROLL_TARGET_DOWN);
 
1239
        _tmp7_ = _data2_->list;
 
1240
        _tmp8_ = greeter_list_get_selected_entry ((GreeterList*) _tmp7_);
 
1241
        _tmp9_ = _tmp8_;
 
1242
        _tmp10_ = prompt_box_get_id (_tmp9_);
 
1243
        _tmp11_ = _tmp10_;
 
1244
        g_assert (g_strcmp0 (_tmp11_, "*remote_directory*http://internalcompayserver.com") == 0);
 
1245
        _data2_->done = TRUE;
 
1246
        result = FALSE;
 
1247
        return result;
 
1248
}
 
1249
 
 
1250
 
 
1251
static gboolean ___lambda35__gsource_func (gpointer self) {
 
1252
        gboolean result;
 
1253
        result = __lambda35_ (self);
 
1254
        return result;
 
1255
}
 
1256
 
 
1257
 
 
1258
void test_remote_login_servers_updated_signal_focus_not_in_remote_server (void) {
 
1259
        Block2Data* _data2_;
 
1260
        MainWindow* _tmp0_ = NULL;
 
1261
        MainWindow* mw;
 
1262
        MainWindow* _tmp1_;
 
1263
        ListStack* _tmp2_;
 
1264
        GreeterList* _tmp3_ = NULL;
 
1265
        TestList* _tmp4_;
 
1266
        TestList* _tmp5_;
 
1267
        DashEntry* _tmp6_ = NULL;
 
1268
        DashEntry* email;
 
1269
        TestList* _tmp7_;
 
1270
        DashEntry* _tmp8_ = NULL;
 
1271
        DashEntry* pwd;
 
1272
        DashEntry* _tmp9_;
 
1273
        DashEntry* _tmp10_;
 
1274
        TestList* _tmp11_;
 
1275
        PromptBox* _tmp12_;
 
1276
        PromptBox* _tmp13_;
 
1277
        gchar** _tmp14_ = NULL;
 
1278
        gchar** _tmp15_;
 
1279
        gint _tmp15__length1;
 
1280
        TestList* _tmp16_;
 
1281
        PromptBox* _tmp17_;
 
1282
        PromptBox* _tmp18_;
 
1283
        gboolean _tmp19_;
 
1284
        gboolean _tmp20_;
 
1285
        TestList* _tmp21_;
 
1286
        PromptBox* _tmp22_;
 
1287
        PromptBox* _tmp23_;
 
1288
        const gchar* _tmp24_;
 
1289
        const gchar* _tmp25_;
 
1290
        TestList* _tmp26_;
 
1291
        TestList* _tmp34_;
 
1292
        PromptBox* _tmp35_;
 
1293
        PromptBox* _tmp36_;
 
1294
        const gchar* _tmp37_;
 
1295
        const gchar* _tmp38_;
 
1296
        gchar* _tmp39_;
 
1297
        MainWindow* _tmp41_;
 
1298
        _data2_ = g_slice_new0 (Block2Data);
 
1299
        _data2_->_ref_count_ = 1;
 
1300
        _tmp0_ = test_setup ();
 
1301
        mw = _tmp0_;
 
1302
        _tmp1_ = mw;
 
1303
        _tmp2_ = _tmp1_->stack;
 
1304
        _tmp3_ = list_stack_top (_tmp2_);
 
1305
        _data2_->list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
1306
        _tmp4_ = _data2_->list;
 
1307
        test_scroll_to_remote_login (_tmp4_);
 
1308
        _tmp5_ = _data2_->list;
 
1309
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
1310
        email = _tmp6_;
 
1311
        _tmp7_ = _data2_->list;
 
1312
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
1313
        pwd = _tmp8_;
 
1314
        _tmp9_ = email;
 
1315
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
1316
        _tmp10_ = pwd;
 
1317
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay1");
 
1318
        _tmp11_ = _data2_->list;
 
1319
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
1320
        _tmp13_ = _tmp12_;
 
1321
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
1322
        _tmp15_ = _tmp14_;
 
1323
        _tmp15__length1 = 0;
 
1324
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
1325
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
1326
        _tmp16_ = _data2_->list;
 
1327
        _tmp17_ = greeter_list_get_selected_entry ((GreeterList*) _tmp16_);
 
1328
        _tmp18_ = _tmp17_;
 
1329
        _tmp19_ = prompt_box_get_has_errors (_tmp18_);
 
1330
        _tmp20_ = _tmp19_;
 
1331
        g_assert (!_tmp20_);
 
1332
        _tmp21_ = _data2_->list;
 
1333
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
 
1334
        _tmp23_ = _tmp22_;
 
1335
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
1336
        _tmp25_ = _tmp24_;
 
1337
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
1338
        _tmp26_ = _data2_->list;
 
1339
        test_wait_for_scrolling_end (_tmp26_);
 
1340
        while (TRUE) {
 
1341
                TestList* _tmp27_;
 
1342
                PromptBox* _tmp28_;
 
1343
                PromptBox* _tmp29_;
 
1344
                const gchar* _tmp30_;
 
1345
                const gchar* _tmp31_;
 
1346
                gboolean _tmp32_ = FALSE;
 
1347
                TestList* _tmp33_;
 
1348
                _tmp27_ = _data2_->list;
 
1349
                _tmp28_ = greeter_list_get_selected_entry ((GreeterList*) _tmp27_);
 
1350
                _tmp29_ = _tmp28_;
 
1351
                _tmp30_ = prompt_box_get_id (_tmp29_);
 
1352
                _tmp31_ = _tmp30_;
 
1353
                _tmp32_ = g_str_has_prefix (_tmp31_, "*remote_");
 
1354
                if (!_tmp32_) {
 
1355
                        break;
 
1356
                }
 
1357
                _tmp33_ = _data2_->list;
 
1358
                test_do_scroll (_tmp33_, GREETER_LIST_SCROLL_TARGET_UP);
 
1359
        }
 
1360
        _tmp34_ = _data2_->list;
 
1361
        _tmp35_ = greeter_list_get_selected_entry ((GreeterList*) _tmp34_);
 
1362
        _tmp36_ = _tmp35_;
 
1363
        _tmp37_ = prompt_box_get_id (_tmp36_);
 
1364
        _tmp38_ = _tmp37_;
 
1365
        _tmp39_ = g_strdup (_tmp38_);
 
1366
        _data2_->nonRemoteEntry = _tmp39_;
 
1367
        _data2_->done = FALSE;
 
1368
        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda35__gsource_func, block2_data_ref (_data2_), block2_data_unref);
 
1369
        while (TRUE) {
 
1370
                gboolean _tmp40_;
 
1371
                _tmp40_ = _data2_->done;
 
1372
                if (!(!_tmp40_)) {
 
1373
                        break;
 
1374
                }
 
1375
                test_process_events ();
 
1376
                usleep ((guint) 10000);
 
1377
        }
 
1378
        _tmp41_ = mw;
 
1379
        gtk_widget_hide ((GtkWidget*) _tmp41_);
 
1380
        _g_object_unref0 (pwd);
 
1381
        _g_object_unref0 (email);
 
1382
        _g_object_unref0 (mw);
 
1383
        block2_data_unref (_data2_);
 
1384
        _data2_ = NULL;
 
1385
}
 
1386
 
 
1387
 
 
1388
static Block3Data* block3_data_ref (Block3Data* _data3_) {
 
1389
        g_atomic_int_inc (&_data3_->_ref_count_);
 
1390
        return _data3_;
 
1391
}
 
1392
 
 
1393
 
 
1394
static void block3_data_unref (void * _userdata_) {
 
1395
        Block3Data* _data3_;
 
1396
        _data3_ = (Block3Data*) _userdata_;
 
1397
        if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
 
1398
                _g_object_unref0 (_data3_->list);
 
1399
                g_slice_free (Block3Data, _data3_);
 
1400
        }
 
1401
}
 
1402
 
 
1403
 
 
1404
static gboolean __lambda36_ (Block3Data* _data3_) {
 
1405
        gboolean result = FALSE;
 
1406
        TestList* _tmp0_;
 
1407
        TestList* _tmp1_;
 
1408
        PromptBox* _tmp2_;
 
1409
        PromptBox* _tmp3_;
 
1410
        const gchar* _tmp4_;
 
1411
        const gchar* _tmp5_;
 
1412
        _tmp0_ = _data3_->list;
 
1413
        test_wait_for_scrolling_end (_tmp0_);
 
1414
        _tmp1_ = _data3_->list;
 
1415
        _tmp2_ = greeter_list_get_selected_entry ((GreeterList*) _tmp1_);
 
1416
        _tmp3_ = _tmp2_;
 
1417
        _tmp4_ = prompt_box_get_id (_tmp3_);
 
1418
        _tmp5_ = _tmp4_;
 
1419
        g_assert (g_strcmp0 (_tmp5_, "*remote_login*http://megacoolrdpserver.com") == 0);
 
1420
        _data3_->done = TRUE;
 
1421
        result = FALSE;
 
1422
        return result;
 
1423
}
 
1424
 
 
1425
 
 
1426
static gboolean ___lambda36__gsource_func (gpointer self) {
 
1427
        gboolean result;
 
1428
        result = __lambda36_ (self);
 
1429
        return result;
 
1430
}
 
1431
 
 
1432
 
 
1433
void test_remote_login_login_servers_updated_signal (void) {
 
1434
        Block3Data* _data3_;
 
1435
        MainWindow* _tmp0_ = NULL;
 
1436
        MainWindow* mw;
 
1437
        MainWindow* _tmp1_;
 
1438
        ListStack* _tmp2_;
 
1439
        GreeterList* _tmp3_ = NULL;
 
1440
        TestList* _tmp4_;
 
1441
        TestList* _tmp5_;
 
1442
        DashEntry* _tmp6_ = NULL;
 
1443
        DashEntry* email;
 
1444
        TestList* _tmp7_;
 
1445
        DashEntry* _tmp8_ = NULL;
 
1446
        DashEntry* pwd;
 
1447
        DashEntry* _tmp9_;
 
1448
        DashEntry* _tmp10_;
 
1449
        TestList* _tmp11_;
 
1450
        PromptBox* _tmp12_;
 
1451
        PromptBox* _tmp13_;
 
1452
        gchar** _tmp14_ = NULL;
 
1453
        gchar** _tmp15_;
 
1454
        gint _tmp15__length1;
 
1455
        TestList* _tmp16_;
 
1456
        PromptBox* _tmp17_;
 
1457
        PromptBox* _tmp18_;
 
1458
        gboolean _tmp19_;
 
1459
        gboolean _tmp20_;
 
1460
        TestList* _tmp21_;
 
1461
        PromptBox* _tmp22_;
 
1462
        PromptBox* _tmp23_;
 
1463
        const gchar* _tmp24_;
 
1464
        const gchar* _tmp25_;
 
1465
        MainWindow* _tmp27_;
 
1466
        _data3_ = g_slice_new0 (Block3Data);
 
1467
        _data3_->_ref_count_ = 1;
 
1468
        _tmp0_ = test_setup ();
 
1469
        mw = _tmp0_;
 
1470
        _tmp1_ = mw;
 
1471
        _tmp2_ = _tmp1_->stack;
 
1472
        _tmp3_ = list_stack_top (_tmp2_);
 
1473
        _data3_->list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
1474
        _tmp4_ = _data3_->list;
 
1475
        test_scroll_to_remote_login (_tmp4_);
 
1476
        _tmp5_ = _data3_->list;
 
1477
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
1478
        email = _tmp6_;
 
1479
        _tmp7_ = _data3_->list;
 
1480
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
1481
        pwd = _tmp8_;
 
1482
        _tmp9_ = email;
 
1483
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
1484
        _tmp10_ = pwd;
 
1485
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay2");
 
1486
        _tmp11_ = _data3_->list;
 
1487
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
1488
        _tmp13_ = _tmp12_;
 
1489
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
1490
        _tmp15_ = _tmp14_;
 
1491
        _tmp15__length1 = 0;
 
1492
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
1493
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
1494
        _tmp16_ = _data3_->list;
 
1495
        _tmp17_ = greeter_list_get_selected_entry ((GreeterList*) _tmp16_);
 
1496
        _tmp18_ = _tmp17_;
 
1497
        _tmp19_ = prompt_box_get_has_errors (_tmp18_);
 
1498
        _tmp20_ = _tmp19_;
 
1499
        g_assert (!_tmp20_);
 
1500
        _tmp21_ = _data3_->list;
 
1501
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
 
1502
        _tmp23_ = _tmp22_;
 
1503
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
1504
        _tmp25_ = _tmp24_;
 
1505
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
1506
        _data3_->done = FALSE;
 
1507
        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda36__gsource_func, block3_data_ref (_data3_), block3_data_unref);
 
1508
        while (TRUE) {
 
1509
                gboolean _tmp26_;
 
1510
                _tmp26_ = _data3_->done;
 
1511
                if (!(!_tmp26_)) {
 
1512
                        break;
 
1513
                }
 
1514
                test_process_events ();
 
1515
                usleep ((guint) 10000);
 
1516
        }
 
1517
        _tmp27_ = mw;
 
1518
        gtk_widget_hide ((GtkWidget*) _tmp27_);
 
1519
        _g_object_unref0 (pwd);
 
1520
        _g_object_unref0 (email);
 
1521
        _g_object_unref0 (mw);
 
1522
        block3_data_unref (_data3_);
 
1523
        _data3_ = NULL;
 
1524
}
 
1525
 
 
1526
 
 
1527
static Block4Data* block4_data_ref (Block4Data* _data4_) {
 
1528
        g_atomic_int_inc (&_data4_->_ref_count_);
 
1529
        return _data4_;
 
1530
}
 
1531
 
 
1532
 
 
1533
static void block4_data_unref (void * _userdata_) {
 
1534
        Block4Data* _data4_;
 
1535
        _data4_ = (Block4Data*) _userdata_;
 
1536
        if (g_atomic_int_dec_and_test (&_data4_->_ref_count_)) {
 
1537
                _g_object_unref0 (_data4_->list);
 
1538
                g_slice_free (Block4Data, _data4_);
 
1539
        }
 
1540
}
 
1541
 
 
1542
 
 
1543
static gboolean __lambda37_ (Block4Data* _data4_) {
 
1544
        gboolean result = FALSE;
 
1545
        TestList* _tmp0_;
 
1546
        TestList* _tmp1_;
 
1547
        PromptBox* _tmp2_;
 
1548
        PromptBox* _tmp3_;
 
1549
        const gchar* _tmp4_;
 
1550
        const gchar* _tmp5_;
 
1551
        _tmp0_ = _data4_->list;
 
1552
        test_wait_for_scrolling_end (_tmp0_);
 
1553
        _tmp1_ = _data4_->list;
 
1554
        _tmp2_ = greeter_list_get_selected_entry ((GreeterList*) _tmp1_);
 
1555
        _tmp3_ = _tmp2_;
 
1556
        _tmp4_ = prompt_box_get_id (_tmp3_);
 
1557
        _tmp5_ = _tmp4_;
 
1558
        g_assert (g_strcmp0 (_tmp5_, "*remote_login*http://coolrdpserver.com") == 0);
 
1559
        _data4_->done = TRUE;
 
1560
        result = FALSE;
 
1561
        return result;
 
1562
}
 
1563
 
 
1564
 
 
1565
static gboolean ___lambda37__gsource_func (gpointer self) {
 
1566
        gboolean result;
 
1567
        result = __lambda37_ (self);
 
1568
        return result;
 
1569
}
 
1570
 
 
1571
 
 
1572
void test_remote_login_login_servers_updated_signal_focus_not_in_removed_server (void) {
 
1573
        Block4Data* _data4_;
 
1574
        MainWindow* _tmp0_ = NULL;
 
1575
        MainWindow* mw;
 
1576
        MainWindow* _tmp1_;
 
1577
        ListStack* _tmp2_;
 
1578
        GreeterList* _tmp3_ = NULL;
 
1579
        TestList* _tmp4_;
 
1580
        TestList* _tmp5_;
 
1581
        DashEntry* _tmp6_ = NULL;
 
1582
        DashEntry* email;
 
1583
        TestList* _tmp7_;
 
1584
        DashEntry* _tmp8_ = NULL;
 
1585
        DashEntry* pwd;
 
1586
        DashEntry* _tmp9_;
 
1587
        DashEntry* _tmp10_;
 
1588
        TestList* _tmp11_;
 
1589
        PromptBox* _tmp12_;
 
1590
        PromptBox* _tmp13_;
 
1591
        gchar** _tmp14_ = NULL;
 
1592
        gchar** _tmp15_;
 
1593
        gint _tmp15__length1;
 
1594
        TestList* _tmp16_;
 
1595
        PromptBox* _tmp17_;
 
1596
        PromptBox* _tmp18_;
 
1597
        gboolean _tmp19_;
 
1598
        gboolean _tmp20_;
 
1599
        TestList* _tmp21_;
 
1600
        PromptBox* _tmp22_;
 
1601
        PromptBox* _tmp23_;
 
1602
        const gchar* _tmp24_;
 
1603
        const gchar* _tmp25_;
 
1604
        MainWindow* _tmp33_;
 
1605
        _data4_ = g_slice_new0 (Block4Data);
 
1606
        _data4_->_ref_count_ = 1;
 
1607
        _tmp0_ = test_setup ();
 
1608
        mw = _tmp0_;
 
1609
        _tmp1_ = mw;
 
1610
        _tmp2_ = _tmp1_->stack;
 
1611
        _tmp3_ = list_stack_top (_tmp2_);
 
1612
        _data4_->list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
1613
        _tmp4_ = _data4_->list;
 
1614
        test_scroll_to_remote_login (_tmp4_);
 
1615
        _tmp5_ = _data4_->list;
 
1616
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
1617
        email = _tmp6_;
 
1618
        _tmp7_ = _data4_->list;
 
1619
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
1620
        pwd = _tmp8_;
 
1621
        _tmp9_ = email;
 
1622
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
1623
        _tmp10_ = pwd;
 
1624
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay2");
 
1625
        _tmp11_ = _data4_->list;
 
1626
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
1627
        _tmp13_ = _tmp12_;
 
1628
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
1629
        _tmp15_ = _tmp14_;
 
1630
        _tmp15__length1 = 0;
 
1631
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
1632
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
1633
        _tmp16_ = _data4_->list;
 
1634
        _tmp17_ = greeter_list_get_selected_entry ((GreeterList*) _tmp16_);
 
1635
        _tmp18_ = _tmp17_;
 
1636
        _tmp19_ = prompt_box_get_has_errors (_tmp18_);
 
1637
        _tmp20_ = _tmp19_;
 
1638
        g_assert (!_tmp20_);
 
1639
        _tmp21_ = _data4_->list;
 
1640
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
 
1641
        _tmp23_ = _tmp22_;
 
1642
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
1643
        _tmp25_ = _tmp24_;
 
1644
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
1645
        while (TRUE) {
 
1646
                TestList* _tmp26_;
 
1647
                PromptBox* _tmp27_;
 
1648
                PromptBox* _tmp28_;
 
1649
                const gchar* _tmp29_;
 
1650
                const gchar* _tmp30_;
 
1651
                TestList* _tmp31_;
 
1652
                _tmp26_ = _data4_->list;
 
1653
                _tmp27_ = greeter_list_get_selected_entry ((GreeterList*) _tmp26_);
 
1654
                _tmp28_ = _tmp27_;
 
1655
                _tmp29_ = prompt_box_get_id (_tmp28_);
 
1656
                _tmp30_ = _tmp29_;
 
1657
                if (!(g_strcmp0 (_tmp30_, "*remote_login*http://coolrdpserver.com") != 0)) {
 
1658
                        break;
 
1659
                }
 
1660
                _tmp31_ = _data4_->list;
 
1661
                test_do_scroll (_tmp31_, GREETER_LIST_SCROLL_TARGET_UP);
 
1662
        }
 
1663
        _data4_->done = FALSE;
 
1664
        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda37__gsource_func, block4_data_ref (_data4_), block4_data_unref);
 
1665
        while (TRUE) {
 
1666
                gboolean _tmp32_;
 
1667
                _tmp32_ = _data4_->done;
 
1668
                if (!(!_tmp32_)) {
 
1669
                        break;
 
1670
                }
 
1671
                test_process_events ();
 
1672
                usleep ((guint) 10000);
 
1673
        }
 
1674
        _tmp33_ = mw;
 
1675
        gtk_widget_hide ((GtkWidget*) _tmp33_);
 
1676
        _g_object_unref0 (pwd);
 
1677
        _g_object_unref0 (email);
 
1678
        _g_object_unref0 (mw);
 
1679
        block4_data_unref (_data4_);
 
1680
        _data4_ = NULL;
 
1681
}
 
1682
 
 
1683
 
 
1684
static Block5Data* block5_data_ref (Block5Data* _data5_) {
 
1685
        g_atomic_int_inc (&_data5_->_ref_count_);
 
1686
        return _data5_;
 
1687
}
 
1688
 
 
1689
 
 
1690
static void block5_data_unref (void * _userdata_) {
 
1691
        Block5Data* _data5_;
 
1692
        _data5_ = (Block5Data*) _userdata_;
 
1693
        if (g_atomic_int_dec_and_test (&_data5_->_ref_count_)) {
 
1694
                _g_object_unref0 (_data5_->list);
 
1695
                g_slice_free (Block5Data, _data5_);
 
1696
        }
 
1697
}
 
1698
 
 
1699
 
 
1700
static gboolean __lambda38_ (Block5Data* _data5_) {
 
1701
        gboolean result = FALSE;
 
1702
        TestList* _tmp0_;
 
1703
        TestList* _tmp1_;
 
1704
        PromptBox* _tmp2_;
 
1705
        PromptBox* _tmp3_;
 
1706
        const gchar* _tmp4_;
 
1707
        const gchar* _tmp5_;
 
1708
        TestList* _tmp6_;
 
1709
        TestList* _tmp7_;
 
1710
        PromptBox* _tmp8_;
 
1711
        PromptBox* _tmp9_;
 
1712
        const gchar* _tmp10_;
 
1713
        const gchar* _tmp11_;
 
1714
        _tmp0_ = _data5_->list;
 
1715
        test_wait_for_scrolling_end (_tmp0_);
 
1716
        _tmp1_ = _data5_->list;
 
1717
        _tmp2_ = greeter_list_get_selected_entry ((GreeterList*) _tmp1_);
 
1718
        _tmp3_ = _tmp2_;
 
1719
        _tmp4_ = prompt_box_get_id (_tmp3_);
 
1720
        _tmp5_ = _tmp4_;
 
1721
        g_assert (g_strcmp0 (_tmp5_, "*remote_directory*http://crazyurl.com") == 0);
 
1722
        _tmp6_ = _data5_->list;
 
1723
        test_do_scroll (_tmp6_, GREETER_LIST_SCROLL_TARGET_DOWN);
 
1724
        _tmp7_ = _data5_->list;
 
1725
        _tmp8_ = greeter_list_get_selected_entry ((GreeterList*) _tmp7_);
 
1726
        _tmp9_ = _tmp8_;
 
1727
        _tmp10_ = prompt_box_get_id (_tmp9_);
 
1728
        _tmp11_ = _tmp10_;
 
1729
        g_assert (g_strcmp0 (_tmp11_, "*remote_directory*http://crazyurl.com") == 0);
 
1730
        _data5_->done = TRUE;
 
1731
        result = FALSE;
 
1732
        return result;
 
1733
}
 
1734
 
 
1735
 
 
1736
static gboolean ___lambda38__gsource_func (gpointer self) {
 
1737
        gboolean result;
 
1738
        result = __lambda38_ (self);
 
1739
        return result;
 
1740
}
 
1741
 
 
1742
 
 
1743
void test_remote_login_remote_login_changed_signal (void) {
 
1744
        Block5Data* _data5_;
 
1745
        MainWindow* _tmp0_ = NULL;
 
1746
        MainWindow* mw;
 
1747
        MainWindow* _tmp1_;
 
1748
        ListStack* _tmp2_;
 
1749
        GreeterList* _tmp3_ = NULL;
 
1750
        TestList* _tmp4_;
 
1751
        TestList* _tmp5_;
 
1752
        DashEntry* _tmp6_ = NULL;
 
1753
        DashEntry* email;
 
1754
        TestList* _tmp7_;
 
1755
        DashEntry* _tmp8_ = NULL;
 
1756
        DashEntry* pwd;
 
1757
        DashEntry* _tmp9_;
 
1758
        DashEntry* _tmp10_;
 
1759
        TestList* _tmp11_;
 
1760
        PromptBox* _tmp12_;
 
1761
        PromptBox* _tmp13_;
 
1762
        gchar** _tmp14_ = NULL;
 
1763
        gchar** _tmp15_;
 
1764
        gint _tmp15__length1;
 
1765
        TestList* _tmp16_;
 
1766
        PromptBox* _tmp17_;
 
1767
        PromptBox* _tmp18_;
 
1768
        gboolean _tmp19_;
 
1769
        gboolean _tmp20_;
 
1770
        TestList* _tmp21_;
 
1771
        PromptBox* _tmp22_;
 
1772
        PromptBox* _tmp23_;
 
1773
        const gchar* _tmp24_;
 
1774
        const gchar* _tmp25_;
 
1775
        MainWindow* _tmp27_;
 
1776
        _data5_ = g_slice_new0 (Block5Data);
 
1777
        _data5_->_ref_count_ = 1;
 
1778
        _tmp0_ = test_setup ();
 
1779
        mw = _tmp0_;
 
1780
        _tmp1_ = mw;
 
1781
        _tmp2_ = _tmp1_->stack;
 
1782
        _tmp3_ = list_stack_top (_tmp2_);
 
1783
        _data5_->list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
1784
        _tmp4_ = _data5_->list;
 
1785
        test_scroll_to_remote_login (_tmp4_);
 
1786
        _tmp5_ = _data5_->list;
 
1787
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
1788
        email = _tmp6_;
 
1789
        _tmp7_ = _data5_->list;
 
1790
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
1791
        pwd = _tmp8_;
 
1792
        _tmp9_ = email;
 
1793
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
1794
        _tmp10_ = pwd;
 
1795
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay3");
 
1796
        _tmp11_ = _data5_->list;
 
1797
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
1798
        _tmp13_ = _tmp12_;
 
1799
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
1800
        _tmp15_ = _tmp14_;
 
1801
        _tmp15__length1 = 0;
 
1802
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
1803
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
1804
        _tmp16_ = _data5_->list;
 
1805
        _tmp17_ = greeter_list_get_selected_entry ((GreeterList*) _tmp16_);
 
1806
        _tmp18_ = _tmp17_;
 
1807
        _tmp19_ = prompt_box_get_has_errors (_tmp18_);
 
1808
        _tmp20_ = _tmp19_;
 
1809
        g_assert (!_tmp20_);
 
1810
        _tmp21_ = _data5_->list;
 
1811
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
 
1812
        _tmp23_ = _tmp22_;
 
1813
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
1814
        _tmp25_ = _tmp24_;
 
1815
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
1816
        _data5_->done = FALSE;
 
1817
        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda38__gsource_func, block5_data_ref (_data5_), block5_data_unref);
 
1818
        while (TRUE) {
 
1819
                gboolean _tmp26_;
 
1820
                _tmp26_ = _data5_->done;
 
1821
                if (!(!_tmp26_)) {
 
1822
                        break;
 
1823
                }
 
1824
                test_process_events ();
 
1825
                usleep ((guint) 10000);
 
1826
        }
 
1827
        _tmp27_ = mw;
 
1828
        gtk_widget_hide ((GtkWidget*) _tmp27_);
 
1829
        _g_object_unref0 (pwd);
 
1830
        _g_object_unref0 (email);
 
1831
        _g_object_unref0 (mw);
 
1832
        block5_data_unref (_data5_);
 
1833
        _data5_ = NULL;
 
1834
}
 
1835
 
 
1836
 
 
1837
static Block6Data* block6_data_ref (Block6Data* _data6_) {
 
1838
        g_atomic_int_inc (&_data6_->_ref_count_);
 
1839
        return _data6_;
 
1840
}
 
1841
 
 
1842
 
 
1843
static void block6_data_unref (void * _userdata_) {
 
1844
        Block6Data* _data6_;
 
1845
        _data6_ = (Block6Data*) _userdata_;
 
1846
        if (g_atomic_int_dec_and_test (&_data6_->_ref_count_)) {
 
1847
                _g_free0 (_data6_->nonRemoteEntry);
 
1848
                _g_object_unref0 (_data6_->list);
 
1849
                g_slice_free (Block6Data, _data6_);
 
1850
        }
 
1851
}
 
1852
 
 
1853
 
 
1854
static gboolean __lambda39_ (Block6Data* _data6_) {
 
1855
        gboolean result = FALSE;
 
1856
        TestList* _tmp0_;
 
1857
        PromptBox* _tmp1_;
 
1858
        PromptBox* _tmp2_;
 
1859
        const gchar* _tmp3_;
 
1860
        const gchar* _tmp4_;
 
1861
        const gchar* _tmp5_;
 
1862
        TestList* _tmp6_;
 
1863
        TestList* _tmp7_;
 
1864
        PromptBox* _tmp8_;
 
1865
        PromptBox* _tmp9_;
 
1866
        const gchar* _tmp10_;
 
1867
        const gchar* _tmp11_;
 
1868
        TestList* _tmp12_;
 
1869
        TestList* _tmp13_;
 
1870
        PromptBox* _tmp14_;
 
1871
        PromptBox* _tmp15_;
 
1872
        const gchar* _tmp16_;
 
1873
        const gchar* _tmp17_;
 
1874
        _tmp0_ = _data6_->list;
 
1875
        _tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
 
1876
        _tmp2_ = _tmp1_;
 
1877
        _tmp3_ = prompt_box_get_id (_tmp2_);
 
1878
        _tmp4_ = _tmp3_;
 
1879
        _tmp5_ = _data6_->nonRemoteEntry;
 
1880
        g_assert (g_strcmp0 (_tmp4_, _tmp5_) == 0);
 
1881
        _tmp6_ = _data6_->list;
 
1882
        test_do_scroll (_tmp6_, GREETER_LIST_SCROLL_TARGET_DOWN);
 
1883
        _tmp7_ = _data6_->list;
 
1884
        _tmp8_ = greeter_list_get_selected_entry ((GreeterList*) _tmp7_);
 
1885
        _tmp9_ = _tmp8_;
 
1886
        _tmp10_ = prompt_box_get_id (_tmp9_);
 
1887
        _tmp11_ = _tmp10_;
 
1888
        g_assert (g_strcmp0 (_tmp11_, "*remote_directory*http://crazyurl.com") == 0);
 
1889
        _tmp12_ = _data6_->list;
 
1890
        test_do_scroll (_tmp12_, GREETER_LIST_SCROLL_TARGET_DOWN);
 
1891
        _tmp13_ = _data6_->list;
 
1892
        _tmp14_ = greeter_list_get_selected_entry ((GreeterList*) _tmp13_);
 
1893
        _tmp15_ = _tmp14_;
 
1894
        _tmp16_ = prompt_box_get_id (_tmp15_);
 
1895
        _tmp17_ = _tmp16_;
 
1896
        g_assert (g_strcmp0 (_tmp17_, "*remote_directory*http://crazyurl.com") == 0);
 
1897
        _data6_->done = TRUE;
 
1898
        result = FALSE;
 
1899
        return result;
 
1900
}
 
1901
 
 
1902
 
 
1903
static gboolean ___lambda39__gsource_func (gpointer self) {
 
1904
        gboolean result;
 
1905
        result = __lambda39_ (self);
 
1906
        return result;
 
1907
}
 
1908
 
 
1909
 
 
1910
void test_remote_login_remote_login_changed_signalfocus_not_in_changed_server (void) {
 
1911
        Block6Data* _data6_;
 
1912
        MainWindow* _tmp0_ = NULL;
 
1913
        MainWindow* mw;
 
1914
        MainWindow* _tmp1_;
 
1915
        ListStack* _tmp2_;
 
1916
        GreeterList* _tmp3_ = NULL;
 
1917
        TestList* _tmp4_;
 
1918
        TestList* _tmp5_;
 
1919
        DashEntry* _tmp6_ = NULL;
 
1920
        DashEntry* email;
 
1921
        TestList* _tmp7_;
 
1922
        DashEntry* _tmp8_ = NULL;
 
1923
        DashEntry* pwd;
 
1924
        DashEntry* _tmp9_;
 
1925
        DashEntry* _tmp10_;
 
1926
        TestList* _tmp11_;
 
1927
        PromptBox* _tmp12_;
 
1928
        PromptBox* _tmp13_;
 
1929
        gchar** _tmp14_ = NULL;
 
1930
        gchar** _tmp15_;
 
1931
        gint _tmp15__length1;
 
1932
        TestList* _tmp16_;
 
1933
        PromptBox* _tmp17_;
 
1934
        PromptBox* _tmp18_;
 
1935
        gboolean _tmp19_;
 
1936
        gboolean _tmp20_;
 
1937
        TestList* _tmp21_;
 
1938
        PromptBox* _tmp22_;
 
1939
        PromptBox* _tmp23_;
 
1940
        const gchar* _tmp24_;
 
1941
        const gchar* _tmp25_;
 
1942
        TestList* _tmp26_;
 
1943
        TestList* _tmp34_;
 
1944
        PromptBox* _tmp35_;
 
1945
        PromptBox* _tmp36_;
 
1946
        const gchar* _tmp37_;
 
1947
        const gchar* _tmp38_;
 
1948
        gchar* _tmp39_;
 
1949
        MainWindow* _tmp41_;
 
1950
        _data6_ = g_slice_new0 (Block6Data);
 
1951
        _data6_->_ref_count_ = 1;
 
1952
        _tmp0_ = test_setup ();
 
1953
        mw = _tmp0_;
 
1954
        _tmp1_ = mw;
 
1955
        _tmp2_ = _tmp1_->stack;
 
1956
        _tmp3_ = list_stack_top (_tmp2_);
 
1957
        _data6_->list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
1958
        _tmp4_ = _data6_->list;
 
1959
        test_scroll_to_remote_login (_tmp4_);
 
1960
        _tmp5_ = _data6_->list;
 
1961
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
1962
        email = _tmp6_;
 
1963
        _tmp7_ = _data6_->list;
 
1964
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
1965
        pwd = _tmp8_;
 
1966
        _tmp9_ = email;
 
1967
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
1968
        _tmp10_ = pwd;
 
1969
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay3");
 
1970
        _tmp11_ = _data6_->list;
 
1971
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
1972
        _tmp13_ = _tmp12_;
 
1973
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
1974
        _tmp15_ = _tmp14_;
 
1975
        _tmp15__length1 = 0;
 
1976
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
1977
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
1978
        _tmp16_ = _data6_->list;
 
1979
        _tmp17_ = greeter_list_get_selected_entry ((GreeterList*) _tmp16_);
 
1980
        _tmp18_ = _tmp17_;
 
1981
        _tmp19_ = prompt_box_get_has_errors (_tmp18_);
 
1982
        _tmp20_ = _tmp19_;
 
1983
        g_assert (!_tmp20_);
 
1984
        _tmp21_ = _data6_->list;
 
1985
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
 
1986
        _tmp23_ = _tmp22_;
 
1987
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
1988
        _tmp25_ = _tmp24_;
 
1989
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
1990
        _tmp26_ = _data6_->list;
 
1991
        test_wait_for_scrolling_end (_tmp26_);
 
1992
        while (TRUE) {
 
1993
                TestList* _tmp27_;
 
1994
                PromptBox* _tmp28_;
 
1995
                PromptBox* _tmp29_;
 
1996
                const gchar* _tmp30_;
 
1997
                const gchar* _tmp31_;
 
1998
                gboolean _tmp32_ = FALSE;
 
1999
                TestList* _tmp33_;
 
2000
                _tmp27_ = _data6_->list;
 
2001
                _tmp28_ = greeter_list_get_selected_entry ((GreeterList*) _tmp27_);
 
2002
                _tmp29_ = _tmp28_;
 
2003
                _tmp30_ = prompt_box_get_id (_tmp29_);
 
2004
                _tmp31_ = _tmp30_;
 
2005
                _tmp32_ = g_str_has_prefix (_tmp31_, "*remote_");
 
2006
                if (!_tmp32_) {
 
2007
                        break;
 
2008
                }
 
2009
                _tmp33_ = _data6_->list;
 
2010
                test_do_scroll (_tmp33_, GREETER_LIST_SCROLL_TARGET_UP);
 
2011
        }
 
2012
        _tmp34_ = _data6_->list;
 
2013
        _tmp35_ = greeter_list_get_selected_entry ((GreeterList*) _tmp34_);
 
2014
        _tmp36_ = _tmp35_;
 
2015
        _tmp37_ = prompt_box_get_id (_tmp36_);
 
2016
        _tmp38_ = _tmp37_;
 
2017
        _tmp39_ = g_strdup (_tmp38_);
 
2018
        _data6_->nonRemoteEntry = _tmp39_;
 
2019
        _data6_->done = FALSE;
 
2020
        g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda39__gsource_func, block6_data_ref (_data6_), block6_data_unref);
 
2021
        while (TRUE) {
 
2022
                gboolean _tmp40_;
 
2023
                _tmp40_ = _data6_->done;
 
2024
                if (!(!_tmp40_)) {
 
2025
                        break;
 
2026
                }
 
2027
                test_process_events ();
 
2028
                usleep ((guint) 10000);
 
2029
        }
 
2030
        _tmp41_ = mw;
 
2031
        gtk_widget_hide ((GtkWidget*) _tmp41_);
 
2032
        _g_object_unref0 (pwd);
 
2033
        _g_object_unref0 (email);
 
2034
        _g_object_unref0 (mw);
 
2035
        block6_data_unref (_data6_);
 
2036
        _data6_ = NULL;
 
2037
}
 
2038
 
 
2039
 
 
2040
void test_remote_login_authentication (void) {
 
2041
        MainWindow* _tmp0_ = NULL;
 
2042
        MainWindow* mw;
 
2043
        ListStack* _tmp1_;
 
2044
        GreeterList* _tmp2_ = NULL;
 
2045
        TestList* list;
 
2046
        PromptBox* _tmp3_;
 
2047
        PromptBox* _tmp4_;
 
2048
        const gchar* _tmp5_;
 
2049
        const gchar* _tmp6_;
 
2050
        PromptBox* _tmp7_;
 
2051
        PromptBox* _tmp8_;
 
2052
        gboolean _tmp9_;
 
2053
        gboolean _tmp10_;
 
2054
        DashEntry* _tmp11_ = NULL;
 
2055
        DashEntry* email;
 
2056
        DashEntry* _tmp12_ = NULL;
 
2057
        DashEntry* pwd;
 
2058
        DashEntry* _tmp13_;
 
2059
        PromptBox* _tmp14_;
 
2060
        PromptBox* _tmp15_;
 
2061
        gchar** _tmp16_ = NULL;
 
2062
        gchar** _tmp17_;
 
2063
        gint _tmp17__length1;
 
2064
        PromptBox* _tmp18_;
 
2065
        PromptBox* _tmp19_;
 
2066
        gboolean _tmp20_;
 
2067
        gboolean _tmp21_;
 
2068
        PromptBox* _tmp22_;
 
2069
        PromptBox* _tmp23_;
 
2070
        const gchar* _tmp24_;
 
2071
        const gchar* _tmp25_;
 
2072
        UnityGreeter* _tmp26_;
 
2073
        DashEntry* _tmp27_ = NULL;
 
2074
        DashEntry* _tmp28_;
 
2075
        PromptBox* _tmp29_;
 
2076
        PromptBox* _tmp30_;
 
2077
        gchar** _tmp31_ = NULL;
 
2078
        gchar** _tmp32_;
 
2079
        gint _tmp32__length1;
 
2080
        UnityGreeter* _tmp33_;
 
2081
        gboolean _tmp34_;
 
2082
        _tmp0_ = test_setup ();
 
2083
        mw = _tmp0_;
 
2084
        _tmp1_ = mw->stack;
 
2085
        _tmp2_ = list_stack_top (_tmp1_);
 
2086
        list = IS_TEST_LIST (_tmp2_) ? ((TestList*) _tmp2_) : NULL;
 
2087
        test_scroll_to_remote_login (list);
 
2088
        _tmp3_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2089
        _tmp4_ = _tmp3_;
 
2090
        _tmp5_ = prompt_box_get_id (_tmp4_);
 
2091
        _tmp6_ = _tmp5_;
 
2092
        g_assert (g_strcmp0 (_tmp6_, "*remote_directory*http://crazyurl.com") == 0);
 
2093
        _tmp7_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2094
        _tmp8_ = _tmp7_;
 
2095
        _tmp9_ = prompt_box_get_has_errors (_tmp8_);
 
2096
        _tmp10_ = _tmp9_;
 
2097
        g_assert (!_tmp10_);
 
2098
        _tmp11_ = test_remote_directory_entry_email_field (list);
 
2099
        email = _tmp11_;
 
2100
        _tmp12_ = test_remote_directory_entry_password_field (list);
 
2101
        pwd = _tmp12_;
 
2102
        gtk_entry_set_text ((GtkEntry*) email, "a@canonical.com");
 
2103
        _tmp13_ = pwd;
 
2104
        gtk_entry_set_text ((GtkEntry*) _tmp13_, "password");
 
2105
        _tmp14_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2106
        _tmp15_ = _tmp14_;
 
2107
        _tmp16_ = g_new0 (gchar*, 0 + 1);
 
2108
        _tmp17_ = _tmp16_;
 
2109
        _tmp17__length1 = 0;
 
2110
        g_signal_emit_by_name (_tmp15_, "respond", _tmp17_, 0);
 
2111
        _tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) g_free), NULL);
 
2112
        _tmp18_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2113
        _tmp19_ = _tmp18_;
 
2114
        _tmp20_ = prompt_box_get_has_errors (_tmp19_);
 
2115
        _tmp21_ = _tmp20_;
 
2116
        g_assert (!_tmp21_);
 
2117
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2118
        _tmp23_ = _tmp22_;
 
2119
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
2120
        _tmp25_ = _tmp24_;
 
2121
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
2122
        test_wait_for_scrolling_end (list);
 
2123
        _tmp26_ = unity_greeter_singleton;
 
2124
        _tmp26_->session_started = FALSE;
 
2125
        _tmp27_ = test_remote_login_entry_password_field (list);
 
2126
        _g_object_unref0 (pwd);
 
2127
        pwd = _tmp27_;
 
2128
        _tmp28_ = pwd;
 
2129
        gtk_entry_set_text ((GtkEntry*) _tmp28_, "password");
 
2130
        _tmp29_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2131
        _tmp30_ = _tmp29_;
 
2132
        _tmp31_ = g_new0 (gchar*, 0 + 1);
 
2133
        _tmp32_ = _tmp31_;
 
2134
        _tmp32__length1 = 0;
 
2135
        g_signal_emit_by_name (_tmp30_, "respond", _tmp32_, 0);
 
2136
        _tmp32_ = (_vala_array_free (_tmp32_, _tmp32__length1, (GDestroyNotify) g_free), NULL);
 
2137
        _tmp33_ = unity_greeter_singleton;
 
2138
        _tmp34_ = _tmp33_->session_started;
 
2139
        g_assert (_tmp34_);
 
2140
        gtk_widget_hide ((GtkWidget*) mw);
 
2141
        _g_object_unref0 (pwd);
 
2142
        _g_object_unref0 (email);
 
2143
        _g_object_unref0 (list);
 
2144
        _g_object_unref0 (mw);
 
2145
}
 
2146
 
 
2147
 
 
2148
void test_remote_login_cancel_authentication (void) {
 
2149
        MainWindow* _tmp0_ = NULL;
 
2150
        MainWindow* mw;
 
2151
        ListStack* _tmp1_;
 
2152
        GreeterList* _tmp2_ = NULL;
 
2153
        TestList* list;
 
2154
        PromptBox* _tmp3_;
 
2155
        PromptBox* _tmp4_;
 
2156
        const gchar* _tmp5_;
 
2157
        const gchar* _tmp6_;
 
2158
        PromptBox* _tmp7_;
 
2159
        PromptBox* _tmp8_;
 
2160
        gboolean _tmp9_;
 
2161
        gboolean _tmp10_;
 
2162
        DashEntry* _tmp11_ = NULL;
 
2163
        DashEntry* email;
 
2164
        DashEntry* _tmp12_ = NULL;
 
2165
        DashEntry* pwd;
 
2166
        DashEntry* _tmp13_;
 
2167
        PromptBox* _tmp14_;
 
2168
        PromptBox* _tmp15_;
 
2169
        gchar** _tmp16_ = NULL;
 
2170
        gchar** _tmp17_;
 
2171
        gint _tmp17__length1;
 
2172
        PromptBox* _tmp18_;
 
2173
        PromptBox* _tmp19_;
 
2174
        gboolean _tmp20_;
 
2175
        gboolean _tmp21_;
 
2176
        PromptBox* _tmp22_;
 
2177
        PromptBox* _tmp23_;
 
2178
        const gchar* _tmp24_;
 
2179
        const gchar* _tmp25_;
 
2180
        UnityGreeter* _tmp26_;
 
2181
        DashEntry* _tmp27_ = NULL;
 
2182
        DashEntry* _tmp28_;
 
2183
        DashEntry* _tmp29_;
 
2184
        gboolean _tmp30_;
 
2185
        gboolean _tmp31_;
 
2186
        DashEntry* _tmp32_;
 
2187
        gboolean _tmp33_;
 
2188
        gboolean _tmp34_;
 
2189
        DashEntry* _tmp35_ = NULL;
 
2190
        gboolean _tmp36_;
 
2191
        gboolean _tmp37_;
 
2192
        DashEntry* _tmp38_;
 
2193
        gboolean _tmp39_;
 
2194
        gboolean _tmp40_;
 
2195
        _tmp0_ = test_setup ();
 
2196
        mw = _tmp0_;
 
2197
        _tmp1_ = mw->stack;
 
2198
        _tmp2_ = list_stack_top (_tmp1_);
 
2199
        list = IS_TEST_LIST (_tmp2_) ? ((TestList*) _tmp2_) : NULL;
 
2200
        test_scroll_to_remote_login (list);
 
2201
        _tmp3_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2202
        _tmp4_ = _tmp3_;
 
2203
        _tmp5_ = prompt_box_get_id (_tmp4_);
 
2204
        _tmp6_ = _tmp5_;
 
2205
        g_assert (g_strcmp0 (_tmp6_, "*remote_directory*http://crazyurl.com") == 0);
 
2206
        _tmp7_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2207
        _tmp8_ = _tmp7_;
 
2208
        _tmp9_ = prompt_box_get_has_errors (_tmp8_);
 
2209
        _tmp10_ = _tmp9_;
 
2210
        g_assert (!_tmp10_);
 
2211
        _tmp11_ = test_remote_directory_entry_email_field (list);
 
2212
        email = _tmp11_;
 
2213
        _tmp12_ = test_remote_directory_entry_password_field (list);
 
2214
        pwd = _tmp12_;
 
2215
        gtk_entry_set_text ((GtkEntry*) email, "a@canonical.com");
 
2216
        _tmp13_ = pwd;
 
2217
        gtk_entry_set_text ((GtkEntry*) _tmp13_, "password");
 
2218
        _tmp14_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2219
        _tmp15_ = _tmp14_;
 
2220
        _tmp16_ = g_new0 (gchar*, 0 + 1);
 
2221
        _tmp17_ = _tmp16_;
 
2222
        _tmp17__length1 = 0;
 
2223
        g_signal_emit_by_name (_tmp15_, "respond", _tmp17_, 0);
 
2224
        _tmp17_ = (_vala_array_free (_tmp17_, _tmp17__length1, (GDestroyNotify) g_free), NULL);
 
2225
        _tmp18_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2226
        _tmp19_ = _tmp18_;
 
2227
        _tmp20_ = prompt_box_get_has_errors (_tmp19_);
 
2228
        _tmp21_ = _tmp20_;
 
2229
        g_assert (!_tmp21_);
 
2230
        _tmp22_ = greeter_list_get_selected_entry ((GreeterList*) list);
 
2231
        _tmp23_ = _tmp22_;
 
2232
        _tmp24_ = prompt_box_get_id (_tmp23_);
 
2233
        _tmp25_ = _tmp24_;
 
2234
        g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
 
2235
        test_wait_for_scrolling_end (list);
 
2236
        _tmp26_ = unity_greeter_singleton;
 
2237
        _tmp26_->session_started = FALSE;
 
2238
        _tmp27_ = test_remote_login_entry_password_field (list);
 
2239
        _g_object_unref0 (pwd);
 
2240
        pwd = _tmp27_;
 
2241
        _tmp28_ = pwd;
 
2242
        gtk_entry_set_text ((GtkEntry*) _tmp28_, "delay");
 
2243
        _tmp29_ = pwd;
 
2244
        g_signal_emit_by_name ((GtkEntry*) _tmp29_, "activate");
 
2245
        _tmp30_ = gtk_widget_get_sensitive ((GtkWidget*) list);
 
2246
        _tmp31_ = _tmp30_;
 
2247
        g_assert (!_tmp31_);
 
2248
        _tmp32_ = pwd;
 
2249
        _tmp33_ = dash_entry_get_did_respond (_tmp32_);
 
2250
        _tmp34_ = _tmp33_;
 
2251
        g_assert (_tmp34_);
 
2252
        greeter_list_cancel_authentication ((GreeterList*) list);
 
2253
        _tmp35_ = test_remote_login_entry_password_field (list);
 
2254
        _g_object_unref0 (pwd);
 
2255
        pwd = _tmp35_;
 
2256
        _tmp36_ = gtk_widget_get_sensitive ((GtkWidget*) list);
 
2257
        _tmp37_ = _tmp36_;
 
2258
        g_assert (_tmp37_);
 
2259
        _tmp38_ = pwd;
 
2260
        _tmp39_ = dash_entry_get_did_respond (_tmp38_);
 
2261
        _tmp40_ = _tmp39_;
 
2262
        g_assert (!_tmp40_);
 
2263
        gtk_widget_hide ((GtkWidget*) mw);
 
2264
        _g_object_unref0 (pwd);
 
2265
        _g_object_unref0 (email);
 
2266
        _g_object_unref0 (list);
 
2267
        _g_object_unref0 (mw);
 
2268
}
 
2269
 
 
2270
 
 
2271
void test_email_autocomplete (void) {
 
2272
        MainWindow* _tmp0_ = NULL;
 
2273
        MainWindow* mw;
 
2274
        ListStack* _tmp1_;
 
2275
        GreeterList* _tmp2_ = NULL;
 
2276
        TestList* list;
 
2277
        DashEntry* _tmp3_ = NULL;
 
2278
        DashEntry* email;
 
2279
        const gchar* _tmp4_;
 
2280
        const gchar* _tmp5_;
 
2281
        gint _tmp6_;
 
2282
        gint _tmp7_;
 
2283
        const gchar* _tmp8_;
 
2284
        const gchar* _tmp9_;
 
2285
        const gchar* _tmp10_;
 
2286
        const gchar* _tmp11_;
 
2287
        const gchar* _tmp12_;
 
2288
        const gchar* _tmp13_;
 
2289
        const gchar* _tmp14_;
 
2290
        const gchar* _tmp15_;
 
2291
        const gchar* _tmp16_;
 
2292
        const gchar* _tmp17_;
 
2293
        const gchar* _tmp18_;
 
2294
        const gchar* _tmp19_;
 
2295
        const gchar* _tmp20_;
 
2296
        const gchar* _tmp21_;
 
2297
        const gchar* _tmp22_;
 
2298
        const gchar* _tmp23_;
 
2299
        const gchar* _tmp24_;
 
2300
        const gchar* _tmp25_;
 
2301
        const gchar* _tmp26_;
 
2302
        const gchar* _tmp27_;
 
2303
        const gchar* _tmp28_;
 
2304
        const gchar* _tmp29_;
 
2305
        _tmp0_ = test_setup ();
 
2306
        mw = _tmp0_;
 
2307
        _tmp1_ = mw->stack;
 
2308
        _tmp2_ = list_stack_top (_tmp1_);
 
2309
        list = IS_TEST_LIST (_tmp2_) ? ((TestList*) _tmp2_) : NULL;
 
2310
        test_scroll_to_remote_login (list);
 
2311
        _tmp3_ = test_remote_directory_entry_email_field (list);
 
2312
        email = _tmp3_;
 
2313
        test_wait_for_focus ((GtkWidget*) email);
 
2314
        _tmp4_ = gtk_entry_get_text ((GtkEntry*) email);
 
2315
        _tmp5_ = _tmp4_;
 
2316
        _tmp6_ = strlen (_tmp5_);
 
2317
        _tmp7_ = _tmp6_;
 
2318
        g_assert (_tmp7_ == 0);
 
2319
        test_inject_key ((GtkWidget*) email, GDK_KEY_a);
 
2320
        _tmp8_ = gtk_entry_get_text ((GtkEntry*) email);
 
2321
        _tmp9_ = _tmp8_;
 
2322
        g_assert (g_strcmp0 (_tmp9_, "a") == 0);
 
2323
        test_inject_key ((GtkWidget*) email, GDK_KEY_at);
 
2324
        _tmp10_ = gtk_entry_get_text ((GtkEntry*) email);
 
2325
        _tmp11_ = _tmp10_;
 
2326
        g_assert (g_strcmp0 (_tmp11_, "a@canonical.com") == 0);
 
2327
        test_inject_key ((GtkWidget*) email, GDK_KEY_u);
 
2328
        _tmp12_ = gtk_entry_get_text ((GtkEntry*) email);
 
2329
        _tmp13_ = _tmp12_;
 
2330
        g_assert (g_strcmp0 (_tmp13_, "a@ubuntu.org") == 0);
 
2331
        test_inject_key ((GtkWidget*) email, GDK_KEY_r);
 
2332
        _tmp14_ = gtk_entry_get_text ((GtkEntry*) email);
 
2333
        _tmp15_ = _tmp14_;
 
2334
        g_assert (g_strcmp0 (_tmp15_, "a@urban.net") == 0);
 
2335
        test_inject_key ((GtkWidget*) email, GDK_KEY_BackSpace);
 
2336
        _tmp16_ = gtk_entry_get_text ((GtkEntry*) email);
 
2337
        _tmp17_ = _tmp16_;
 
2338
        g_assert (g_strcmp0 (_tmp17_, "a@ur") == 0);
 
2339
        test_inject_key ((GtkWidget*) email, GDK_KEY_BackSpace);
 
2340
        _tmp18_ = gtk_entry_get_text ((GtkEntry*) email);
 
2341
        _tmp19_ = _tmp18_;
 
2342
        g_assert (g_strcmp0 (_tmp19_, "a@u") == 0);
 
2343
        test_inject_key ((GtkWidget*) email, GDK_KEY_BackSpace);
 
2344
        _tmp20_ = gtk_entry_get_text ((GtkEntry*) email);
 
2345
        _tmp21_ = _tmp20_;
 
2346
        g_assert (g_strcmp0 (_tmp21_, "a@") == 0);
 
2347
        test_inject_key ((GtkWidget*) email, GDK_KEY_c);
 
2348
        _tmp22_ = gtk_entry_get_text ((GtkEntry*) email);
 
2349
        _tmp23_ = _tmp22_;
 
2350
        g_assert (g_strcmp0 (_tmp23_, "a@canonical.com") == 0);
 
2351
        test_inject_key ((GtkWidget*) email, GDK_KEY_a);
 
2352
        _tmp24_ = gtk_entry_get_text ((GtkEntry*) email);
 
2353
        _tmp25_ = _tmp24_;
 
2354
        g_assert (g_strcmp0 (_tmp25_, "a@canonical.com") == 0);
 
2355
        test_inject_key ((GtkWidget*) email, GDK_KEY_n);
 
2356
        _tmp26_ = gtk_entry_get_text ((GtkEntry*) email);
 
2357
        _tmp27_ = _tmp26_;
 
2358
        g_assert (g_strcmp0 (_tmp27_, "a@canonical.com") == 0);
 
2359
        test_inject_key ((GtkWidget*) email, GDK_KEY_d);
 
2360
        _tmp28_ = gtk_entry_get_text ((GtkEntry*) email);
 
2361
        _tmp29_ = _tmp28_;
 
2362
        g_assert (g_strcmp0 (_tmp29_, "a@candy.com") == 0);
 
2363
        gtk_widget_hide ((GtkWidget*) mw);
 
2364
        _g_object_unref0 (email);
 
2365
        _g_object_unref0 (list);
 
2366
        _g_object_unref0 (mw);
 
2367
}
 
2368
 
 
2369
 
 
2370
void test_greeter_communcation (void) {
 
2371
        MainWindow* _tmp0_ = NULL;
 
2372
        MainWindow* mw;
 
2373
        MainWindow* _tmp1_;
 
2374
        ListStack* _tmp2_;
 
2375
        GreeterList* _tmp3_ = NULL;
 
2376
        TestList* list;
 
2377
        TestList* _tmp4_;
 
2378
        TestList* _tmp5_;
 
2379
        DashEntry* _tmp6_ = NULL;
 
2380
        DashEntry* email;
 
2381
        TestList* _tmp7_;
 
2382
        DashEntry* _tmp8_ = NULL;
 
2383
        DashEntry* pwd;
 
2384
        DashEntry* _tmp9_;
 
2385
        DashEntry* _tmp10_;
 
2386
        TestList* _tmp11_;
 
2387
        PromptBox* _tmp12_;
 
2388
        PromptBox* _tmp13_;
 
2389
        gchar** _tmp14_ = NULL;
 
2390
        gchar** _tmp15_;
 
2391
        gint _tmp15__length1;
 
2392
        TestList* _tmp16_;
 
2393
        TestList* _tmp23_;
 
2394
        DashEntry* _tmp24_ = NULL;
 
2395
        DashEntry* domain;
 
2396
        TestList* _tmp25_;
 
2397
        DashEntry* _tmp26_ = NULL;
 
2398
        DashEntry* username;
 
2399
        TestList* _tmp27_;
 
2400
        DashEntry* _tmp28_ = NULL;
 
2401
        DashEntry* _tmp29_;
 
2402
        UnityGreeter* _tmp30_;
 
2403
        UnityGreeter* _tmp31_;
 
2404
        const gchar* _tmp32_;
 
2405
        const gchar* _tmp33_;
 
2406
        const gchar* _tmp34_;
 
2407
        UnityGreeter* _tmp35_;
 
2408
        UnityGreeter* _tmp36_;
 
2409
        const gchar* _tmp37_;
 
2410
        UnityGreeter* _tmp38_;
 
2411
        UnityGreeter* _tmp39_;
 
2412
        const gchar* _tmp40_;
 
2413
        const gchar* _tmp41_;
 
2414
        const gchar* _tmp42_;
 
2415
        UnityGreeter* _tmp43_;
 
2416
        UnityGreeter* _tmp44_;
 
2417
        const gchar* _tmp45_;
 
2418
        DashEntry* _tmp46_;
 
2419
        const gchar* _tmp47_;
 
2420
        const gchar* _tmp48_;
 
2421
        MainWindow* _tmp49_;
 
2422
        _tmp0_ = test_setup ();
 
2423
        mw = _tmp0_;
 
2424
        _tmp1_ = mw;
 
2425
        _tmp2_ = _tmp1_->stack;
 
2426
        _tmp3_ = list_stack_top (_tmp2_);
 
2427
        list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
2428
        _tmp4_ = list;
 
2429
        test_scroll_to_remote_login (_tmp4_);
 
2430
        _tmp5_ = list;
 
2431
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
2432
        email = _tmp6_;
 
2433
        _tmp7_ = list;
 
2434
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
2435
        pwd = _tmp8_;
 
2436
        _tmp9_ = email;
 
2437
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
2438
        _tmp10_ = pwd;
 
2439
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "password");
 
2440
        _tmp11_ = list;
 
2441
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
2442
        _tmp13_ = _tmp12_;
 
2443
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
2444
        _tmp15_ = _tmp14_;
 
2445
        _tmp15__length1 = 0;
 
2446
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
2447
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
2448
        _tmp16_ = list;
 
2449
        test_wait_for_scrolling_end (_tmp16_);
 
2450
        while (TRUE) {
 
2451
                TestList* _tmp17_;
 
2452
                PromptBox* _tmp18_;
 
2453
                PromptBox* _tmp19_;
 
2454
                const gchar* _tmp20_;
 
2455
                const gchar* _tmp21_;
 
2456
                TestList* _tmp22_;
 
2457
                _tmp17_ = list;
 
2458
                _tmp18_ = greeter_list_get_selected_entry ((GreeterList*) _tmp17_);
 
2459
                _tmp19_ = _tmp18_;
 
2460
                _tmp20_ = prompt_box_get_id (_tmp19_);
 
2461
                _tmp21_ = _tmp20_;
 
2462
                if (!(g_strcmp0 (_tmp21_, "*remote_login*http://coolrdpserver.com") != 0)) {
 
2463
                        break;
 
2464
                }
 
2465
                _tmp22_ = list;
 
2466
                test_do_scroll (_tmp22_, GREETER_LIST_SCROLL_TARGET_UP);
 
2467
        }
 
2468
        _tmp23_ = list;
 
2469
        _tmp24_ = test_remote_login_entry_domain_field (_tmp23_);
 
2470
        domain = _tmp24_;
 
2471
        _tmp25_ = list;
 
2472
        _tmp26_ = test_remote_login_entry_username_field (_tmp25_);
 
2473
        username = _tmp26_;
 
2474
        _tmp27_ = list;
 
2475
        _tmp28_ = test_remote_login_entry_password_field (_tmp27_);
 
2476
        _g_object_unref0 (pwd);
 
2477
        pwd = _tmp28_;
 
2478
        gtk_entry_set_text ((GtkEntry*) domain, "foo");
 
2479
        gtk_entry_set_text ((GtkEntry*) username, "bar");
 
2480
        _tmp29_ = pwd;
 
2481
        gtk_entry_set_text ((GtkEntry*) _tmp29_, "foobar");
 
2482
        _tmp30_ = unity_greeter_singleton;
 
2483
        g_signal_emit_by_name (_tmp30_, "show-prompt", "remote login:", LIGHTDM_PROMPT_TYPE_QUESTION);
 
2484
        _tmp31_ = unity_greeter_singleton;
 
2485
        _tmp32_ = _tmp31_->last_respond_response;
 
2486
        _tmp33_ = gtk_entry_get_text ((GtkEntry*) username);
 
2487
        _tmp34_ = _tmp33_;
 
2488
        g_assert (g_strcmp0 (_tmp32_, _tmp34_) == 0);
 
2489
        _tmp35_ = unity_greeter_singleton;
 
2490
        g_signal_emit_by_name (_tmp35_, "show-prompt", "remote host:", LIGHTDM_PROMPT_TYPE_QUESTION);
 
2491
        _tmp36_ = unity_greeter_singleton;
 
2492
        _tmp37_ = _tmp36_->last_respond_response;
 
2493
        g_assert (g_strcmp0 (_tmp37_, "http://coolrdpserver.com") == 0);
 
2494
        _tmp38_ = unity_greeter_singleton;
 
2495
        g_signal_emit_by_name (_tmp38_, "show-prompt", "domain:", LIGHTDM_PROMPT_TYPE_QUESTION);
 
2496
        _tmp39_ = unity_greeter_singleton;
 
2497
        _tmp40_ = _tmp39_->last_respond_response;
 
2498
        _tmp41_ = gtk_entry_get_text ((GtkEntry*) domain);
 
2499
        _tmp42_ = _tmp41_;
 
2500
        g_assert (g_strcmp0 (_tmp40_, _tmp42_) == 0);
 
2501
        _tmp43_ = unity_greeter_singleton;
 
2502
        g_signal_emit_by_name (_tmp43_, "show-prompt", "password:", LIGHTDM_PROMPT_TYPE_SECRET);
 
2503
        _tmp44_ = unity_greeter_singleton;
 
2504
        _tmp45_ = _tmp44_->last_respond_response;
 
2505
        _tmp46_ = pwd;
 
2506
        _tmp47_ = gtk_entry_get_text ((GtkEntry*) _tmp46_);
 
2507
        _tmp48_ = _tmp47_;
 
2508
        g_assert (g_strcmp0 (_tmp45_, _tmp48_) == 0);
 
2509
        _tmp49_ = mw;
 
2510
        gtk_widget_hide ((GtkWidget*) _tmp49_);
 
2511
        _g_object_unref0 (username);
 
2512
        _g_object_unref0 (domain);
 
2513
        _g_object_unref0 (pwd);
 
2514
        _g_object_unref0 (email);
 
2515
        _g_object_unref0 (list);
 
2516
        _g_object_unref0 (mw);
 
2517
}
 
2518
 
 
2519
 
 
2520
void test_unsupported_server_type (void) {
 
2521
        MainWindow* _tmp0_ = NULL;
 
2522
        MainWindow* mw;
 
2523
        MainWindow* _tmp1_;
 
2524
        ListStack* _tmp2_;
 
2525
        GreeterList* _tmp3_ = NULL;
 
2526
        TestList* list;
 
2527
        TestList* _tmp4_;
 
2528
        TestList* _tmp5_;
 
2529
        DashEntry* _tmp6_ = NULL;
 
2530
        DashEntry* email;
 
2531
        TestList* _tmp7_;
 
2532
        DashEntry* _tmp8_ = NULL;
 
2533
        DashEntry* pwd;
 
2534
        DashEntry* _tmp9_;
 
2535
        DashEntry* _tmp10_;
 
2536
        TestList* _tmp11_;
 
2537
        PromptBox* _tmp12_;
 
2538
        PromptBox* _tmp13_;
 
2539
        gchar** _tmp14_ = NULL;
 
2540
        gchar** _tmp15_;
 
2541
        gint _tmp15__length1;
 
2542
        TestList* _tmp16_;
 
2543
        TestList* _tmp23_;
 
2544
        PromptBox* _tmp24_;
 
2545
        PromptBox* _tmp25_;
 
2546
        gboolean _tmp26_;
 
2547
        gboolean _tmp27_;
 
2548
        TestList* _tmp28_;
 
2549
        PromptBox* _tmp29_;
 
2550
        PromptBox* _tmp30_;
 
2551
        gboolean _tmp31_;
 
2552
        gboolean _tmp32_;
 
2553
        MainWindow* _tmp33_;
 
2554
        _tmp0_ = test_setup ();
 
2555
        mw = _tmp0_;
 
2556
        _tmp1_ = mw;
 
2557
        _tmp2_ = _tmp1_->stack;
 
2558
        _tmp3_ = list_stack_top (_tmp2_);
 
2559
        list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
 
2560
        _tmp4_ = list;
 
2561
        test_scroll_to_remote_login (_tmp4_);
 
2562
        _tmp5_ = list;
 
2563
        _tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
 
2564
        email = _tmp6_;
 
2565
        _tmp7_ = list;
 
2566
        _tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
 
2567
        pwd = _tmp8_;
 
2568
        _tmp9_ = email;
 
2569
        gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
 
2570
        _tmp10_ = pwd;
 
2571
        gtk_entry_set_text ((GtkEntry*) _tmp10_, "password");
 
2572
        _tmp11_ = list;
 
2573
        _tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
 
2574
        _tmp13_ = _tmp12_;
 
2575
        _tmp14_ = g_new0 (gchar*, 0 + 1);
 
2576
        _tmp15_ = _tmp14_;
 
2577
        _tmp15__length1 = 0;
 
2578
        g_signal_emit_by_name (_tmp13_, "respond", _tmp15_, 0);
 
2579
        _tmp15_ = (_vala_array_free (_tmp15_, _tmp15__length1, (GDestroyNotify) g_free), NULL);
 
2580
        _tmp16_ = list;
 
2581
        test_wait_for_scrolling_end (_tmp16_);
 
2582
        while (TRUE) {
 
2583
                TestList* _tmp17_;
 
2584
                PromptBox* _tmp18_;
 
2585
                PromptBox* _tmp19_;
 
2586
                const gchar* _tmp20_;
 
2587
                const gchar* _tmp21_;
 
2588
                TestList* _tmp22_;
 
2589
                _tmp17_ = list;
 
2590
                _tmp18_ = greeter_list_get_selected_entry ((GreeterList*) _tmp17_);
 
2591
                _tmp19_ = _tmp18_;
 
2592
                _tmp20_ = prompt_box_get_id (_tmp19_);
 
2593
                _tmp21_ = _tmp20_;
 
2594
                if (!(g_strcmp0 (_tmp21_, "*remote_login*http://notsupportedserver.com") != 0)) {
 
2595
                        break;
 
2596
                }
 
2597
                _tmp22_ = list;
 
2598
                test_do_scroll (_tmp22_, GREETER_LIST_SCROLL_TARGET_UP);
 
2599
        }
 
2600
        _tmp23_ = list;
 
2601
        _tmp24_ = greeter_list_get_selected_entry ((GreeterList*) _tmp23_);
 
2602
        _tmp25_ = _tmp24_;
 
2603
        _tmp26_ = prompt_box_get_has_errors (_tmp25_);
 
2604
        _tmp27_ = _tmp26_;
 
2605
        g_assert (_tmp27_);
 
2606
        _tmp28_ = list;
 
2607
        _tmp29_ = greeter_list_get_selected_entry ((GreeterList*) _tmp28_);
 
2608
        _tmp30_ = _tmp29_;
 
2609
        _tmp31_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp30_);
 
2610
        _tmp32_ = _tmp31_;
 
2611
        g_assert (!_tmp32_);
 
2612
        _tmp33_ = mw;
 
2613
        gtk_widget_hide ((GtkWidget*) _tmp33_);
 
2614
        _g_object_unref0 (pwd);
 
2615
        _g_object_unref0 (email);
 
2616
        _g_object_unref0 (list);
 
2617
        _g_object_unref0 (mw);
 
2618
}
 
2619
 
 
2620
 
 
2621
static void test_setup_gsettings (void) {
 
2622
        GError * _inner_error_ = NULL;
 
2623
        {
 
2624
                gchar* _tmp0_ = NULL;
 
2625
                gchar* dir;
 
2626
                gchar* _tmp1_ = NULL;
 
2627
                gchar* schema_dir;
 
2628
                const gchar* _tmp2_;
 
2629
                const gchar* _tmp3_ = NULL;
 
2630
                gchar* _tmp4_;
 
2631
                gchar* data_dirs;
 
2632
                gchar* _tmp5_ = NULL;
 
2633
                gchar* _tmp6_;
 
2634
                const gchar* _tmp7_;
 
2635
                gchar* _tmp8_ = NULL;
 
2636
                gchar* _tmp9_;
 
2637
                const gchar* _tmp10_;
 
2638
                gchar* _tmp11_ = NULL;
 
2639
                gchar* _tmp12_;
 
2640
                gint _tmp13_ = 0;
 
2641
                gboolean _tmp14_;
 
2642
                const gchar* _tmp16_;
 
2643
                gchar* _tmp17_ = NULL;
 
2644
                gchar* _tmp18_;
 
2645
                gint _tmp19_ = 0;
 
2646
                gboolean _tmp20_;
 
2647
                _tmp0_ = g_dir_make_tmp ("unity-greeter-test-XXXXXX", &_inner_error_);
 
2648
                dir = _tmp0_;
 
2649
                if (_inner_error_ != NULL) {
 
2650
                        goto __catch0_g_error;
 
2651
                }
 
2652
                _tmp1_ = g_build_filename (dir, "share", "glib-2.0", "schemas", NULL);
 
2653
                schema_dir = _tmp1_;
 
2654
                _tmp2_ = schema_dir;
 
2655
                g_mkdir_with_parents (_tmp2_, 0700);
 
2656
                _tmp3_ = g_getenv ("XDG_DATA_DIRS");
 
2657
                _tmp4_ = g_strdup (_tmp3_);
 
2658
                data_dirs = _tmp4_;
 
2659
                _tmp5_ = g_build_filename (dir, "share", NULL);
 
2660
                _tmp6_ = _tmp5_;
 
2661
                _tmp7_ = data_dirs;
 
2662
                _tmp8_ = g_strdup_printf ("%s:%s", _tmp6_, _tmp7_);
 
2663
                _tmp9_ = _tmp8_;
 
2664
                g_setenv ("XDG_DATA_DIRS", _tmp9_, TRUE);
 
2665
                _g_free0 (_tmp9_);
 
2666
                _g_free0 (_tmp6_);
 
2667
                _tmp10_ = schema_dir;
 
2668
                _tmp11_ = g_strdup_printf ("cp ../data/com.canonical.unity-greeter.gschema.xml %s", _tmp10_);
 
2669
                _tmp12_ = _tmp11_;
 
2670
                _tmp13_ = system (_tmp12_);
 
2671
                _tmp14_ = _tmp13_ != 0;
 
2672
                _g_free0 (_tmp12_);
 
2673
                if (_tmp14_) {
 
2674
                        const gchar* _tmp15_;
 
2675
                        _tmp15_ = schema_dir;
 
2676
                        g_warning ("test.vala:651: Could not copy schema to %s", _tmp15_);
 
2677
                }
 
2678
                _tmp16_ = schema_dir;
 
2679
                _tmp17_ = g_strdup_printf ("glib-compile-schemas %s", _tmp16_);
 
2680
                _tmp18_ = _tmp17_;
 
2681
                _tmp19_ = system (_tmp18_);
 
2682
                _tmp20_ = _tmp19_ != 0;
 
2683
                _g_free0 (_tmp18_);
 
2684
                if (_tmp20_) {
 
2685
                        const gchar* _tmp21_;
 
2686
                        _tmp21_ = schema_dir;
 
2687
                        g_warning ("test.vala:654: Could not compile schemas in %s", _tmp21_);
 
2688
                }
 
2689
                g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
 
2690
                _g_free0 (data_dirs);
 
2691
                _g_free0 (schema_dir);
 
2692
                _g_free0 (dir);
 
2693
        }
 
2694
        goto __finally0;
 
2695
        __catch0_g_error:
 
2696
        {
 
2697
                GError* e = NULL;
 
2698
                GError* _tmp22_;
 
2699
                const gchar* _tmp23_;
 
2700
                e = _inner_error_;
 
2701
                _inner_error_ = NULL;
 
2702
                _tmp22_ = e;
 
2703
                _tmp23_ = _tmp22_->message;
 
2704
                g_debug ("test.vala:660: Error setting up gsettings: %s", _tmp23_);
 
2705
                _g_error_free0 (e);
 
2706
        }
 
2707
        __finally0:
 
2708
        if (_inner_error_ != NULL) {
 
2709
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
2710
                g_clear_error (&_inner_error_);
 
2711
                return;
 
2712
        }
 
2713
}
 
2714
 
 
2715
 
 
2716
static void _test_simple_navigation_gcallback (void) {
 
2717
        test_simple_navigation ();
 
2718
}
 
2719
 
 
2720
 
 
2721
static void _test_remote_login_gcallback (void) {
 
2722
        test_remote_login ();
 
2723
}
 
2724
 
 
2725
 
 
2726
static void _test_remote_login_servers_updated_signal_gcallback (void) {
 
2727
        test_remote_login_servers_updated_signal ();
 
2728
}
 
2729
 
 
2730
 
 
2731
static void _test_remote_login_servers_updated_signal_focus_not_in_remote_server_gcallback (void) {
 
2732
        test_remote_login_servers_updated_signal_focus_not_in_remote_server ();
 
2733
}
 
2734
 
 
2735
 
 
2736
static void _test_remote_login_login_servers_updated_signal_gcallback (void) {
 
2737
        test_remote_login_login_servers_updated_signal ();
 
2738
}
 
2739
 
 
2740
 
 
2741
static void _test_remote_login_login_servers_updated_signal_focus_not_in_removed_server_gcallback (void) {
 
2742
        test_remote_login_login_servers_updated_signal_focus_not_in_removed_server ();
 
2743
}
 
2744
 
 
2745
 
 
2746
static void _test_remote_login_remote_login_changed_signal_gcallback (void) {
 
2747
        test_remote_login_remote_login_changed_signal ();
 
2748
}
 
2749
 
 
2750
 
 
2751
static void _test_remote_login_remote_login_changed_signalfocus_not_in_changed_server_gcallback (void) {
 
2752
        test_remote_login_remote_login_changed_signalfocus_not_in_changed_server ();
 
2753
}
 
2754
 
 
2755
 
 
2756
static void _test_remote_login_authentication_gcallback (void) {
 
2757
        test_remote_login_authentication ();
 
2758
}
 
2759
 
 
2760
 
 
2761
static void _test_remote_login_cancel_authentication_gcallback (void) {
 
2762
        test_remote_login_cancel_authentication ();
 
2763
}
 
2764
 
 
2765
 
 
2766
static void _test_email_autocomplete_gcallback (void) {
 
2767
        test_email_autocomplete ();
 
2768
}
 
2769
 
 
2770
 
 
2771
static void _test_greeter_communcation_gcallback (void) {
 
2772
        test_greeter_communcation ();
 
2773
}
 
2774
 
 
2775
 
 
2776
static void _test_unsupported_server_type_gcallback (void) {
 
2777
        test_unsupported_server_type ();
 
2778
}
 
2779
 
 
2780
 
 
2781
gint test_main (gchar** args, int args_length1) {
 
2782
        gint result = 0;
 
2783
        UnityGreeter* _tmp0_;
 
2784
        UnityGreeter* _tmp1_;
 
2785
        gint _tmp2_ = 0;
 
2786
        gtk_test_init (&args_length1, &args, NULL);
 
2787
        test_setup_gsettings ();
 
2788
        _tmp0_ = unity_greeter_new ();
 
2789
        _unity_greeter_unref0 (unity_greeter_singleton);
 
2790
        unity_greeter_singleton = _tmp0_;
 
2791
        _tmp1_ = unity_greeter_singleton;
 
2792
        _tmp1_->test_mode = TRUE;
 
2793
        g_test_add_func ("/Simple Navigation", _test_simple_navigation_gcallback);
 
2794
        g_test_add_func ("/Remote Login", _test_remote_login_gcallback);
 
2795
        g_test_add_func ("/Remote Login with Servers Updated signal", _test_remote_login_servers_updated_signal_gcallback);
 
2796
        g_test_add_func ("/Remote Login with Servers Updated signal and not in remote server", _test_remote_login_servers_updated_signal_focus_not_in_remote_server_gcallback);
 
2797
        g_test_add_func ("/Remote Login with Login Servers Updated signal", _test_remote_login_login_servers_updated_signal_gcallback);
 
2798
        g_test_add_func ("/Remote Login with Login Servers Updated signal and not in removed ser" \
 
2799
"ver", _test_remote_login_login_servers_updated_signal_focus_not_in_removed_server_gcallback);
 
2800
        g_test_add_func ("/Remote Login with Remote Login Changed signal", _test_remote_login_remote_login_changed_signal_gcallback);
 
2801
        g_test_add_func ("/Remote Login with Remote Login Changed signal and not in changed serv" \
 
2802
"er", _test_remote_login_remote_login_changed_signalfocus_not_in_changed_server_gcallback);
 
2803
        g_test_add_func ("/Remote Login authentication", _test_remote_login_authentication_gcallback);
 
2804
        g_test_add_func ("/Remote Login cancel authentication", _test_remote_login_cancel_authentication_gcallback);
 
2805
        g_test_add_func ("/Email Autocomplete", _test_email_autocomplete_gcallback);
 
2806
        g_test_add_func ("/Greeter Communication", _test_greeter_communcation_gcallback);
 
2807
        g_test_add_func ("/Unsupported server type", _test_unsupported_server_type_gcallback);
 
2808
        _tmp2_ = g_test_run ();
 
2809
        result = _tmp2_;
 
2810
        return result;
 
2811
}
 
2812
 
 
2813
 
 
2814
int main (int argc, char ** argv) {
 
2815
        g_type_init ();
 
2816
        return test_main (argv, argc);
 
2817
}
 
2818
 
 
2819
 
 
2820
Test* test_construct (GType object_type) {
 
2821
        Test* self = NULL;
 
2822
        self = (Test*) g_type_create_instance (object_type);
 
2823
        return self;
 
2824
}
 
2825
 
 
2826
 
 
2827
Test* test_new (void) {
 
2828
        return test_construct (TYPE_TEST);
 
2829
}
 
2830
 
 
2831
 
 
2832
static void value_test_init (GValue* value) {
 
2833
        value->data[0].v_pointer = NULL;
 
2834
}
 
2835
 
 
2836
 
 
2837
static void value_test_free_value (GValue* value) {
 
2838
        if (value->data[0].v_pointer) {
 
2839
                test_unref (value->data[0].v_pointer);
 
2840
        }
 
2841
}
 
2842
 
 
2843
 
 
2844
static void value_test_copy_value (const GValue* src_value, GValue* dest_value) {
 
2845
        if (src_value->data[0].v_pointer) {
 
2846
                dest_value->data[0].v_pointer = test_ref (src_value->data[0].v_pointer);
 
2847
        } else {
 
2848
                dest_value->data[0].v_pointer = NULL;
 
2849
        }
 
2850
}
 
2851
 
 
2852
 
 
2853
static gpointer value_test_peek_pointer (const GValue* value) {
 
2854
        return value->data[0].v_pointer;
 
2855
}
 
2856
 
 
2857
 
 
2858
static gchar* value_test_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
 
2859
        if (collect_values[0].v_pointer) {
 
2860
                Test* object;
 
2861
                object = collect_values[0].v_pointer;
 
2862
                if (object->parent_instance.g_class == NULL) {
 
2863
                        return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
 
2864
                } else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
 
2865
                        return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
 
2866
                }
 
2867
                value->data[0].v_pointer = test_ref (object);
 
2868
        } else {
 
2869
                value->data[0].v_pointer = NULL;
 
2870
        }
 
2871
        return NULL;
 
2872
}
 
2873
 
 
2874
 
 
2875
static gchar* value_test_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
 
2876
        Test** object_p;
 
2877
        object_p = collect_values[0].v_pointer;
 
2878
        if (!object_p) {
 
2879
                return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
 
2880
        }
 
2881
        if (!value->data[0].v_pointer) {
 
2882
                *object_p = NULL;
 
2883
        } else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
 
2884
                *object_p = value->data[0].v_pointer;
 
2885
        } else {
 
2886
                *object_p = test_ref (value->data[0].v_pointer);
 
2887
        }
 
2888
        return NULL;
 
2889
}
 
2890
 
 
2891
 
 
2892
GParamSpec* param_spec_test (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
 
2893
        ParamSpecTest* spec;
 
2894
        g_return_val_if_fail (g_type_is_a (object_type, TYPE_TEST), NULL);
 
2895
        spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
 
2896
        G_PARAM_SPEC (spec)->value_type = object_type;
 
2897
        return G_PARAM_SPEC (spec);
 
2898
}
 
2899
 
 
2900
 
 
2901
gpointer value_get_test (const GValue* value) {
 
2902
        g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST), NULL);
 
2903
        return value->data[0].v_pointer;
 
2904
}
 
2905
 
 
2906
 
 
2907
void value_set_test (GValue* value, gpointer v_object) {
 
2908
        Test* old;
 
2909
        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST));
 
2910
        old = value->data[0].v_pointer;
 
2911
        if (v_object) {
 
2912
                g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST));
 
2913
                g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
 
2914
                value->data[0].v_pointer = v_object;
 
2915
                test_ref (value->data[0].v_pointer);
 
2916
        } else {
 
2917
                value->data[0].v_pointer = NULL;
 
2918
        }
 
2919
        if (old) {
 
2920
                test_unref (old);
 
2921
        }
 
2922
}
 
2923
 
 
2924
 
 
2925
void value_take_test (GValue* value, gpointer v_object) {
 
2926
        Test* old;
 
2927
        g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST));
 
2928
        old = value->data[0].v_pointer;
 
2929
        if (v_object) {
 
2930
                g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_TEST));
 
2931
                g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
 
2932
                value->data[0].v_pointer = v_object;
 
2933
        } else {
 
2934
                value->data[0].v_pointer = NULL;
 
2935
        }
 
2936
        if (old) {
 
2937
                test_unref (old);
 
2938
        }
 
2939
}
 
2940
 
 
2941
 
 
2942
static void test_class_init (TestClass * klass) {
 
2943
        test_parent_class = g_type_class_peek_parent (klass);
 
2944
        TEST_CLASS (klass)->finalize = test_finalize;
 
2945
}
 
2946
 
 
2947
 
 
2948
static void test_instance_init (Test * self) {
 
2949
        self->ref_count = 1;
 
2950
}
 
2951
 
 
2952
 
 
2953
static void test_finalize (Test* obj) {
 
2954
        Test * self;
 
2955
        self = TEST (obj);
 
2956
}
 
2957
 
 
2958
 
 
2959
GType test_get_type (void) {
 
2960
        static volatile gsize test_type_id__volatile = 0;
 
2961
        if (g_once_init_enter (&test_type_id__volatile)) {
 
2962
                static const GTypeValueTable g_define_type_value_table = { value_test_init, value_test_free_value, value_test_copy_value, value_test_peek_pointer, "p", value_test_collect_value, "p", value_test_lcopy_value };
 
2963
                static const GTypeInfo g_define_type_info = { sizeof (TestClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) test_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (Test), 0, (GInstanceInitFunc) test_instance_init, &g_define_type_value_table };
 
2964
                static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
 
2965
                GType test_type_id;
 
2966
                test_type_id = g_type_register_fundamental (g_type_fundamental_next (), "Test", &g_define_type_info, &g_define_type_fundamental_info, 0);
 
2967
                g_once_init_leave (&test_type_id__volatile, test_type_id);
 
2968
        }
 
2969
        return test_type_id__volatile;
 
2970
}
 
2971
 
 
2972
 
 
2973
gpointer test_ref (gpointer instance) {
 
2974
        Test* self;
 
2975
        self = instance;
 
2976
        g_atomic_int_inc (&self->ref_count);
 
2977
        return instance;
 
2978
}
 
2979
 
 
2980
 
 
2981
void test_unref (gpointer instance) {
 
2982
        Test* self;
 
2983
        self = instance;
 
2984
        if (g_atomic_int_dec_and_test (&self->ref_count)) {
 
2985
                TEST_GET_CLASS (self)->finalize (self);
 
2986
                g_type_free_instance ((GTypeInstance *) self);
 
2987
        }
 
2988
}
 
2989
 
 
2990
 
 
2991
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
 
2992
        if ((array != NULL) && (destroy_func != NULL)) {
 
2993
                int i;
 
2994
                for (i = 0; i < array_length; i = i + 1) {
 
2995
                        if (((gpointer*) array)[i] != NULL) {
 
2996
                                destroy_func (((gpointer*) array)[i]);
 
2997
                        }
 
2998
                }
 
2999
        }
 
3000
}
 
3001
 
 
3002
 
 
3003
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
 
3004
        _vala_array_destroy (array, array_length, destroy_func);
 
3005
        g_free (array);
 
3006
}
 
3007
 
 
3008
 
 
3009