tests: Stop using Gtk.PolicyType

St got its own enum type years ago, so use that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2733>
This commit is contained in:
Florian Müllner 2023-04-12 15:20:42 +02:00 committed by Marge Bot
parent efd5b91dab
commit 99973f56fd
3 changed files with 7 additions and 7 deletions

View File

@ -2,7 +2,7 @@
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
const { Clutter, GObject, Gtk, Shell, St } = imports.gi; const {Clutter, GObject, Shell, St} = imports.gi;
// This is an interactive test of the sizing behavior of StScrollView. It // This is an interactive test of the sizing behavior of StScrollView. It
// may be interesting in the future to split out the two classes at the // may be interesting in the future to split out the two classes at the
@ -299,7 +299,7 @@ function test() {
button.label = 'AUTOMATIC'; button.label = 'AUTOMATIC';
break; break;
} }
scrollView.set_policy(Gtk.PolicyType[hpolicy.label], Gtk.PolicyType[vpolicy.label]); scrollView.set_policy(St.PolicyType[hpolicy.label], St.PolicyType[vpolicy.label]);
} }
hpolicy.connect('clicked', () => { togglePolicy(hpolicy); }); hpolicy.connect('clicked', () => { togglePolicy(hpolicy); });

View File

@ -2,7 +2,7 @@
const UI = imports.testcommon.ui; const UI = imports.testcommon.ui;
const { Clutter, Gtk, St } = imports.gi; const {Clutter, St} = imports.gi;
function test() { function test() {
let stage = new Clutter.Stage(); let stage = new Clutter.Stage();
@ -22,9 +22,9 @@ function test() {
vbox.add(v, { expand: true }); vbox.add(v, { expand: true });
toggle.connect('notify::checked', () => { toggle.connect('notify::checked', () => {
v.set_policy(toggle.checked ? Gtk.PolicyType.AUTOMATIC v.set_policy(toggle.checked ? St.PolicyType.AUTOMATIC
: Gtk.PolicyType.NEVER, : St.PolicyType.NEVER,
Gtk.PolicyType.AUTOMATIC); St.PolicyType.AUTOMATIC);
}); });
let b = new St.BoxLayout({ vertical: true, let b = new St.BoxLayout({ vertical: true,

View File

@ -2,7 +2,7 @@
const Config = imports.misc.config; const Config = imports.misc.config;
imports.gi.versions = { Clutter: Config.LIBMUTTER_API_VERSION, Gtk: '3.0' }; imports.gi.versions = {Clutter: Config.LIBMUTTER_API_VERSION};
const { Clutter, Gio, GLib, St } = imports.gi; const { Clutter, Gio, GLib, St } = imports.gi;