From efd5b91dabdc11bdb94b6e0bacf95a36f3c2b2cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 12 Apr 2023 15:24:25 +0200 Subject: [PATCH] tests: Remove gapplication test app Its only purpose is to provide a test case for the remote app menu, but that support was removed in gnome-shell years ago. We don't need a test case for GTK's fallback app menu support, so remove the whole thing. Part-of: --- tests/interactive/gapplication.js | 104 ------------------------------ 1 file changed, 104 deletions(-) delete mode 100755 tests/interactive/gapplication.js diff --git a/tests/interactive/gapplication.js b/tests/interactive/gapplication.js deleted file mode 100755 index 9dd2a408b..000000000 --- a/tests/interactive/gapplication.js +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env gjs -// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*- - -imports.gi.versions = { Gdk: '3.0', Gtk: '3.0' }; -const { Gdk, Gio, GLib, Gtk } = imports.gi; - -function do_action(action, parameter) { - print ("Action '" + action.name + "' invoked"); -} - -function do_action_param(action, parameter) { - print ("Action '" + action.name + "' invoked with parameter " + parameter.print(true)); -} - -function do_action_toggle(action) { - action.set_state(GLib.Variant.new('b', !action.state.deepUnpack())); - print ("Toggled"); -} - -function do_action_state_change(action) { - print ("Action '" + action.name + "' has now state " + action.state.print(true)); -} - -function main() { - Gtk.init(null); - Gdk.set_program_class('test-gjsgapp'); - - let app = new Gtk.Application({ application_id: 'org.gnome.Shell.GtkApplicationTest' }); - app.connect('activate', () => { - print ("Activated"); - }); - - let action = new Gio.SimpleAction({ name: 'one' }); - action.connect('activate', do_action); - app.add_action(action); - - action = new Gio.SimpleAction({ name: 'two' }); - action.connect('activate', do_action); - app.add_action(action); - - action = new Gio.SimpleAction({ name: 'toggle', state: GLib.Variant.new('b', false) }); - action.connect('activate', do_action_toggle); - action.connect('notify::state', do_action_state_change); - app.add_action(action); - - action = new Gio.SimpleAction({ name: 'disable', enabled: false }); - action.set_enabled(false); - action.connect('activate', do_action); - app.add_action(action); - - action = new Gio.SimpleAction({ name: 'parameter-int', parameter_type: GLib.VariantType.new('u') }); - action.connect('activate', do_action_param); - app.add_action(action); - - action = new Gio.SimpleAction({ name: 'parameter-string', parameter_type: GLib.VariantType.new('s') }); - action.connect('activate', do_action_param); - app.add_action(action); - - let menu = new Gio.Menu(); - menu.append('An action', 'app.one'); - - let section = new Gio.Menu(); - section.append('Another action', 'app.two'); - section.append('Same as above', 'app.two'); - menu.append_section(null, section); - - // another section, to check separators - section = new Gio.Menu(); - section.append('Checkbox', 'app.toggle'); - section.append('Disabled', 'app.disable'); - section.append('Missing Action', 'app.no-action'); - menu.append_section('Subsection', section); - - // empty sections or submenus should be invisible - menu.append_section('Empty section', new Gio.Menu()); - menu.append_submenu('Empty submenu', new Gio.Menu()); - - let submenu = new Gio.Menu(); - submenu.append('Open c:\\', 'app.parameter-string::c:\\'); - submenu.append('Open /home', 'app.parameter-string::/home'); - menu.append_submenu('Recent files', submenu); - - let item = Gio.MenuItem.new('Say 42', null); - item.set_action_and_target_value('app.parameter-int', GLib.Variant.new('u', 42)); - menu.append_item(item); - - item = Gio.MenuItem.new('Say 43', null); - item.set_action_and_target_value('app.parameter-int', GLib.Variant.new('u', 43)); - menu.append_item(item); - - let window = null; - - app.connect_after('startup', app => { - app.set_app_menu(menu); - window = new Gtk.ApplicationWindow({ title: "Test Application", application: app }); - }); - app.connect('activate', app => { - window.present(); - }); - - app.run(null); -} - -main();