← Back to team overview

touch-packages team mailing list archive

[Bug 1348399] Re: Autopilot does not honor the object cache when creating the root introspection object

 

This bug was fixed in the package autopilot -
1.5.0+14.10.20140812-0ubuntu1

---------------
autopilot (1.5.0+14.10.20140812-0ubuntu1) utopic; urgency=low

  [ Thomi Richards ]
  * Release of Autopilot. Bugfix for lp:1306330 & lp:1348399 (LP:
    #1306330, #1078732, #1348399)
 -- Ubuntu daily release <ps-jenkins@xxxxxxxxxxxxxxxxxxx>   Tue, 12 Aug 2014 09:53:34 +0000

** Changed in: autopilot (Ubuntu)
       Status: New => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to autopilot in Ubuntu.
https://bugs.launchpad.net/bugs/1348399

Title:
  Autopilot does not honor the object cache when creating the root
  introspection object

Status in Autopilot:
  Fix Committed
Status in “autopilot” package in Ubuntu:
  Fix Released

Bug description:
  Currently, if a user defines a custom proxy class for the node at the
  root of the introspection tree, it does not get returned by the
  launch_* methods.

  The reason for this is that, in _search.py, the
  _get_proxy_bases_from_introspection_xml does this:

  ---
  def _get_proxy_bases_from_introspection_xml(introspection_xml):
      bases = [ApplicationProxyObject]
  ---

  and ApplicationProxyObject is defined (just a few lines further down)
  as:

  ---
  class ApplicationProxyObject(ap_dbus.DBusIntrospectionObject):
  ---

  So, the root proxy object will never pick up any CPC's in the object
  registry. To fix this, let's make ApplicationProxyObject a simple
  mixin class:

  ---
  class ApplicationProxyObject(object):
      """A class that better supports query data from an application."""

      def __init__(self):
          self._process = None
  ---

  and then use the existing methods defined in
  autopilot.introspection._object_registry to get the appropriate proxy
  class:

  ---
  def _get_proxy_bases_from_introspection_xml(introspection_xml):
      bases = [ call_to_get_proxy_class(...), ApplicationProxyObject]
  ---

  I'm too lazy to figure out what the exact call should be, but I'm sure
  it exists in the _object_registry module. This will probably involve
  changing the _get_proxy_bases_from_introspection_xml function to take
  some additional parameters, or some refactoring to pass in the base
  class.

  The test case for this should be:

  Write a simple Qml app script, and define a custom proxy class for the
  root node. Assert that:

  * When launching the app, we get an instance of the CPC, not a generated class.
  * When calling the get_root_instance call on any other proxy object, we get an instance of the CPC, not a generated class.

To manage notifications about this bug go to:
https://bugs.launchpad.net/autopilot/+bug/1348399/+subscriptions