~josharenson/lightdm/withhold-invalid-x-args

« back to all changes in this revision

Viewing changes to tests/src/test-runner.c

  • Committer: Robert Ancell
  • Date: 2016-01-26 03:37:41 UTC
  • Revision ID: robert.ancell@canonical.com-20160126033741-4btkt0onnjana52e
Add tests for new ConsoleKit XDG_RUNTIME_DIR support

Show diffs side-by-side

added added

removed removed

Lines of Context:
1395
1395
{
1396
1396
    CKSession *session = user_data;
1397
1397
 
1398
 
    if (strcmp (method_name, "Lock") == 0)
 
1398
    if (strcmp (method_name, "GetXDGRuntimeDir") == 0 && !g_key_file_get_boolean (config, "test-runner-config", "ck-no-xdg-runtime", NULL))
 
1399
    {
 
1400
        g_dbus_method_invocation_return_value (invocation, g_variant_new ("(s)", "/run/console-kit"));
 
1401
    }
 
1402
    else if (strcmp (method_name, "Lock") == 0)
1399
1403
    {
1400
1404
        if (!session->locked)
1401
1405
            check_status ("CONSOLE-KIT LOCK-SESSION");
1464
1468
    {
1465
1469
        handle_ck_call,
1466
1470
    };
 
1471
    const gchar *ck_session_interface_old =
 
1472
        "<node>"
 
1473
        "  <interface name='org.freedesktop.ConsoleKit.Session'>"
 
1474
        "    <method name='Lock'/>"
 
1475
        "    <method name='Unlock'/>"
 
1476
        "    <method name='Activate'/>"
 
1477
        "  </interface>"
 
1478
        "</node>";
1467
1479
    const gchar *ck_session_interface =
1468
1480
        "<node>"
1469
1481
        "  <interface name='org.freedesktop.ConsoleKit.Session'>"
 
1482
        "    <method name='GetXDGRuntimeDir'>"
 
1483
        "      <arg name='dir' direction='out' type='s'/>"
 
1484
        "    </method>"
1470
1485
        "    <method name='Lock'/>"
1471
1486
        "    <method name='Unlock'/>"
1472
1487
        "    <method name='Activate'/>"
1481
1496
    g_clear_error (&error);
1482
1497
    if (!ck_info)
1483
1498
        return;
1484
 
    ck_session_info = g_dbus_node_info_new_for_xml (ck_session_interface, &error);
 
1499
    if (g_key_file_get_boolean (config, "test-runner-config", "ck-no-xdg-runtime", NULL))
 
1500
        ck_session_info = g_dbus_node_info_new_for_xml (ck_session_interface_old, &error);
 
1501
    else
 
1502
        ck_session_info = g_dbus_node_info_new_for_xml (ck_session_interface, &error);  
1485
1503
    if (error)
1486
1504
        g_warning ("Failed to parse D-Bus interface: %s", error->message);
1487
1505
    g_clear_error (&error);