main: Call init() in perf modules if it exists
This is meant to let perf tests initialize themselves earlier than they would otherwise run. This allows them to setup the necessary dependencies, e.g. create test monitors or similar actions. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2623>
This commit is contained in:
parent
73e0f02b1d
commit
d116256e83
@ -314,6 +314,14 @@ function _initializeUI() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let perfModule;
|
||||||
|
const perfModuleName = GLib.getenv('SHELL_PERF_MODULE');
|
||||||
|
if (perfModuleName) {
|
||||||
|
perfModule = eval(`imports.perf.${perfModuleName};`);
|
||||||
|
if (perfModule.init)
|
||||||
|
perfModule.init();
|
||||||
|
}
|
||||||
|
|
||||||
layoutManager.connect('startup-complete', () => {
|
layoutManager.connect('startup-complete', () => {
|
||||||
if (actionMode == Shell.ActionMode.NONE)
|
if (actionMode == Shell.ActionMode.NONE)
|
||||||
actionMode = Shell.ActionMode.NORMAL;
|
actionMode = Shell.ActionMode.NORMAL;
|
||||||
@ -329,8 +337,7 @@ function _initializeUI() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const perfModuleName = GLib.getenv('SHELL_PERF_MODULE');
|
if (!perfModule) {
|
||||||
if (!perfModuleName) {
|
|
||||||
let credentials = new Gio.Credentials();
|
let credentials = new Gio.Credentials();
|
||||||
if (credentials.get_unix_user() === 0) {
|
if (credentials.get_unix_user() === 0) {
|
||||||
notify(
|
notify(
|
||||||
@ -347,10 +354,9 @@ function _initializeUI() {
|
|||||||
|
|
||||||
LoginManager.registerSessionWithGDM();
|
LoginManager.registerSessionWithGDM();
|
||||||
|
|
||||||
if (perfModuleName) {
|
if (perfModule) {
|
||||||
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
|
let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");
|
||||||
let module = eval(`imports.perf.${perfModuleName};`);
|
Scripting.runPerfScript(perfModule, perfOutput);
|
||||||
Scripting.runPerfScript(module, perfOutput);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user