[Sugar-devel] Getting karma to work with sugar-activity-html

Daniel Narvaez dwnarvaez at gmail.com
Sun May 19 15:42:07 EDT 2013


Hello,

I think the easiest approach is probably to

1 Install an empty html activity, say sugar-html-test module, bundle_id
org.sugarlabs.HTMLTestActivity.

2 Make sugar-activity-html support the --uri option. This is what I have
right now

-        self._web_view.load_uri("activity://%s/index.html" %
self._bundle_id)
+        if handle.uri:
+            self._web_view.load_uri(handle.uri)
+        else:
+            self._web_view.load_uri("activity://%s/index.html" %
+                                    self._bundle_id)

3 Fix sugar-launch to handle the --uri argument

4 Somehow fix sugar-launch to work properly with html activities. The
websocket communication is not working right because it requires the
key/port variables which are in the shell environment and sugar-launch is
not running in there.

5 Run with something like

sugar-runner --test-command "sugar-launch org.sugarlabs.HTMLTestActivity
--uri $url_to_karma_server"

Probably wrapped in a friendlier script.

I put together something like this in a very hacky way and it seems to
launch sugar-html-graphics test fine.

I haven't tried to do 4 though. I'm not sure how to do it best. We could
proxy the variables using org.laptop.Shell but I'm not too happy about how
sugar-launch is done in general... supporting two pretty different
application launch code paths complicate things. I wonder if it wouldn't be
better to go through the shell also for sugar-launch. We can get the pid
back and attach gdb.

-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130519/6adee11d/attachment.html>


More information about the Sugar-devel mailing list