~om26er/ubuntu/oneiric/unity/sru-778256

« back to all changes in this revision

Viewing changes to tests/unit/TestPanelService.cpp

Update formatting to match style (as close as possible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
#define TEST_TYPE_OBJECT (test_object_get_type ())
30
30
 
31
31
#define TEST_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
32
 
        TEST_TYPE_OBJECT, TestObject))
 
32
  TEST_TYPE_OBJECT, TestObject))
33
33
 
34
34
#define TEST_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass),\
35
 
        TEST_TYPE_OBJECT, TestObjectClass))
 
35
  TEST_TYPE_OBJECT, TestObjectClass))
36
36
 
37
37
#define TEST_IS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
38
 
        TEST_TYPE_OBJECT))
 
38
  TEST_TYPE_OBJECT))
39
39
 
40
40
#define TEST_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
41
 
        TEST_TYPE_OBJECT))
 
41
  TEST_TYPE_OBJECT))
42
42
 
43
43
#define TEST_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
44
 
        TEST_TYPE_OBJECT, TestObjectClass))
 
44
  TEST_TYPE_OBJECT, TestObjectClass))
45
45
 
46
46
typedef struct _TestObject        TestObject;
47
47
typedef struct _TestObjectClass   TestObjectClass;
50
50
{
51
51
  IndicatorObject parent;
52
52
 
53
 
  GList *entries;
 
53
  GList* entries;
54
54
};
55
55
 
56
56
struct _TestObjectClass
58
58
  IndicatorObjectClass parent_class;
59
59
};
60
60
 
61
 
GType             test_object_get_type (void) G_GNUC_CONST;
62
 
 
63
 
IndicatorObject      * test_object_new       ();
64
 
 
65
 
IndicatorObjectEntry * test_object_add_entry (TestObject  *self,
66
 
                                              const gchar *label,
67
 
                                              const gchar *icon_name);
 
61
GType             test_object_get_type(void) G_GNUC_CONST;
 
62
 
 
63
IndicatorObject*       test_object_new();
 
64
 
 
65
IndicatorObjectEntry* test_object_add_entry(TestObject*  self,
 
66
                                            const gchar* label,
 
67
                                            const gchar* icon_name);
68
68
 
69
69
//--- .c
70
70
 
71
 
G_DEFINE_TYPE (TestObject, test_object, INDICATOR_OBJECT_TYPE);
 
71
G_DEFINE_TYPE(TestObject, test_object, INDICATOR_OBJECT_TYPE);
72
72
 
73
73
void
74
 
test_object_dispose (GObject *object)
 
74
test_object_dispose(GObject* object)
75
75
{
76
 
  TestObject *self = TEST_OBJECT (object);
 
76
  TestObject* self = TEST_OBJECT(object);
77
77
 
78
 
  GList *e;
 
78
  GList* e;
79
79
  for (e = self->entries; e; e = e->next)
80
 
    {
81
 
      g_slice_free (IndicatorObjectEntry, e->data);
82
 
    }
83
 
  g_list_free (self->entries);
 
80
  {
 
81
    g_slice_free(IndicatorObjectEntry, e->data);
 
82
  }
 
83
  g_list_free(self->entries);
84
84
  self->entries = NULL;
85
85
 
86
 
  G_OBJECT_CLASS (test_object_parent_class)->dispose (object);
 
86
  G_OBJECT_CLASS(test_object_parent_class)->dispose(object);
87
87
}
88
88
 
89
 
GList *
90
 
test_object_get_entries (IndicatorObject *io)
 
89
GList*
 
90
test_object_get_entries(IndicatorObject* io)
91
91
{
92
 
  g_return_val_if_fail (TEST_IS_OBJECT (io), NULL);
 
92
  g_return_val_if_fail(TEST_IS_OBJECT(io), NULL);
93
93
 
94
 
  return g_list_copy (TEST_OBJECT (io)->entries);
 
94
  return g_list_copy(TEST_OBJECT(io)->entries);
95
95
}
96
96
 
97
97
guint
98
 
test_object_get_location (IndicatorObject      *io,
99
 
                          IndicatorObjectEntry *entry)
100
 
{
101
 
  g_return_val_if_fail (TEST_IS_OBJECT (io), 0);
102
 
 
103
 
  return g_list_index (TEST_OBJECT (io)->entries, entry);
104
 
}
105
 
 
106
 
void
107
 
test_object_entry_activate (IndicatorObject      *io,
108
 
                            IndicatorObjectEntry *entry,
109
 
                            guint                 timestamp)
110
 
{
111
 
 
112
 
}
113
 
 
114
 
void
115
 
test_object_class_init (TestObjectClass *klass)
116
 
{
117
 
  GObjectClass         *obj_class = G_OBJECT_CLASS (klass);
118
 
  IndicatorObjectClass *ind_class = INDICATOR_OBJECT_CLASS (klass);
 
98
test_object_get_location(IndicatorObject*      io,
 
99
                         IndicatorObjectEntry* entry)
 
100
{
 
101
  g_return_val_if_fail(TEST_IS_OBJECT(io), 0);
 
102
 
 
103
  return g_list_index(TEST_OBJECT(io)->entries, entry);
 
104
}
 
105
 
 
106
void
 
107
test_object_entry_activate(IndicatorObject*      io,
 
108
                           IndicatorObjectEntry* entry,
 
109
                           guint                 timestamp)
 
110
{
 
111
 
 
112
}
 
113
 
 
114
void
 
115
test_object_class_init(TestObjectClass* klass)
 
116
{
 
117
  GObjectClass*         obj_class = G_OBJECT_CLASS(klass);
 
118
  IndicatorObjectClass* ind_class = INDICATOR_OBJECT_CLASS(klass);
119
119
 
120
120
  obj_class->dispose = test_object_dispose;
121
121
 
125
125
}
126
126
 
127
127
void
128
 
test_object_init (TestObject *self)
129
 
{
130
 
 
131
 
}
132
 
 
133
 
IndicatorObject *
134
 
test_object_new ()
135
 
{
136
 
  return (IndicatorObject *)g_object_new (TEST_TYPE_OBJECT, NULL);
137
 
}
138
 
 
139
 
IndicatorObjectEntry *
140
 
test_object_add_entry (TestObject  *self,
141
 
                       const gchar *label,
142
 
                       const gchar *icon_name)
143
 
{
144
 
  IndicatorObjectEntry *entry;
145
 
  g_return_val_if_fail (TEST_IS_OBJECT (self), NULL);
146
 
 
147
 
  entry = g_slice_new0 (IndicatorObjectEntry);
148
 
  entry->label = (GtkLabel *)gtk_label_new (label);
149
 
  entry->image = icon_name ? (GtkImage *)gtk_image_new_from_icon_name (icon_name,
150
 
                                                                       GTK_ICON_SIZE_MENU) : NULL;
 
128
test_object_init(TestObject* self)
 
129
{
 
130
 
 
131
}
 
132
 
 
133
IndicatorObject*
 
134
test_object_new()
 
135
{
 
136
  return (IndicatorObject*)g_object_new(TEST_TYPE_OBJECT, NULL);
 
137
}
 
138
 
 
139
IndicatorObjectEntry*
 
140
test_object_add_entry(TestObject*  self,
 
141
                      const gchar* label,
 
142
                      const gchar* icon_name)
 
143
{
 
144
  IndicatorObjectEntry* entry;
 
145
  g_return_val_if_fail(TEST_IS_OBJECT(self), NULL);
 
146
 
 
147
  entry = g_slice_new0(IndicatorObjectEntry);
 
148
  entry->label = (GtkLabel*)gtk_label_new(label);
 
149
  entry->image = icon_name ? (GtkImage*)gtk_image_new_from_icon_name(icon_name,
 
150
                                                                     GTK_ICON_SIZE_MENU) : NULL;
151
151
  entry->menu = NULL;
152
152
 
153
 
  self->entries = g_list_append (self->entries, entry);
 
153
  self->entries = g_list_append(self->entries, entry);
154
154
 
155
 
  g_signal_emit (self, INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED_ID, 0, entry, TRUE);
 
155
  g_signal_emit(self, INDICATOR_OBJECT_SIGNAL_ENTRY_ADDED_ID, 0, entry, TRUE);
156
156
 
157
157
  return entry;
158
158
}
159
159
 
160
160
void
161
 
test_object_show_entry (TestObject           *self,
162
 
                        IndicatorObjectEntry *entry,
163
 
                        guint                 timestamp)
 
161
test_object_show_entry(TestObject*           self,
 
162
                       IndicatorObjectEntry* entry,
 
163
                       guint                 timestamp)
164
164
{
165
 
  g_signal_emit (self, INDICATOR_OBJECT_SIGNAL_MENU_SHOW_ID, 0, entry, timestamp);
 
165
  g_signal_emit(self, INDICATOR_OBJECT_SIGNAL_MENU_SHOW_ID, 0, entry, timestamp);
166
166
}
167
167
 
168
168
//----------------------- /TESTING INDICATOR STUFF ----------------------------
170
170
//------------------------ USEFUL FUNCTIONS -----------------------------------
171
171
 
172
172
guint
173
 
get_n_indicators_in_result (GVariant *result)
 
173
get_n_indicators_in_result(GVariant* result)
174
174
{
175
175
  guint  ret = 0;
176
 
  gchar *current_object_id = NULL;
177
 
  GVariantIter *iter;
178
 
  gchar        *indicator_id;
179
 
  gchar        *entry_id;
180
 
  gchar        *label;
 
176
  gchar* current_object_id = NULL;
 
177
  GVariantIter* iter;
 
178
  gchar*        indicator_id;
 
179
  gchar*        entry_id;
 
180
  gchar*        label;
181
181
  gboolean      label_sensitive;
182
182
  gboolean      label_visible;
183
183
  guint32       image_type;
184
 
  gchar        *image_data;
 
184
  gchar*        image_data;
185
185
  gboolean      image_sensitive;
186
186
  gboolean      image_visible;
187
187
 
188
 
  g_variant_get (result, "(a(sssbbusbb))", &iter);
189
 
  while (g_variant_iter_loop (iter, "(sssbbusbb)",
190
 
                              &indicator_id,
191
 
                              &entry_id,
192
 
                              &label,
193
 
                              &label_sensitive,
194
 
                              &label_visible,
195
 
                              &image_type,
196
 
                              &image_data,
197
 
                              &image_sensitive,
198
 
                              &image_visible))
 
188
  g_variant_get(result, "(a(sssbbusbb))", &iter);
 
189
  while (g_variant_iter_loop(iter, "(sssbbusbb)",
 
190
                             &indicator_id,
 
191
                             &entry_id,
 
192
                             &label,
 
193
                             &label_sensitive,
 
194
                             &label_visible,
 
195
                             &image_type,
 
196
                             &image_data,
 
197
                             &image_sensitive,
 
198
                             &image_visible))
 
199
  {
 
200
    if (g_strcmp0(current_object_id, indicator_id) != 0)
199
201
    {
200
 
      if (g_strcmp0 (current_object_id, indicator_id) != 0)
201
 
        {
202
 
          ret++;
203
 
          g_free (current_object_id);
204
 
          current_object_id = g_strdup (indicator_id);
205
 
        }
 
202
      ret++;
 
203
      g_free(current_object_id);
 
204
      current_object_id = g_strdup(indicator_id);
206
205
    }
207
 
  g_free (current_object_id);
 
206
  }
 
207
  g_free(current_object_id);
208
208
 
209
209
  return ret;
210
210
}
211
211
 
212
212
guint
213
 
get_n_entries_in_result (GVariant *result)
 
213
get_n_entries_in_result(GVariant* result)
214
214
{
215
215
  guint  ret = 0;
216
 
  GVariantIter *iter;
217
 
  gchar        *indicator_id;
218
 
  gchar        *entry_id;
219
 
  gchar        *label;
 
216
  GVariantIter* iter;
 
217
  gchar*        indicator_id;
 
218
  gchar*        entry_id;
 
219
  gchar*        label;
220
220
  gboolean      label_sensitive;
221
221
  gboolean      label_visible;
222
222
  guint32       image_type;
223
 
  gchar        *image_data;
 
223
  gchar*        image_data;
224
224
  gboolean      image_sensitive;
225
225
  gboolean      image_visible;
226
226
 
227
 
  g_variant_get (result, "(a(sssbbusbb))", &iter);
228
 
  while (g_variant_iter_loop (iter, "(sssbbusbb)",
229
 
                              &indicator_id,
230
 
                              &entry_id,
231
 
                              &label,
232
 
                              &label_sensitive,
233
 
                              &label_visible,
234
 
                              &image_type,
235
 
                              &image_data,
236
 
                              &image_sensitive,
237
 
                              &image_visible))
238
 
    {
239
 
      if (g_strcmp0 (entry_id, "") != 0)
240
 
        ret++;
241
 
    }
 
227
  g_variant_get(result, "(a(sssbbusbb))", &iter);
 
228
  while (g_variant_iter_loop(iter, "(sssbbusbb)",
 
229
                             &indicator_id,
 
230
                             &entry_id,
 
231
                             &label,
 
232
                             &label_sensitive,
 
233
                             &label_visible,
 
234
                             &image_type,
 
235
                             &image_data,
 
236
                             &image_sensitive,
 
237
                             &image_visible))
 
238
  {
 
239
    if (g_strcmp0(entry_id, "") != 0)
 
240
      ret++;
 
241
  }
242
242
 
243
243
  return ret;
244
244
}
247
247
 
248
248
//------------------------ /USEFUL FUNCTIONS ----------------------------------
249
249
 
250
 
static void TestAllocation           (void);
251
 
static void TestIndicatorLoading     (void);
252
 
static void TestEmptyIndicatorObject (void);
253
 
static void TestEntryAddition        (void);
254
 
static void TestEntryActivateRequest (void);
 
250
static void TestAllocation(void);
 
251
static void TestIndicatorLoading(void);
 
252
static void TestEmptyIndicatorObject(void);
 
253
static void TestEntryAddition(void);
 
254
static void TestEntryActivateRequest(void);
255
255
 
256
256
void
257
 
TestPanelServiceCreateSuite ()
 
257
TestPanelServiceCreateSuite()
258
258
{
259
259
#define _DOMAIN "/Unit/PanelService"
260
260
 
261
 
  g_test_add_func (_DOMAIN"/Allocation", TestAllocation);
262
 
  g_test_add_func (_DOMAIN"/IndicatorLoading", TestIndicatorLoading);
263
 
  g_test_add_func (_DOMAIN"/EmptyIndicatorObject", TestEmptyIndicatorObject);
264
 
  g_test_add_func (_DOMAIN"/EntryAddition", TestEntryAddition);
265
 
  g_test_add_func (_DOMAIN"/EntryActivateRequest", TestEntryActivateRequest);
266
 
}
267
 
 
268
 
static void
269
 
TestAllocation ()
270
 
{
271
 
  PanelService *service;
272
 
 
273
 
  service = panel_service_get_default ();
274
 
  g_assert (PANEL_IS_SERVICE (service));
275
 
 
276
 
  g_object_unref (service);
277
 
  g_assert (PANEL_IS_SERVICE (service) == FALSE);
278
 
}
279
 
 
280
 
static void
281
 
TestIndicatorLoading ()
282
 
{
283
 
  PanelService    *service;
284
 
  IndicatorObject *object;
285
 
  GList           *objects = NULL;
286
 
 
287
 
  object = test_object_new ();
288
 
  g_assert (INDICATOR_IS_OBJECT (object));
289
 
  objects = g_list_append (objects, object);
290
 
 
291
 
  service = panel_service_get_default_with_indicators (objects);
292
 
  g_assert (PANEL_IS_SERVICE (service));
293
 
 
294
 
  g_assert_cmpint (panel_service_get_n_indicators (service), ==, 1);
295
 
 
296
 
  g_list_free (objects);
297
 
  g_object_unref (object);
298
 
  g_object_unref (service);
299
 
}
300
 
 
301
 
static void
302
 
TestEmptyIndicatorObject ()
303
 
{
304
 
  PanelService    *service;
305
 
  IndicatorObject *object;
306
 
  GList           *objects = NULL;
307
 
  GVariant        *result;
308
 
 
309
 
  object = test_object_new ();
310
 
  g_assert (INDICATOR_IS_OBJECT (object));
311
 
  objects = g_list_append (objects, object);
312
 
 
313
 
  service = panel_service_get_default_with_indicators (objects);
314
 
  g_assert (PANEL_IS_SERVICE (service));
315
 
 
316
 
  g_assert_cmpint (panel_service_get_n_indicators (service), ==, 1);
317
 
 
318
 
  result = panel_service_sync (service);
319
 
  g_assert (result != NULL);
320
 
 
321
 
  g_assert_cmpint (get_n_indicators_in_result (result), ==, 1);
322
 
 
323
 
  g_variant_unref (result);
324
 
  g_list_free (objects);
325
 
  g_object_unref (object);
326
 
  g_object_unref (service);
327
 
}
328
 
 
329
 
static void
330
 
TestEntryAddition ()
331
 
{
332
 
  PanelService *service;
333
 
  TestObject   *object;
334
 
  GList        *objects = NULL;
335
 
  GVariant     *result;
 
261
  g_test_add_func(_DOMAIN"/Allocation", TestAllocation);
 
262
  g_test_add_func(_DOMAIN"/IndicatorLoading", TestIndicatorLoading);
 
263
  g_test_add_func(_DOMAIN"/EmptyIndicatorObject", TestEmptyIndicatorObject);
 
264
  g_test_add_func(_DOMAIN"/EntryAddition", TestEntryAddition);
 
265
  g_test_add_func(_DOMAIN"/EntryActivateRequest", TestEntryActivateRequest);
 
266
}
 
267
 
 
268
static void
 
269
TestAllocation()
 
270
{
 
271
  PanelService* service;
 
272
 
 
273
  service = panel_service_get_default();
 
274
  g_assert(PANEL_IS_SERVICE(service));
 
275
 
 
276
  g_object_unref(service);
 
277
  g_assert(PANEL_IS_SERVICE(service) == FALSE);
 
278
}
 
279
 
 
280
static void
 
281
TestIndicatorLoading()
 
282
{
 
283
  PanelService*    service;
 
284
  IndicatorObject* object;
 
285
  GList*           objects = NULL;
 
286
 
 
287
  object = test_object_new();
 
288
  g_assert(INDICATOR_IS_OBJECT(object));
 
289
  objects = g_list_append(objects, object);
 
290
 
 
291
  service = panel_service_get_default_with_indicators(objects);
 
292
  g_assert(PANEL_IS_SERVICE(service));
 
293
 
 
294
  g_assert_cmpint(panel_service_get_n_indicators(service), == , 1);
 
295
 
 
296
  g_list_free(objects);
 
297
  g_object_unref(object);
 
298
  g_object_unref(service);
 
299
}
 
300
 
 
301
static void
 
302
TestEmptyIndicatorObject()
 
303
{
 
304
  PanelService*    service;
 
305
  IndicatorObject* object;
 
306
  GList*           objects = NULL;
 
307
  GVariant*        result;
 
308
 
 
309
  object = test_object_new();
 
310
  g_assert(INDICATOR_IS_OBJECT(object));
 
311
  objects = g_list_append(objects, object);
 
312
 
 
313
  service = panel_service_get_default_with_indicators(objects);
 
314
  g_assert(PANEL_IS_SERVICE(service));
 
315
 
 
316
  g_assert_cmpint(panel_service_get_n_indicators(service), == , 1);
 
317
 
 
318
  result = panel_service_sync(service);
 
319
  g_assert(result != NULL);
 
320
 
 
321
  g_assert_cmpint(get_n_indicators_in_result(result), == , 1);
 
322
 
 
323
  g_variant_unref(result);
 
324
  g_list_free(objects);
 
325
  g_object_unref(object);
 
326
  g_object_unref(service);
 
327
}
 
328
 
 
329
static void
 
330
TestEntryAddition()
 
331
{
 
332
  PanelService* service;
 
333
  TestObject*   object;
 
334
  GList*        objects = NULL;
 
335
  GVariant*     result;
336
336
  int           i;
337
337
 
338
 
  object = (TestObject *)test_object_new ();
339
 
  test_object_add_entry (object, "Hello", "gtk-apply");
340
 
  g_assert (INDICATOR_IS_OBJECT (object));
341
 
  objects = g_list_append (objects, object);
342
 
 
343
 
  service = panel_service_get_default_with_indicators (objects);
344
 
  g_assert (PANEL_IS_SERVICE (service));
345
 
 
346
 
  result = panel_service_sync (service);
347
 
  g_assert (result != NULL);
348
 
  g_assert_cmpint (get_n_entries_in_result (result), ==, 1);
 
338
  object = (TestObject*)test_object_new();
 
339
  test_object_add_entry(object, "Hello", "gtk-apply");
 
340
  g_assert(INDICATOR_IS_OBJECT(object));
 
341
  objects = g_list_append(objects, object);
 
342
 
 
343
  service = panel_service_get_default_with_indicators(objects);
 
344
  g_assert(PANEL_IS_SERVICE(service));
 
345
 
 
346
  result = panel_service_sync(service);
 
347
  g_assert(result != NULL);
 
348
  g_assert_cmpint(get_n_entries_in_result(result), == , 1);
349
349
 
350
350
  for (i = 2; i < 10; i++)
351
 
    {
352
 
      g_variant_unref (result);
353
 
 
354
 
      test_object_add_entry (object, "Bye", "gtk-forward");
355
 
      result = panel_service_sync (service);
356
 
      g_assert_cmpint (get_n_entries_in_result (result), ==, i);
357
 
    }
358
 
 
359
 
  g_variant_unref (result);
360
 
  g_list_free (objects);
361
 
  g_object_unref (object);
362
 
  g_object_unref (service);
363
 
}
364
 
 
365
 
static void
366
 
OnEntryActivateRequest (IndicatorObject *object,
367
 
                        const gchar     *entry_id,
368
 
                        const gchar     *entry_id_should_be)
369
 
{
370
 
  g_assert_cmpstr (entry_id, ==, entry_id_should_be);
371
 
}
372
 
 
373
 
static void
374
 
TestEntryActivateRequest ()
375
 
{
376
 
  PanelService *service;
377
 
  TestObject   *object;
378
 
  GList        *objects = NULL;
379
 
  IndicatorObjectEntry *entry;
380
 
  gchar        *id;
381
 
  
382
 
  object = (TestObject *)test_object_new ();
383
 
  entry = test_object_add_entry (object, "Hello", "gtk-apply");
384
 
  id = g_strdup_printf ("%p", entry);
385
 
  g_assert (INDICATOR_IS_OBJECT (object));
386
 
  objects = g_list_append (objects, object);
387
 
 
388
 
  service = panel_service_get_default_with_indicators (objects);
389
 
  g_assert (PANEL_IS_SERVICE (service));
390
 
 
391
 
  g_signal_connect (service, "entry-activate-request",
392
 
                    G_CALLBACK (OnEntryActivateRequest),
393
 
                    id);
394
 
 
395
 
  test_object_show_entry (object, entry, 1234);
396
 
 
397
 
  g_free (id);
398
 
  g_list_free (objects);
399
 
  g_object_unref (object);
400
 
  g_object_unref (service);
 
351
  {
 
352
    g_variant_unref(result);
 
353
 
 
354
    test_object_add_entry(object, "Bye", "gtk-forward");
 
355
    result = panel_service_sync(service);
 
356
    g_assert_cmpint(get_n_entries_in_result(result), == , i);
 
357
  }
 
358
 
 
359
  g_variant_unref(result);
 
360
  g_list_free(objects);
 
361
  g_object_unref(object);
 
362
  g_object_unref(service);
 
363
}
 
364
 
 
365
static void
 
366
OnEntryActivateRequest(IndicatorObject* object,
 
367
                       const gchar*     entry_id,
 
368
                       const gchar*     entry_id_should_be)
 
369
{
 
370
  g_assert_cmpstr(entry_id, == , entry_id_should_be);
 
371
}
 
372
 
 
373
static void
 
374
TestEntryActivateRequest()
 
375
{
 
376
  PanelService* service;
 
377
  TestObject*   object;
 
378
  GList*        objects = NULL;
 
379
  IndicatorObjectEntry* entry;
 
380
  gchar*        id;
 
381
 
 
382
  object = (TestObject*)test_object_new();
 
383
  entry = test_object_add_entry(object, "Hello", "gtk-apply");
 
384
  id = g_strdup_printf("%p", entry);
 
385
  g_assert(INDICATOR_IS_OBJECT(object));
 
386
  objects = g_list_append(objects, object);
 
387
 
 
388
  service = panel_service_get_default_with_indicators(objects);
 
389
  g_assert(PANEL_IS_SERVICE(service));
 
390
 
 
391
  g_signal_connect(service, "entry-activate-request",
 
392
                   G_CALLBACK(OnEntryActivateRequest),
 
393
                   id);
 
394
 
 
395
  test_object_show_entry(object, entry, 1234);
 
396
 
 
397
  g_free(id);
 
398
  g_list_free(objects);
 
399
  g_object_unref(object);
 
400
  g_object_unref(service);
401
401
}