gnome-shell/tests/shell/closeWithActiveWindows.js
Florian Müllner e7d290bbfb tests: Stop bundling "perf" tests with gnome-shell
Now that scripts are loaded as external modules, there's no reason
anymore for bundling them with the gnome-shell executable. Just
move the scripts into a dedicated folder in tests/ and run them
from there.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2812>
2023-07-07 19:43:28 +02:00

36 lines
1010 B
JavaScript

// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^malloc", "^glx", "^clutter"] }] */
const Clutter = imports.gi.Clutter;
const Main = imports.ui.main;
const Scripting = imports.ui.scripting;
/** Run test. */
export async function run() {
/* eslint-disable no-await-in-loop */
/* Make created windows remain visible during exit. */
await Scripting.disableHelperAutoExit();
const seat = Clutter.get_default_backend().get_default_seat();
const virtualDevice_ =
seat.create_virtual_device(Clutter.InputDeviceType.KEYBOARD_DEVICE);
Main.overview.hide();
await Scripting.waitLeisure();
await Scripting.sleep(1000);
await Scripting.createTestWindow({
width: 640,
height: 480,
textInput: true,
});
await Scripting.waitTestWindows();
await Scripting.waitLeisure();
await Scripting.sleep(1000);
/* eslint-enable no-await-in-loop */
}