[gnome-continuous/wip/apptest: 1/5] startstopapps: Close the specific app that was started



commit b5a3488bb84fbd22a3f10f310c67c23631b8331c
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Nov 13 12:05:45 2013 -0500

    startstopapps: Close the specific app that was started
    
    Rather than all of them. This makes it easier to debug, and might just
    fix the apps not closing bug.

 src/tests/gnome-continuous-startstopapps |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/tests/gnome-continuous-startstopapps b/src/tests/gnome-continuous-startstopapps
index 8c00a37..f03acfd 100644
--- a/src/tests/gnome-continuous-startstopapps
+++ b/src/tests/gnome-continuous-startstopapps
@@ -21,10 +21,11 @@ const GLib = imports.gi.GLib;
 const GObject = imports.gi.GObject;
 const Gio = imports.gi.Gio;
 const Lang = imports.lang;
+const Format = imports.format;
 
 const sessionBus = Gio.bus_get_sync(Gio.BusType.SESSION, null);
 
-const CLOSE_ALL_APPS = 'Shell.AppSystem.get_default().get_running().forEach(function (app) { 
app.request_quit(); });';
+const CLOSE_APP = 'Shell.AppSystem.get_default().lookup_app("%s").request_quit();';
 const GET_APP_IDS = 'Shell.AppSystem.get_default().get_running().map(function (a) { return a.get_id(); });';
 
 const StartStopApps = new GObject.Class({
@@ -62,6 +63,9 @@ const StartStopApps = new GObject.Class({
     },
 
     _testNextApp: function() {
+        if (this._testingApp)
+           this._shellEval(Format.vprintf(CLOSE_APP, [this._testingApp.get_id()]), this._cancellable);
+
        if (this._appList.length == 0) {
            print("No applications remaining to test");
            this._running = false;
@@ -73,8 +77,6 @@ const StartStopApps = new GObject.Class({
        let appid = this._testingApp.get_id();
        print("testing appid=" + appid);
 
-       this._shellEval(CLOSE_ALL_APPS, this._cancellable);
-
        this._sendAsyncMessage('TestingAppStart', GLib.Variant.new("s", appid));
        this._testingApp.launch([], this._cancellable);
        this._appCheckRunningIterations = 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]