gnome-shell/js/perf/closeWithActiveWindows.js
Florian Müllner 2416e4eec0 scripting: Make helper proxy initialization async
We are about to port the helper proxy to GApplication, which means
that it will establish a display connection before exporting its
D-Bus name. That means that the compositor must be able to respond
to a roundtrip request to avoid locking, so don't block on the proxy
becoming available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2733>
2023-06-07 11:12:40 +00:00

37 lines
1016 B
JavaScript

// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported run */
/* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^malloc", "^glx", "^clutter"] }] */
const {Clutter} = imports.gi;
const Main = imports.ui.main;
const Scripting = imports.ui.scripting;
/** Run test. */
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 */
}