Branch data Line data Source code
1 : : /* 2 : : * GIO - GLib Input, Output and Streaming Library 3 : : * 4 : : * Copyright (C) 2022 Canonical Ltd. 5 : : * 6 : : * SPDX-License-Identifier: LGPL-2.1-or-later 7 : : * 8 : : * This library is free software; you can redistribute it and/or 9 : : * modify it under the terms of the GNU Lesser General Public 10 : : * License as published by the Free Software Foundation; either 11 : : * version 2.1 of the License, or (at your option) any later version. 12 : : * 13 : : * This library is distributed in the hope that it will be useful, 14 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 : : * Lesser General Public License for more details. 17 : : * 18 : : * You should have received a copy of the GNU Lesser General 19 : : * Public License along with this library; if not, see <http://www.gnu.org/licenses/>. 20 : : * 21 : : * Author: Marco Trevisan <marco.trevisan@canonical.com> 22 : : */ 23 : : 24 : : #include "portal-support-utils.h" 25 : : 26 : : #include "../gportalsupport.h" 27 : : #include <gio/gio.h> 28 : : 29 : : static void 30 : 1 : test_portal_support_flatpak_network (void) 31 : : { 32 : 1 : create_fake_flatpak_info (g_get_user_runtime_dir (), 33 : 1 : (GStrv)(const char* []) {"foo", "bar", "network", "more", NULL}, 34 : : "do-not-talk"); 35 : : 36 : 1 : g_assert_true (glib_should_use_portal ()); 37 : 1 : g_assert_true (glib_network_available_in_sandbox ()); 38 : 1 : g_assert_false (glib_has_dconf_access_in_sandbox ()); 39 : 1 : } 40 : : 41 : : int 42 : 1 : main (int argc, char **argv) 43 : : { 44 : 1 : g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL); 45 : : 46 : 1 : g_test_add_func ("/portal-support/flatpak/network", test_portal_support_flatpak_network); 47 : : 48 : 1 : return g_test_run (); 49 : : }