1
/* test.c generated by valac 0.16.1, the Vala compiler
2
* generated from test.vala, do not modify */
6
#include <glib-object.h>
13
#include <glib/gstdio.h>
14
#include <gobject/gvaluecollector.h>
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))
24
typedef struct _Test Test;
25
typedef struct _TestClass TestClass;
26
typedef struct _TestPrivate TestPrivate;
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))
35
typedef struct _MainWindow MainWindow;
36
typedef struct _MainWindowClass MainWindowClass;
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))
45
typedef struct _TestMainWindow TestMainWindow;
46
typedef struct _TestMainWindowClass TestMainWindowClass;
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))
55
typedef struct _Background Background;
56
typedef struct _BackgroundClass BackgroundClass;
57
typedef struct _MainWindowPrivate MainWindowPrivate;
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))
66
typedef struct _FadableBox FadableBox;
67
typedef struct _FadableBoxClass FadableBoxClass;
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))
76
typedef struct _GreeterList GreeterList;
77
typedef struct _GreeterListClass GreeterListClass;
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))
86
typedef struct _UserList UserList;
87
typedef struct _UserListClass UserListClass;
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))
96
typedef struct _MenuBar MenuBar;
97
typedef struct _MenuBarClass MenuBarClass;
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))
106
typedef struct _ListStack ListStack;
107
typedef struct _ListStackClass ListStackClass;
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))
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)))
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))
127
typedef struct _DashEntry DashEntry;
128
typedef struct _DashEntryClass DashEntryClass;
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))
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)))
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;
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))
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;
166
GTypeInstance parent_instance;
167
volatile int ref_count;
172
GTypeClass parent_class;
173
void (*finalize) (Test *self);
177
GtkWindow parent_instance;
178
MainWindowPrivate * priv;
184
struct _MainWindowClass {
185
GtkWindowClass parent_class;
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;
204
gchar* nonRemoteEntry;
229
gchar* nonRemoteEntry;
233
struct _UnityGreeter {
234
GTypeInstance parent_instance;
235
volatile int ref_count;
236
UnityGreeterPrivate * priv;
238
gboolean session_started;
239
gchar* last_respond_response;
242
struct _UnityGreeterClass {
243
GTypeClass parent_class;
244
void (*finalize) (UnityGreeter *self);
247
struct _ParamSpecTest {
248
GParamSpec parent_instance;
252
static gpointer test_parent_class = NULL;
253
extern UnityGreeter* unity_greeter_singleton;
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;
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);
372
static MainWindow* test_setup (void) {
373
MainWindow* result = NULL;
374
TestMainWindow* _tmp0_;
375
TestMainWindow* _tmp1_;
376
TestMainWindow* main_window;
377
Background* _tmp2_ = NULL;
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);
389
_tmp4_ = ((MainWindow*) main_window)->menubar;
390
_tmp5_ = test_list_new (_tmp3_, _tmp4_);
391
_tmp6_ = g_object_ref_sink (_tmp5_);
393
_g_object_unref0 (_tmp3_);
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);
404
static void test_process_events (void) {
406
gboolean _tmp0_ = FALSE;
407
_tmp0_ = gtk_events_pending ();
411
gtk_main_iteration ();
416
static void test_wait_for_scrolling_end (TestList* list) {
417
g_return_if_fail (list != NULL);
420
gboolean _tmp1_ = FALSE;
422
_tmp1_ = test_list_is_scrolling (_tmp0_);
426
test_process_events ();
427
usleep ((guint) 10000);
432
static gpointer _g_object_ref0 (gpointer self) {
433
return self ? g_object_ref (self) : NULL;
437
static DashEntry* test_remote_directory_entry_email_field (TestList* list) {
438
DashEntry* result = NULL;
442
GtkWidget* _tmp3_ = NULL;
445
GList* _tmp5_ = NULL;
447
gconstpointer _tmp7_ = NULL;
451
GtkWidget* _tmp10_ = NULL;
453
g_return_val_if_fail (list != NULL, NULL);
455
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
457
_tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
458
_tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
460
_tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
462
_tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
463
_tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
465
_g_list_free0 (_tmp6_);
467
_tmp10_ = gtk_grid_get_child_at (grid, 1, 1);
468
_tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
470
_g_object_unref0 (grid);
471
_g_object_unref0 (fixed);
476
static DashEntry* test_remote_directory_entry_password_field (TestList* list) {
477
DashEntry* result = NULL;
481
GtkWidget* _tmp3_ = NULL;
484
GList* _tmp5_ = NULL;
486
gconstpointer _tmp7_ = NULL;
490
GtkWidget* _tmp10_ = NULL;
492
g_return_val_if_fail (list != NULL, NULL);
494
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
496
_tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
497
_tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
499
_tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
501
_tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
502
_tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
504
_g_list_free0 (_tmp6_);
506
_tmp10_ = gtk_grid_get_child_at (grid, 1, 2);
507
_tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
509
_g_object_unref0 (grid);
510
_g_object_unref0 (fixed);
515
static DashEntry* test_remote_login_entry_domain_field (TestList* list) {
516
DashEntry* result = NULL;
520
GtkWidget* _tmp3_ = NULL;
523
GList* _tmp5_ = NULL;
525
gconstpointer _tmp7_ = NULL;
529
GtkWidget* _tmp10_ = NULL;
531
g_return_val_if_fail (list != NULL, NULL);
533
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
535
_tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
536
_tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
538
_tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
540
_tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
541
_tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
543
_g_list_free0 (_tmp6_);
545
_tmp10_ = gtk_grid_get_child_at (grid, 1, 1);
546
_tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
548
_g_object_unref0 (grid);
549
_g_object_unref0 (fixed);
554
static DashEntry* test_remote_login_entry_username_field (TestList* list) {
555
DashEntry* result = NULL;
559
GtkWidget* _tmp3_ = NULL;
562
GList* _tmp5_ = NULL;
564
gconstpointer _tmp7_ = NULL;
568
GtkWidget* _tmp10_ = NULL;
570
g_return_val_if_fail (list != NULL, NULL);
572
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
574
_tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
575
_tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
577
_tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
579
_tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
580
_tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
582
_g_list_free0 (_tmp6_);
584
_tmp10_ = gtk_grid_get_child_at (grid, 1, 2);
585
_tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
587
_g_object_unref0 (grid);
588
_g_object_unref0 (fixed);
593
static DashEntry* test_remote_login_entry_password_field (TestList* list) {
594
DashEntry* result = NULL;
598
GtkWidget* _tmp3_ = NULL;
601
GList* _tmp5_ = NULL;
603
gconstpointer _tmp7_ = NULL;
607
GtkWidget* _tmp10_ = NULL;
609
g_return_val_if_fail (list != NULL, NULL);
611
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
613
_tmp3_ = gtk_bin_get_child ((GtkBin*) _tmp2_);
614
_tmp4_ = _g_object_ref0 (GTK_IS_FIXED (_tmp3_) ? ((GtkFixed*) _tmp3_) : NULL);
616
_tmp5_ = gtk_container_get_children ((GtkContainer*) fixed);
618
_tmp7_ = g_list_nth_data (_tmp6_, (guint) 1);
619
_tmp8_ = _g_object_ref0 (GTK_IS_GRID ((GtkWidget*) _tmp7_) ? ((GtkGrid*) ((GtkWidget*) _tmp7_)) : NULL);
621
_g_list_free0 (_tmp6_);
623
_tmp10_ = gtk_grid_get_child_at (grid, 1, 3);
624
_tmp11_ = _g_object_ref0 (IS_DASH_ENTRY (_tmp10_) ? ((DashEntry*) _tmp10_) : NULL);
626
_g_object_unref0 (grid);
627
_g_object_unref0 (fixed);
632
static void test_do_scroll (TestList* list, GreeterListScrollTarget direction) {
633
GreeterListScrollTarget _tmp0_;
635
g_return_if_fail (list != NULL);
636
test_process_events ();
639
case GREETER_LIST_SCROLL_TARGET_START:
643
test_inject_key ((GtkWidget*) _tmp1_, GDK_KEY_Page_Up);
646
case GREETER_LIST_SCROLL_TARGET_END:
650
test_inject_key ((GtkWidget*) _tmp2_, GDK_KEY_Page_Down);
653
case GREETER_LIST_SCROLL_TARGET_UP:
657
test_inject_key ((GtkWidget*) _tmp3_, GDK_KEY_Up);
660
case GREETER_LIST_SCROLL_TARGET_DOWN:
664
test_inject_key ((GtkWidget*) _tmp4_, GDK_KEY_Down);
671
test_wait_for_scrolling_end (_tmp5_);
675
static void test_scroll_to_remote_login (TestList* list) {
677
g_return_if_fail (list != NULL);
679
test_do_scroll (_tmp0_, GREETER_LIST_SCROLL_TARGET_END);
688
_tmp2_ = greeter_list_get_selected_entry ((GreeterList*) _tmp1_);
690
_tmp4_ = prompt_box_get_id (_tmp3_);
692
if (!(g_strcmp0 (_tmp5_, "*guest") == 0)) {
696
test_do_scroll (_tmp6_, GREETER_LIST_SCROLL_TARGET_END);
697
test_process_events ();
698
usleep ((guint) 10000);
703
static void _vala_GdkEvent_free (GdkEvent* self) {
704
g_boxed_free (gdk_event_get_type (), self);
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;
714
GdkKeymapKey* _tmp2_ = NULL;
716
gboolean _tmp4_ = FALSE;
721
GdkWindow* _tmp7_ = NULL;
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 ();
732
_tmp4_ = gdk_keymap_get_entries_for_keyval (_tmp0_, (guint) _tmp1_, &_tmp2_, &_tmp3_);
733
keys = (g_free (keys), NULL);
735
keys_length1 = _tmp3_;
736
_keys_size_ = keys_length1;
739
_tmp5_ = gdk_event_new (GDK_KEY_PRESS);
742
_tmp7_ = gtk_widget_get_parent_window (_tmp6_);
743
event->key.window = _tmp7_;
745
_tmp9_ = _tmp8_.keycode;
746
event->key.hardware_keycode = (guint16) ((gint16) _tmp9_);
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);
760
static void test_wait_for_focus (GtkWidget* w) {
761
g_return_if_fail (w != NULL);
764
gboolean _tmp1_ = FALSE;
767
g_object_get (_tmp0_, "has-focus", &_tmp1_, NULL);
772
test_process_events ();
773
usleep ((guint) 10000);
778
void test_simple_navigation (void) {
779
MainWindow* _tmp0_ = NULL;
782
GreeterList* _tmp2_ = NULL;
791
const gchar* _tmp10_;
792
const gchar* _tmp11_;
795
const gchar* _tmp14_;
796
const gchar* _tmp15_;
799
const gchar* _tmp18_;
800
const gchar* _tmp19_;
801
_tmp0_ = test_setup ();
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);
812
_tmp6_ = prompt_box_get_id (_tmp5_);
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);
818
_tmp10_ = prompt_box_get_id (_tmp9_);
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);
824
_tmp14_ = prompt_box_get_id (_tmp13_);
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);
830
_tmp18_ = prompt_box_get_id (_tmp17_);
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);
839
void test_remote_login (void) {
840
MainWindow* _tmp0_ = NULL;
844
GreeterList* _tmp3_ = NULL;
860
gchar** _tmp18_ = NULL;
862
gint _tmp19__length1;
876
DashEntry* _tmp33_ = NULL;
879
DashEntry* _tmp35_ = NULL;
886
gchar** _tmp41_ = NULL;
888
gint _tmp42__length1;
897
const gchar* _tmp51_;
898
const gchar* _tmp52_;
901
DashEntry* _tmp62_ = NULL;
903
DashEntry* _tmp64_ = NULL;
909
gchar** _tmp70_ = NULL;
911
gint _tmp71__length1;
920
const gchar* _tmp80_;
921
const gchar* _tmp81_;
923
_tmp0_ = test_setup ();
926
_tmp2_ = _tmp1_->stack;
927
_tmp3_ = list_stack_top (_tmp2_);
928
list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
930
test_scroll_to_remote_login (_tmp4_);
932
_tmp6_ = greeter_list_get_selected_entry ((GreeterList*) _tmp5_);
934
_tmp8_ = prompt_box_get_id (_tmp7_);
936
g_assert (g_strcmp0 (_tmp9_, "*remote_directory*http://crazyurl.com") == 0);
938
_tmp11_ = greeter_list_get_selected_entry ((GreeterList*) _tmp10_);
940
_tmp13_ = prompt_box_get_has_errors (_tmp12_);
944
_tmp16_ = greeter_list_get_selected_entry ((GreeterList*) _tmp15_);
946
_tmp18_ = g_new0 (gchar*, 0 + 1);
949
g_signal_emit_by_name (_tmp17_, "respond", _tmp19_, 0);
950
_tmp19_ = (_vala_array_free (_tmp19_, _tmp19__length1, (GDestroyNotify) g_free), NULL);
952
_tmp21_ = greeter_list_get_selected_entry ((GreeterList*) _tmp20_);
954
_tmp23_ = prompt_box_get_has_errors (_tmp22_);
958
test_do_scroll (_tmp25_, GREETER_LIST_SCROLL_TARGET_START);
960
test_do_scroll (_tmp26_, GREETER_LIST_SCROLL_TARGET_END);
962
_tmp28_ = greeter_list_get_selected_entry ((GreeterList*) _tmp27_);
964
_tmp30_ = prompt_box_get_has_errors (_tmp29_);
968
_tmp33_ = test_remote_directory_entry_email_field (_tmp32_);
971
_tmp35_ = test_remote_directory_entry_password_field (_tmp34_);
974
gtk_entry_set_text ((GtkEntry*) _tmp36_, "a@canonical.com");
976
gtk_entry_set_text ((GtkEntry*) _tmp37_, "password");
978
_tmp39_ = greeter_list_get_selected_entry ((GreeterList*) _tmp38_);
980
_tmp41_ = g_new0 (gchar*, 0 + 1);
983
g_signal_emit_by_name (_tmp40_, "respond", _tmp42_, 0);
984
_tmp42_ = (_vala_array_free (_tmp42_, _tmp42__length1, (GDestroyNotify) g_free), NULL);
986
_tmp44_ = greeter_list_get_selected_entry ((GreeterList*) _tmp43_);
988
_tmp46_ = prompt_box_get_has_errors (_tmp45_);
992
_tmp49_ = greeter_list_get_selected_entry ((GreeterList*) _tmp48_);
994
_tmp51_ = prompt_box_get_id (_tmp50_);
996
g_assert (g_strcmp0 (_tmp52_, "*remote_login*http://rdpdefaultusername2.com") == 0);
998
test_wait_for_scrolling_end (_tmp53_);
1003
const gchar* _tmp57_;
1004
const gchar* _tmp58_;
1005
gboolean _tmp59_ = FALSE;
1008
_tmp55_ = greeter_list_get_selected_entry ((GreeterList*) _tmp54_);
1010
_tmp57_ = prompt_box_get_id (_tmp56_);
1012
_tmp59_ = g_str_has_prefix (_tmp58_, "*remote_directory*http://crazyurl.com");
1017
test_do_scroll (_tmp60_, GREETER_LIST_SCROLL_TARGET_UP);
1020
_tmp62_ = test_remote_directory_entry_email_field (_tmp61_);
1021
_g_object_unref0 (email);
1024
_tmp64_ = test_remote_directory_entry_password_field (_tmp63_);
1025
_g_object_unref0 (pwd);
1028
gtk_entry_set_text ((GtkEntry*) _tmp65_, "a @ foobar");
1030
gtk_entry_set_text ((GtkEntry*) _tmp66_, "password");
1032
_tmp68_ = greeter_list_get_selected_entry ((GreeterList*) _tmp67_);
1034
_tmp70_ = g_new0 (gchar*, 0 + 1);
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);
1040
_tmp73_ = greeter_list_get_selected_entry ((GreeterList*) _tmp72_);
1042
_tmp75_ = prompt_box_get_has_errors (_tmp74_);
1046
_tmp78_ = greeter_list_get_selected_entry ((GreeterList*) _tmp77_);
1048
_tmp80_ = prompt_box_get_id (_tmp79_);
1050
g_assert (g_strcmp0 (_tmp81_, "*remote_directory*http://crazyurl.com") == 0);
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);
1060
static Block1Data* block1_data_ref (Block1Data* _data1_) {
1061
g_atomic_int_inc (&_data1_->_ref_count_);
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_);
1076
static gboolean __lambda34_ (Block1Data* _data1_) {
1077
gboolean result = FALSE;
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_);
1089
_tmp4_ = prompt_box_get_id (_tmp3_);
1091
g_assert (g_strcmp0 (_tmp5_, "*remote_directory*http://internalcompayserver.com") == 0);
1092
_data1_->done = TRUE;
1098
static gboolean ___lambda34__gsource_func (gpointer self) {
1100
result = __lambda34_ (self);
1105
void test_remote_login_servers_updated_signal (void) {
1106
Block1Data* _data1_;
1107
MainWindow* _tmp0_ = NULL;
1111
GreeterList* _tmp3_ = NULL;
1114
DashEntry* _tmp6_ = NULL;
1117
DashEntry* _tmp8_ = NULL;
1124
gchar** _tmp14_ = NULL;
1126
gint _tmp15__length1;
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 ();
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_);
1151
_tmp7_ = _data1_->list;
1152
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
1155
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
1157
gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay1");
1158
_tmp11_ = _data1_->list;
1159
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
1161
_tmp14_ = g_new0 (gchar*, 0 + 1);
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_);
1169
_tmp19_ = prompt_box_get_has_errors (_tmp18_);
1171
g_assert (!_tmp20_);
1172
_tmp21_ = _data1_->list;
1173
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
1175
_tmp24_ = prompt_box_get_id (_tmp23_);
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);
1182
_tmp26_ = _data1_->done;
1186
test_process_events ();
1187
usleep ((guint) 10000);
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_);
1199
static Block2Data* block2_data_ref (Block2Data* _data2_) {
1200
g_atomic_int_inc (&_data2_->_ref_count_);
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_);
1216
static gboolean __lambda35_ (Block2Data* _data2_) {
1217
gboolean result = FALSE;
1221
const gchar* _tmp3_;
1222
const gchar* _tmp4_;
1223
const gchar* _tmp5_;
1228
const gchar* _tmp10_;
1229
const gchar* _tmp11_;
1230
_tmp0_ = _data2_->list;
1231
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
1233
_tmp3_ = prompt_box_get_id (_tmp2_);
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_);
1242
_tmp10_ = prompt_box_get_id (_tmp9_);
1244
g_assert (g_strcmp0 (_tmp11_, "*remote_directory*http://internalcompayserver.com") == 0);
1245
_data2_->done = TRUE;
1251
static gboolean ___lambda35__gsource_func (gpointer self) {
1253
result = __lambda35_ (self);
1258
void test_remote_login_servers_updated_signal_focus_not_in_remote_server (void) {
1259
Block2Data* _data2_;
1260
MainWindow* _tmp0_ = NULL;
1264
GreeterList* _tmp3_ = NULL;
1267
DashEntry* _tmp6_ = NULL;
1270
DashEntry* _tmp8_ = NULL;
1277
gchar** _tmp14_ = NULL;
1279
gint _tmp15__length1;
1288
const gchar* _tmp24_;
1289
const gchar* _tmp25_;
1294
const gchar* _tmp37_;
1295
const gchar* _tmp38_;
1297
MainWindow* _tmp41_;
1298
_data2_ = g_slice_new0 (Block2Data);
1299
_data2_->_ref_count_ = 1;
1300
_tmp0_ = test_setup ();
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_);
1311
_tmp7_ = _data2_->list;
1312
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
1315
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
1317
gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay1");
1318
_tmp11_ = _data2_->list;
1319
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
1321
_tmp14_ = g_new0 (gchar*, 0 + 1);
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_);
1329
_tmp19_ = prompt_box_get_has_errors (_tmp18_);
1331
g_assert (!_tmp20_);
1332
_tmp21_ = _data2_->list;
1333
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
1335
_tmp24_ = prompt_box_get_id (_tmp23_);
1337
g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
1338
_tmp26_ = _data2_->list;
1339
test_wait_for_scrolling_end (_tmp26_);
1344
const gchar* _tmp30_;
1345
const gchar* _tmp31_;
1346
gboolean _tmp32_ = FALSE;
1348
_tmp27_ = _data2_->list;
1349
_tmp28_ = greeter_list_get_selected_entry ((GreeterList*) _tmp27_);
1351
_tmp30_ = prompt_box_get_id (_tmp29_);
1353
_tmp32_ = g_str_has_prefix (_tmp31_, "*remote_");
1357
_tmp33_ = _data2_->list;
1358
test_do_scroll (_tmp33_, GREETER_LIST_SCROLL_TARGET_UP);
1360
_tmp34_ = _data2_->list;
1361
_tmp35_ = greeter_list_get_selected_entry ((GreeterList*) _tmp34_);
1363
_tmp37_ = prompt_box_get_id (_tmp36_);
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);
1371
_tmp40_ = _data2_->done;
1375
test_process_events ();
1376
usleep ((guint) 10000);
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_);
1388
static Block3Data* block3_data_ref (Block3Data* _data3_) {
1389
g_atomic_int_inc (&_data3_->_ref_count_);
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_);
1404
static gboolean __lambda36_ (Block3Data* _data3_) {
1405
gboolean result = FALSE;
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_);
1417
_tmp4_ = prompt_box_get_id (_tmp3_);
1419
g_assert (g_strcmp0 (_tmp5_, "*remote_login*http://megacoolrdpserver.com") == 0);
1420
_data3_->done = TRUE;
1426
static gboolean ___lambda36__gsource_func (gpointer self) {
1428
result = __lambda36_ (self);
1433
void test_remote_login_login_servers_updated_signal (void) {
1434
Block3Data* _data3_;
1435
MainWindow* _tmp0_ = NULL;
1439
GreeterList* _tmp3_ = NULL;
1442
DashEntry* _tmp6_ = NULL;
1445
DashEntry* _tmp8_ = NULL;
1452
gchar** _tmp14_ = NULL;
1454
gint _tmp15__length1;
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 ();
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_);
1479
_tmp7_ = _data3_->list;
1480
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
1483
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
1485
gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay2");
1486
_tmp11_ = _data3_->list;
1487
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
1489
_tmp14_ = g_new0 (gchar*, 0 + 1);
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_);
1497
_tmp19_ = prompt_box_get_has_errors (_tmp18_);
1499
g_assert (!_tmp20_);
1500
_tmp21_ = _data3_->list;
1501
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
1503
_tmp24_ = prompt_box_get_id (_tmp23_);
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);
1510
_tmp26_ = _data3_->done;
1514
test_process_events ();
1515
usleep ((guint) 10000);
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_);
1527
static Block4Data* block4_data_ref (Block4Data* _data4_) {
1528
g_atomic_int_inc (&_data4_->_ref_count_);
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_);
1543
static gboolean __lambda37_ (Block4Data* _data4_) {
1544
gboolean result = FALSE;
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_);
1556
_tmp4_ = prompt_box_get_id (_tmp3_);
1558
g_assert (g_strcmp0 (_tmp5_, "*remote_login*http://coolrdpserver.com") == 0);
1559
_data4_->done = TRUE;
1565
static gboolean ___lambda37__gsource_func (gpointer self) {
1567
result = __lambda37_ (self);
1572
void test_remote_login_login_servers_updated_signal_focus_not_in_removed_server (void) {
1573
Block4Data* _data4_;
1574
MainWindow* _tmp0_ = NULL;
1578
GreeterList* _tmp3_ = NULL;
1581
DashEntry* _tmp6_ = NULL;
1584
DashEntry* _tmp8_ = NULL;
1591
gchar** _tmp14_ = NULL;
1593
gint _tmp15__length1;
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 ();
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_);
1618
_tmp7_ = _data4_->list;
1619
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
1622
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
1624
gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay2");
1625
_tmp11_ = _data4_->list;
1626
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
1628
_tmp14_ = g_new0 (gchar*, 0 + 1);
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_);
1636
_tmp19_ = prompt_box_get_has_errors (_tmp18_);
1638
g_assert (!_tmp20_);
1639
_tmp21_ = _data4_->list;
1640
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
1642
_tmp24_ = prompt_box_get_id (_tmp23_);
1644
g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
1649
const gchar* _tmp29_;
1650
const gchar* _tmp30_;
1652
_tmp26_ = _data4_->list;
1653
_tmp27_ = greeter_list_get_selected_entry ((GreeterList*) _tmp26_);
1655
_tmp29_ = prompt_box_get_id (_tmp28_);
1657
if (!(g_strcmp0 (_tmp30_, "*remote_login*http://coolrdpserver.com") != 0)) {
1660
_tmp31_ = _data4_->list;
1661
test_do_scroll (_tmp31_, GREETER_LIST_SCROLL_TARGET_UP);
1663
_data4_->done = FALSE;
1664
g_timeout_add_full (G_PRIORITY_DEFAULT, (guint) 5250, ___lambda37__gsource_func, block4_data_ref (_data4_), block4_data_unref);
1667
_tmp32_ = _data4_->done;
1671
test_process_events ();
1672
usleep ((guint) 10000);
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_);
1684
static Block5Data* block5_data_ref (Block5Data* _data5_) {
1685
g_atomic_int_inc (&_data5_->_ref_count_);
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_);
1700
static gboolean __lambda38_ (Block5Data* _data5_) {
1701
gboolean result = FALSE;
1706
const gchar* _tmp4_;
1707
const gchar* _tmp5_;
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_);
1719
_tmp4_ = prompt_box_get_id (_tmp3_);
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_);
1727
_tmp10_ = prompt_box_get_id (_tmp9_);
1729
g_assert (g_strcmp0 (_tmp11_, "*remote_directory*http://crazyurl.com") == 0);
1730
_data5_->done = TRUE;
1736
static gboolean ___lambda38__gsource_func (gpointer self) {
1738
result = __lambda38_ (self);
1743
void test_remote_login_remote_login_changed_signal (void) {
1744
Block5Data* _data5_;
1745
MainWindow* _tmp0_ = NULL;
1749
GreeterList* _tmp3_ = NULL;
1752
DashEntry* _tmp6_ = NULL;
1755
DashEntry* _tmp8_ = NULL;
1762
gchar** _tmp14_ = NULL;
1764
gint _tmp15__length1;
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 ();
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_);
1789
_tmp7_ = _data5_->list;
1790
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
1793
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
1795
gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay3");
1796
_tmp11_ = _data5_->list;
1797
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
1799
_tmp14_ = g_new0 (gchar*, 0 + 1);
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_);
1807
_tmp19_ = prompt_box_get_has_errors (_tmp18_);
1809
g_assert (!_tmp20_);
1810
_tmp21_ = _data5_->list;
1811
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
1813
_tmp24_ = prompt_box_get_id (_tmp23_);
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);
1820
_tmp26_ = _data5_->done;
1824
test_process_events ();
1825
usleep ((guint) 10000);
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_);
1837
static Block6Data* block6_data_ref (Block6Data* _data6_) {
1838
g_atomic_int_inc (&_data6_->_ref_count_);
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_);
1854
static gboolean __lambda39_ (Block6Data* _data6_) {
1855
gboolean result = FALSE;
1859
const gchar* _tmp3_;
1860
const gchar* _tmp4_;
1861
const gchar* _tmp5_;
1866
const gchar* _tmp10_;
1867
const gchar* _tmp11_;
1872
const gchar* _tmp16_;
1873
const gchar* _tmp17_;
1874
_tmp0_ = _data6_->list;
1875
_tmp1_ = greeter_list_get_selected_entry ((GreeterList*) _tmp0_);
1877
_tmp3_ = prompt_box_get_id (_tmp2_);
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_);
1886
_tmp10_ = prompt_box_get_id (_tmp9_);
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_);
1894
_tmp16_ = prompt_box_get_id (_tmp15_);
1896
g_assert (g_strcmp0 (_tmp17_, "*remote_directory*http://crazyurl.com") == 0);
1897
_data6_->done = TRUE;
1903
static gboolean ___lambda39__gsource_func (gpointer self) {
1905
result = __lambda39_ (self);
1910
void test_remote_login_remote_login_changed_signalfocus_not_in_changed_server (void) {
1911
Block6Data* _data6_;
1912
MainWindow* _tmp0_ = NULL;
1916
GreeterList* _tmp3_ = NULL;
1919
DashEntry* _tmp6_ = NULL;
1922
DashEntry* _tmp8_ = NULL;
1929
gchar** _tmp14_ = NULL;
1931
gint _tmp15__length1;
1940
const gchar* _tmp24_;
1941
const gchar* _tmp25_;
1946
const gchar* _tmp37_;
1947
const gchar* _tmp38_;
1949
MainWindow* _tmp41_;
1950
_data6_ = g_slice_new0 (Block6Data);
1951
_data6_->_ref_count_ = 1;
1952
_tmp0_ = test_setup ();
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_);
1963
_tmp7_ = _data6_->list;
1964
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
1967
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
1969
gtk_entry_set_text ((GtkEntry*) _tmp10_, "delay3");
1970
_tmp11_ = _data6_->list;
1971
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
1973
_tmp14_ = g_new0 (gchar*, 0 + 1);
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_);
1981
_tmp19_ = prompt_box_get_has_errors (_tmp18_);
1983
g_assert (!_tmp20_);
1984
_tmp21_ = _data6_->list;
1985
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) _tmp21_);
1987
_tmp24_ = prompt_box_get_id (_tmp23_);
1989
g_assert (g_strcmp0 (_tmp25_, "*remote_login*http://rdpdefaultusername2.com") == 0);
1990
_tmp26_ = _data6_->list;
1991
test_wait_for_scrolling_end (_tmp26_);
1996
const gchar* _tmp30_;
1997
const gchar* _tmp31_;
1998
gboolean _tmp32_ = FALSE;
2000
_tmp27_ = _data6_->list;
2001
_tmp28_ = greeter_list_get_selected_entry ((GreeterList*) _tmp27_);
2003
_tmp30_ = prompt_box_get_id (_tmp29_);
2005
_tmp32_ = g_str_has_prefix (_tmp31_, "*remote_");
2009
_tmp33_ = _data6_->list;
2010
test_do_scroll (_tmp33_, GREETER_LIST_SCROLL_TARGET_UP);
2012
_tmp34_ = _data6_->list;
2013
_tmp35_ = greeter_list_get_selected_entry ((GreeterList*) _tmp34_);
2015
_tmp37_ = prompt_box_get_id (_tmp36_);
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);
2023
_tmp40_ = _data6_->done;
2027
test_process_events ();
2028
usleep ((guint) 10000);
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_);
2040
void test_remote_login_authentication (void) {
2041
MainWindow* _tmp0_ = NULL;
2044
GreeterList* _tmp2_ = NULL;
2048
const gchar* _tmp5_;
2049
const gchar* _tmp6_;
2054
DashEntry* _tmp11_ = NULL;
2056
DashEntry* _tmp12_ = NULL;
2061
gchar** _tmp16_ = NULL;
2063
gint _tmp17__length1;
2070
const gchar* _tmp24_;
2071
const gchar* _tmp25_;
2072
UnityGreeter* _tmp26_;
2073
DashEntry* _tmp27_ = NULL;
2077
gchar** _tmp31_ = NULL;
2079
gint _tmp32__length1;
2080
UnityGreeter* _tmp33_;
2082
_tmp0_ = test_setup ();
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);
2090
_tmp5_ = prompt_box_get_id (_tmp4_);
2092
g_assert (g_strcmp0 (_tmp6_, "*remote_directory*http://crazyurl.com") == 0);
2093
_tmp7_ = greeter_list_get_selected_entry ((GreeterList*) list);
2095
_tmp9_ = prompt_box_get_has_errors (_tmp8_);
2097
g_assert (!_tmp10_);
2098
_tmp11_ = test_remote_directory_entry_email_field (list);
2100
_tmp12_ = test_remote_directory_entry_password_field (list);
2102
gtk_entry_set_text ((GtkEntry*) email, "a@canonical.com");
2104
gtk_entry_set_text ((GtkEntry*) _tmp13_, "password");
2105
_tmp14_ = greeter_list_get_selected_entry ((GreeterList*) list);
2107
_tmp16_ = g_new0 (gchar*, 0 + 1);
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);
2114
_tmp20_ = prompt_box_get_has_errors (_tmp19_);
2116
g_assert (!_tmp21_);
2117
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) list);
2119
_tmp24_ = prompt_box_get_id (_tmp23_);
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);
2129
gtk_entry_set_text ((GtkEntry*) _tmp28_, "password");
2130
_tmp29_ = greeter_list_get_selected_entry ((GreeterList*) list);
2132
_tmp31_ = g_new0 (gchar*, 0 + 1);
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;
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);
2148
void test_remote_login_cancel_authentication (void) {
2149
MainWindow* _tmp0_ = NULL;
2152
GreeterList* _tmp2_ = NULL;
2156
const gchar* _tmp5_;
2157
const gchar* _tmp6_;
2162
DashEntry* _tmp11_ = NULL;
2164
DashEntry* _tmp12_ = NULL;
2169
gchar** _tmp16_ = NULL;
2171
gint _tmp17__length1;
2178
const gchar* _tmp24_;
2179
const gchar* _tmp25_;
2180
UnityGreeter* _tmp26_;
2181
DashEntry* _tmp27_ = NULL;
2189
DashEntry* _tmp35_ = NULL;
2195
_tmp0_ = test_setup ();
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);
2203
_tmp5_ = prompt_box_get_id (_tmp4_);
2205
g_assert (g_strcmp0 (_tmp6_, "*remote_directory*http://crazyurl.com") == 0);
2206
_tmp7_ = greeter_list_get_selected_entry ((GreeterList*) list);
2208
_tmp9_ = prompt_box_get_has_errors (_tmp8_);
2210
g_assert (!_tmp10_);
2211
_tmp11_ = test_remote_directory_entry_email_field (list);
2213
_tmp12_ = test_remote_directory_entry_password_field (list);
2215
gtk_entry_set_text ((GtkEntry*) email, "a@canonical.com");
2217
gtk_entry_set_text ((GtkEntry*) _tmp13_, "password");
2218
_tmp14_ = greeter_list_get_selected_entry ((GreeterList*) list);
2220
_tmp16_ = g_new0 (gchar*, 0 + 1);
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);
2227
_tmp20_ = prompt_box_get_has_errors (_tmp19_);
2229
g_assert (!_tmp21_);
2230
_tmp22_ = greeter_list_get_selected_entry ((GreeterList*) list);
2232
_tmp24_ = prompt_box_get_id (_tmp23_);
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);
2242
gtk_entry_set_text ((GtkEntry*) _tmp28_, "delay");
2244
g_signal_emit_by_name ((GtkEntry*) _tmp29_, "activate");
2245
_tmp30_ = gtk_widget_get_sensitive ((GtkWidget*) list);
2247
g_assert (!_tmp31_);
2249
_tmp33_ = dash_entry_get_did_respond (_tmp32_);
2252
greeter_list_cancel_authentication ((GreeterList*) list);
2253
_tmp35_ = test_remote_login_entry_password_field (list);
2254
_g_object_unref0 (pwd);
2256
_tmp36_ = gtk_widget_get_sensitive ((GtkWidget*) list);
2260
_tmp39_ = dash_entry_get_did_respond (_tmp38_);
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);
2271
void test_email_autocomplete (void) {
2272
MainWindow* _tmp0_ = NULL;
2275
GreeterList* _tmp2_ = NULL;
2277
DashEntry* _tmp3_ = NULL;
2279
const gchar* _tmp4_;
2280
const gchar* _tmp5_;
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 ();
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);
2313
test_wait_for_focus ((GtkWidget*) email);
2314
_tmp4_ = gtk_entry_get_text ((GtkEntry*) email);
2316
_tmp6_ = strlen (_tmp5_);
2318
g_assert (_tmp7_ == 0);
2319
test_inject_key ((GtkWidget*) email, GDK_KEY_a);
2320
_tmp8_ = gtk_entry_get_text ((GtkEntry*) email);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
2370
void test_greeter_communcation (void) {
2371
MainWindow* _tmp0_ = NULL;
2375
GreeterList* _tmp3_ = NULL;
2379
DashEntry* _tmp6_ = NULL;
2382
DashEntry* _tmp8_ = NULL;
2389
gchar** _tmp14_ = NULL;
2391
gint _tmp15__length1;
2394
DashEntry* _tmp24_ = NULL;
2397
DashEntry* _tmp26_ = NULL;
2398
DashEntry* username;
2400
DashEntry* _tmp28_ = NULL;
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_;
2419
const gchar* _tmp47_;
2420
const gchar* _tmp48_;
2421
MainWindow* _tmp49_;
2422
_tmp0_ = test_setup ();
2425
_tmp2_ = _tmp1_->stack;
2426
_tmp3_ = list_stack_top (_tmp2_);
2427
list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
2429
test_scroll_to_remote_login (_tmp4_);
2431
_tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
2434
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
2437
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
2439
gtk_entry_set_text ((GtkEntry*) _tmp10_, "password");
2441
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
2443
_tmp14_ = g_new0 (gchar*, 0 + 1);
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);
2449
test_wait_for_scrolling_end (_tmp16_);
2454
const gchar* _tmp20_;
2455
const gchar* _tmp21_;
2458
_tmp18_ = greeter_list_get_selected_entry ((GreeterList*) _tmp17_);
2460
_tmp20_ = prompt_box_get_id (_tmp19_);
2462
if (!(g_strcmp0 (_tmp21_, "*remote_login*http://coolrdpserver.com") != 0)) {
2466
test_do_scroll (_tmp22_, GREETER_LIST_SCROLL_TARGET_UP);
2469
_tmp24_ = test_remote_login_entry_domain_field (_tmp23_);
2472
_tmp26_ = test_remote_login_entry_username_field (_tmp25_);
2475
_tmp28_ = test_remote_login_entry_password_field (_tmp27_);
2476
_g_object_unref0 (pwd);
2478
gtk_entry_set_text ((GtkEntry*) domain, "foo");
2479
gtk_entry_set_text ((GtkEntry*) username, "bar");
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);
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);
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;
2506
_tmp47_ = gtk_entry_get_text ((GtkEntry*) _tmp46_);
2508
g_assert (g_strcmp0 (_tmp45_, _tmp48_) == 0);
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);
2520
void test_unsupported_server_type (void) {
2521
MainWindow* _tmp0_ = NULL;
2525
GreeterList* _tmp3_ = NULL;
2529
DashEntry* _tmp6_ = NULL;
2532
DashEntry* _tmp8_ = NULL;
2539
gchar** _tmp14_ = NULL;
2541
gint _tmp15__length1;
2553
MainWindow* _tmp33_;
2554
_tmp0_ = test_setup ();
2557
_tmp2_ = _tmp1_->stack;
2558
_tmp3_ = list_stack_top (_tmp2_);
2559
list = IS_TEST_LIST (_tmp3_) ? ((TestList*) _tmp3_) : NULL;
2561
test_scroll_to_remote_login (_tmp4_);
2563
_tmp6_ = test_remote_directory_entry_email_field (_tmp5_);
2566
_tmp8_ = test_remote_directory_entry_password_field (_tmp7_);
2569
gtk_entry_set_text ((GtkEntry*) _tmp9_, "a@canonical.com");
2571
gtk_entry_set_text ((GtkEntry*) _tmp10_, "password");
2573
_tmp12_ = greeter_list_get_selected_entry ((GreeterList*) _tmp11_);
2575
_tmp14_ = g_new0 (gchar*, 0 + 1);
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);
2581
test_wait_for_scrolling_end (_tmp16_);
2586
const gchar* _tmp20_;
2587
const gchar* _tmp21_;
2590
_tmp18_ = greeter_list_get_selected_entry ((GreeterList*) _tmp17_);
2592
_tmp20_ = prompt_box_get_id (_tmp19_);
2594
if (!(g_strcmp0 (_tmp21_, "*remote_login*http://notsupportedserver.com") != 0)) {
2598
test_do_scroll (_tmp22_, GREETER_LIST_SCROLL_TARGET_UP);
2601
_tmp24_ = greeter_list_get_selected_entry ((GreeterList*) _tmp23_);
2603
_tmp26_ = prompt_box_get_has_errors (_tmp25_);
2607
_tmp29_ = greeter_list_get_selected_entry ((GreeterList*) _tmp28_);
2609
_tmp31_ = gtk_widget_get_sensitive ((GtkWidget*) _tmp30_);
2611
g_assert (!_tmp32_);
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);
2621
static void test_setup_gsettings (void) {
2622
GError * _inner_error_ = NULL;
2624
gchar* _tmp0_ = NULL;
2626
gchar* _tmp1_ = NULL;
2628
const gchar* _tmp2_;
2629
const gchar* _tmp3_ = NULL;
2632
gchar* _tmp5_ = NULL;
2634
const gchar* _tmp7_;
2635
gchar* _tmp8_ = NULL;
2637
const gchar* _tmp10_;
2638
gchar* _tmp11_ = NULL;
2642
const gchar* _tmp16_;
2643
gchar* _tmp17_ = NULL;
2647
_tmp0_ = g_dir_make_tmp ("unity-greeter-test-XXXXXX", &_inner_error_);
2649
if (_inner_error_ != NULL) {
2650
goto __catch0_g_error;
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_);
2659
_tmp5_ = g_build_filename (dir, "share", NULL);
2662
_tmp8_ = g_strdup_printf ("%s:%s", _tmp6_, _tmp7_);
2664
g_setenv ("XDG_DATA_DIRS", _tmp9_, TRUE);
2667
_tmp10_ = schema_dir;
2668
_tmp11_ = g_strdup_printf ("cp ../data/com.canonical.unity-greeter.gschema.xml %s", _tmp10_);
2670
_tmp13_ = system (_tmp12_);
2671
_tmp14_ = _tmp13_ != 0;
2674
const gchar* _tmp15_;
2675
_tmp15_ = schema_dir;
2676
g_warning ("test.vala:651: Could not copy schema to %s", _tmp15_);
2678
_tmp16_ = schema_dir;
2679
_tmp17_ = g_strdup_printf ("glib-compile-schemas %s", _tmp16_);
2681
_tmp19_ = system (_tmp18_);
2682
_tmp20_ = _tmp19_ != 0;
2685
const gchar* _tmp21_;
2686
_tmp21_ = schema_dir;
2687
g_warning ("test.vala:654: Could not compile schemas in %s", _tmp21_);
2689
g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
2690
_g_free0 (data_dirs);
2691
_g_free0 (schema_dir);
2699
const gchar* _tmp23_;
2701
_inner_error_ = NULL;
2703
_tmp23_ = _tmp22_->message;
2704
g_debug ("test.vala:660: Error setting up gsettings: %s", _tmp23_);
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_);
2716
static void _test_simple_navigation_gcallback (void) {
2717
test_simple_navigation ();
2721
static void _test_remote_login_gcallback (void) {
2722
test_remote_login ();
2726
static void _test_remote_login_servers_updated_signal_gcallback (void) {
2727
test_remote_login_servers_updated_signal ();
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 ();
2736
static void _test_remote_login_login_servers_updated_signal_gcallback (void) {
2737
test_remote_login_login_servers_updated_signal ();
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 ();
2746
static void _test_remote_login_remote_login_changed_signal_gcallback (void) {
2747
test_remote_login_remote_login_changed_signal ();
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 ();
2756
static void _test_remote_login_authentication_gcallback (void) {
2757
test_remote_login_authentication ();
2761
static void _test_remote_login_cancel_authentication_gcallback (void) {
2762
test_remote_login_cancel_authentication ();
2766
static void _test_email_autocomplete_gcallback (void) {
2767
test_email_autocomplete ();
2771
static void _test_greeter_communcation_gcallback (void) {
2772
test_greeter_communcation ();
2776
static void _test_unsupported_server_type_gcallback (void) {
2777
test_unsupported_server_type ();
2781
gint test_main (gchar** args, int args_length1) {
2783
UnityGreeter* _tmp0_;
2784
UnityGreeter* _tmp1_;
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 ();
2814
int main (int argc, char ** argv) {
2816
return test_main (argv, argc);
2820
Test* test_construct (GType object_type) {
2822
self = (Test*) g_type_create_instance (object_type);
2827
Test* test_new (void) {
2828
return test_construct (TYPE_TEST);
2832
static void value_test_init (GValue* value) {
2833
value->data[0].v_pointer = NULL;
2837
static void value_test_free_value (GValue* value) {
2838
if (value->data[0].v_pointer) {
2839
test_unref (value->data[0].v_pointer);
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);
2848
dest_value->data[0].v_pointer = NULL;
2853
static gpointer value_test_peek_pointer (const GValue* value) {
2854
return value->data[0].v_pointer;
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) {
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);
2867
value->data[0].v_pointer = test_ref (object);
2869
value->data[0].v_pointer = NULL;
2875
static gchar* value_test_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
2877
object_p = collect_values[0].v_pointer;
2879
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
2881
if (!value->data[0].v_pointer) {
2883
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
2884
*object_p = value->data[0].v_pointer;
2886
*object_p = test_ref (value->data[0].v_pointer);
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);
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;
2907
void value_set_test (GValue* value, gpointer v_object) {
2909
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST));
2910
old = value->data[0].v_pointer;
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);
2917
value->data[0].v_pointer = NULL;
2925
void value_take_test (GValue* value, gpointer v_object) {
2927
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_TEST));
2928
old = value->data[0].v_pointer;
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;
2934
value->data[0].v_pointer = NULL;
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;
2948
static void test_instance_init (Test * self) {
2949
self->ref_count = 1;
2953
static void test_finalize (Test* obj) {
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) };
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);
2969
return test_type_id__volatile;
2973
gpointer test_ref (gpointer instance) {
2976
g_atomic_int_inc (&self->ref_count);
2981
void test_unref (gpointer 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);
2991
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
2992
if ((array != NULL) && (destroy_func != NULL)) {
2994
for (i = 0; i < array_length; i = i + 1) {
2995
if (((gpointer*) array)[i] != NULL) {
2996
destroy_func (((gpointer*) array)[i]);
3003
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
3004
_vala_array_destroy (array, array_length, destroy_func);