Autopilot does not honor the object cache when creating the root introspection object
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Autopilot |
Fix Released
|
High
|
Unassigned | ||
autopilot (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Vivid |
New
|
Undecided
|
Unassigned |
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_
---
def _get_proxy_
bases = [ApplicationPro
---
and ApplicationProx
---
class ApplicationProx
---
So, the root proxy object will never pick up any CPC's in the object registry. To fix this, let's make ApplicationProx
---
class ApplicationProx
"""A class that better supports query data from an application."""
def __init__(self):
---
and then use the existing methods defined in autopilot.
---
def _get_proxy_
bases = [ call_to_
---
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_
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.
Related branches
- Christopher Lee (community): Approve
- PS Jenkins bot: Approve (continuous-integration)
-
Diff: 584 lines (+165/-118)8 files modifiedautopilot/introspection/_object_registry.py (+66/-36)
autopilot/introspection/_search.py (+52/-35)
autopilot/introspection/backends.py (+3/-4)
autopilot/introspection/dbus.py (+0/-1)
autopilot/tests/functional/test_introspection_features.py (+35/-0)
autopilot/tests/unit/test_introspection.py (+2/-29)
autopilot/tests/unit/test_introspection_backends.py (+2/-5)
autopilot/tests/unit/test_introspection_object_registry.py (+5/-8)
Changed in autopilot: | |
status: | Fix Committed → Fix Released |
Fix committed into lp:autopilot at revision 511, scheduled for release in autopilot, milestone 1.4