diff --git a/tests/camera.c b/tests/camera.c index c590af944..dafa8f964 100644 --- a/tests/camera.c +++ b/tests/camera.c @@ -14,6 +14,7 @@ static int got_info; extern XdpDbusImplPermissionStore *permission_store; extern XdpDbusImplLockdown *lockdown; +extern gchar *appid; static void set_camera_permissions (const char *permission) @@ -26,7 +27,7 @@ set_camera_permissions (const char *permission) "devices", TRUE, "camera", - "", + appid, permissions, NULL, &error); diff --git a/tests/inhibit.c b/tests/inhibit.c index 473c96441..e171eddb2 100644 --- a/tests/inhibit.c +++ b/tests/inhibit.c @@ -8,6 +8,7 @@ extern char outdir[]; extern XdpDbusImplPermissionStore *permission_store; +extern gchar *appid; static void set_inhibit_permissions (const char **permissions) @@ -18,7 +19,7 @@ set_inhibit_permissions (const char **permissions) "inhibit", TRUE, "inhibit", - "", + appid, permissions, NULL, &error); diff --git a/tests/limited-portals.c b/tests/limited-portals.c index 32deceb5e..1a9ce7103 100644 --- a/tests/limited-portals.c +++ b/tests/limited-portals.c @@ -52,6 +52,7 @@ static GDBusConnection *session_bus; static GList *test_procs = NULL; XdpDbusImplPermissionStore *permission_store; XdpDbusImplLockdown *lockdown; +gchar *appid; int xdup (int oldfd) @@ -137,6 +138,7 @@ global_setup (void) g_autofree gchar *argv0 = NULL; g_autoptr(GSubprocessLauncher) launcher = NULL; g_autoptr(GSubprocess) subprocess = NULL; + g_autoptr(XdpAppInfo) appinfo = NULL; guint name_timeout; const char *argv[4]; GQuark portal_errors G_GNUC_UNUSED; @@ -318,6 +320,10 @@ global_setup (void) &error); g_assert_no_error (error); + appinfo = xdp_get_app_info_from_pid (getpid (), &error); + g_assert_no_error (error); + appid = g_strdup (xdp_app_info_get_id (appinfo)); + /* make sure errors are registered */ portal_errors = XDG_DESKTOP_PORTAL_ERROR; } @@ -374,6 +380,7 @@ global_teardown (void) g_object_unref (lockdown); g_object_unref (permission_store); + g_free (appid); g_object_unref (session_bus); diff --git a/tests/test-portals.c b/tests/test-portals.c index 7b59064f7..40c5a95e6 100644 --- a/tests/test-portals.c +++ b/tests/test-portals.c @@ -51,6 +51,7 @@ static GDBusConnection *session_bus; static GList *test_procs = NULL; XdpDbusImplPermissionStore *permission_store; XdpDbusImplLockdown *lockdown; +gchar *appid; int xdup (int oldfd) @@ -136,6 +137,7 @@ global_setup (void) g_autofree gchar *argv0 = NULL; g_autoptr(GSubprocessLauncher) launcher = NULL; g_autoptr(GSubprocess) subprocess = NULL; + g_autoptr(XdpAppInfo) appinfo = NULL; guint name_timeout; const char *argv[4]; GQuark portal_errors G_GNUC_UNUSED; @@ -331,6 +333,10 @@ global_setup (void) &error); g_assert_no_error (error); + appinfo = xdp_get_app_info_from_pid (getpid (), &error); + g_assert_no_error (error); + appid = g_strdup (xdp_app_info_get_id (appinfo)); + /* make sure errors are registered */ portal_errors = XDG_DESKTOP_PORTAL_ERROR; } @@ -387,6 +393,7 @@ global_teardown (void) g_object_unref (lockdown); g_object_unref (permission_store); + g_free (appid); g_object_unref (session_bus); diff --git a/tests/test_globalshortcuts.py b/tests/test_globalshortcuts.py index 56349cb66..84842c343 100644 --- a/tests/test_globalshortcuts.py +++ b/tests/test_globalshortcuts.py @@ -38,7 +38,7 @@ def test_global_shortcuts_create_close_session(self, portal_mock): assert len(method_calls) > 0 _, args = method_calls[-1] assert args[1] == session.handle - assert args[2] == "" # appid +# assert args[2] == "" # appid, not necessary empty session.close() @@ -67,7 +67,7 @@ def test_global_shortcuts_create_session_signal_closed(self, portal_mock): assert len(method_calls) > 0 _, args = method_calls[-1] assert args[1] == session.handle - assert args[2] == "" # appid +# assert args[2] == "" # appid, not necessary empty # Now expect the backend to close it diff --git a/tests/test_remotedesktop.py b/tests/test_remotedesktop.py index 49b6b1884..893e937fd 100644 --- a/tests/test_remotedesktop.py +++ b/tests/test_remotedesktop.py @@ -38,7 +38,7 @@ def test_remote_desktop_create_close_session(self, portal_mock): assert len(method_calls) > 0 _, args = method_calls[-1] assert args[1] == session.handle - assert args[2] == "" # appid +# assert args[2] == "" # appid, not necessary empty session.close() @@ -67,7 +67,7 @@ def test_remote_desktop_create_session_signal_closed(self, portal_mock): assert len(method_calls) > 0 _, args = method_calls[-1] assert args[1] == session.handle - assert args[2] == "" # appid +# assert args[2] == "" # appid, not necessary empty # Now expect the backend to close it diff --git a/tests/wallpaper.c b/tests/wallpaper.c index d6fdc180c..d2ca2e140 100644 --- a/tests/wallpaper.c +++ b/tests/wallpaper.c @@ -10,6 +10,7 @@ extern char outdir[]; static int got_info = 0; extern XdpDbusImplPermissionStore *permission_store; +extern gchar *appid; static void set_wallpaper_permissions (const char *permission) @@ -22,7 +23,7 @@ set_wallpaper_permissions (const char *permission) "wallpaper", TRUE, "wallpaper", - "", + appid, permissions, NULL, &error);