[gnome-continuous/wip/apptest: 12/13] build.gnome.org: Make the app link to the screenshot



commit 7f97c98f439b5b423fbae8e339d9133dbc14445a
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Nov 15 19:03:27 2013 -0500

    build.gnome.org: Make the app link to the screenshot

 extras/build.gnome.org/controllers.js |    1 +
 src/js/tasks/task-applicationstest.js |    7 +++++++
 src/js/tasks/testbase.js              |    6 ++++++
 3 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/extras/build.gnome.org/controllers.js b/extras/build.gnome.org/controllers.js
index 7cb734e..af484ec 100644
--- a/extras/build.gnome.org/controllers.js
+++ b/extras/build.gnome.org/controllers.js
@@ -42,6 +42,7 @@
                 var icon = app.icon ? (ROOT + app.icon) : '/images/app-generic.png';
                 apps.push({ id: id,
                             name: id, /* XXX */
+                            screenshot: (ROOT + app.screenshot),
                             status: (app.state == "success") ? 'good' : 'bad',
                             icon: icon });
             });
diff --git a/src/js/tasks/task-applicationstest.js b/src/js/tasks/task-applicationstest.js
index 04d19b3..6f18437 100644
--- a/src/js/tasks/task-applicationstest.js
+++ b/src/js/tasks/task-applicationstest.js
@@ -80,6 +80,13 @@ const TaskApplicationsTest = new Lang.Class({
         return icon;
     },
 
+    _screenshotTaken: function(path) {
+        if (this._testingApp) {
+            let app = this._allApps[this._testingApp];
+            app.screenshot = this.workdir.get_relative_path(path);
+        }
+    },
+
     _onCommandChannelAsyncMessage: function(msgId, value) {
         if (msgId == 'TestingAppStart') {
             let [appId, iconTuple] = value.deep_unpack();
diff --git a/src/js/tasks/testbase.js b/src/js/tasks/testbase.js
index 1723786..f225778 100644
--- a/src/js/tasks/testbase.js
+++ b/src/js/tasks/testbase.js
@@ -258,6 +258,7 @@ const TestOneDisk = new Lang.Class({
         }
 
         // Convert to PNG if possible
+        let screenshotPath = filePath;
         if (modified && imports.gi.GdkPixbuf) {
             let GdkPixbuf = imports.gi.GdkPixbuf;
             let pixbuf = null;
@@ -271,6 +272,7 @@ const TestOneDisk = new Lang.Class({
             }
             if (pixbuf != null) {
                 let outFilename = this._subworkdir.get_child(filename.replace(/ppm$/, 'png'));
+                screenshotPath = outFilename;
                 pixbuf.savev(outFilename.get_path(), "png", [], []);
             }
             GSystem.file_unlink(filePath, this._cancellable);
@@ -279,6 +281,7 @@ const TestOneDisk = new Lang.Class({
         if (name == null) {
             this._requestingScreenshot = false;
         } else {
+            this._parentTask._screenshotTaken(screenshotPath);
             this._commandProxy._dbusImpl.emit_signal('ScreenshotComplete',
                                                      GLib.Variant.new('(s)', [name]));
         }
@@ -534,6 +537,9 @@ const TestBase = new Lang.Class({
     _postQemu: function(cancellable) {
     },
 
+    _screenshotTaken: function(path) {
+    },
+
     execute: function(cancellable) {
              let imageDir = this.workdir.get_child('images');
              let currentImages = imageDir.get_child('current');


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