1360 | 1360 |
g_assert_cmpuint (chans->len, ==, 2);
|
1361 | 1361 |
g_assert_cmpstr (g_ptr_array_index (chans, 0), ==, "/chan1");
|
1362 | 1362 |
g_assert_cmpstr (g_ptr_array_index (chans, 1), ==, "/chan2");
|
|
1363 |
|
|
1364 |
strv = tp_asv_get_boxed (test->cd_service->last_request,
|
|
1365 |
TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS,
|
|
1366 |
G_TYPE_STRV);
|
|
1367 |
g_assert (strv != NULL);
|
|
1368 |
g_assert_cmpuint (g_strv_length ((GStrv) strv), ==, 2);
|
|
1369 |
g_assert (tp_strv_contains (strv, "badger@badger.com"));
|
|
1370 |
g_assert (tp_strv_contains (strv, "snake@badger.com"));
|
|
1371 |
}
|
|
1372 |
|
|
1373 |
static void
|
|
1374 |
test_initial_invitees (Test *test,
|
|
1375 |
gconstpointer data G_GNUC_UNUSED)
|
|
1376 |
{
|
|
1377 |
TpAccountChannelRequest *req;
|
|
1378 |
gboolean valid;
|
|
1379 |
GPtrArray *invitees;
|
|
1380 |
TpContact *contact;
|
|
1381 |
const gchar * const *strv;
|
|
1382 |
|
|
1383 |
req = tp_account_channel_request_new_text (test->account, 0);
|
|
1384 |
|
|
1385 |
invitees = g_ptr_array_new_with_free_func (g_object_unref);
|
|
1386 |
|
|
1387 |
contact = tp_tests_connection_run_until_contact_by_id (test->connection,
|
|
1388 |
"badger@badger.com", 0, NULL);
|
|
1389 |
g_ptr_array_add (invitees, contact);
|
|
1390 |
contact = tp_tests_connection_run_until_contact_by_id (test->connection,
|
|
1391 |
"snake@badger.com", 0, NULL);
|
|
1392 |
g_ptr_array_add (invitees, contact);
|
|
1393 |
|
|
1394 |
tp_account_channel_request_set_initial_invitees (req, invitees);
|
|
1395 |
g_ptr_array_unref (invitees);
|
|
1396 |
|
|
1397 |
/* Ask to the CR to fire the signal */
|
|
1398 |
tp_account_channel_request_set_request_property (req, "FireFailed",
|
|
1399 |
g_variant_new_boolean (TRUE));
|
|
1400 |
|
|
1401 |
tp_account_channel_request_create_and_handle_channel_async (req,
|
|
1402 |
NULL, create_and_handle_cb, test);
|
|
1403 |
|
|
1404 |
g_object_unref (req);
|
|
1405 |
|
|
1406 |
g_main_loop_run (test->mainloop);
|
|
1407 |
g_assert_error (test->error, TP_ERROR, TP_ERROR_INVALID_ARGUMENT);
|
|
1408 |
g_assert (test->channel == NULL);
|
|
1409 |
|
|
1410 |
/* The request had the properties we wanted */
|
|
1411 |
g_assert_cmpstr (tp_asv_get_string (test->cd_service->last_request,
|
|
1412 |
TP_PROP_CHANNEL_CHANNEL_TYPE), ==, TP_IFACE_CHANNEL_TYPE_TEXT);
|
|
1413 |
g_assert_cmpuint (tp_asv_get_uint32 (test->cd_service->last_request,
|
|
1414 |
TP_PROP_CHANNEL_TARGET_HANDLE_TYPE, &valid), ==, TP_HANDLE_TYPE_NONE);
|
|
1415 |
g_assert (valid);
|
|
1416 |
g_assert_cmpuint (tp_asv_get_boolean (test->cd_service->last_request,
|
|
1417 |
"FireFailed", NULL), ==, TRUE);
|
|
1418 |
g_assert_cmpuint (tp_asv_size (test->cd_service->last_request), ==, 4);
|
|
1419 |
g_assert_cmpuint (test->cd_service->last_user_action_time, ==, 0);
|
1363 | 1420 |
|
1364 | 1421 |
strv = tp_asv_get_boxed (test->cd_service->last_request,
|
1365 | 1422 |
TP_PROP_CHANNEL_INTERFACE_CONFERENCE_INITIAL_INVITEE_IDS,
|
|
1442 | 1499 |
setup, test_dbus_tube_props, teardown);
|
1443 | 1500 |
g_test_add ("/account-channels/test-no-handle-type", Test, NULL,
|
1444 | 1501 |
setup, test_no_handle_type, teardown);
|
|
1502 |
g_test_add ("/account-channels/test-initial-invitees", Test, NULL,
|
|
1503 |
setup, test_initial_invitees, teardown);
|
1445 | 1504 |
|
1446 | 1505 |
return tp_tests_run_with_bus ();
|
1447 | 1506 |
}
|