GTK module is not loaded within the snap

I am snapping autopilot-gtk in order to be able to introspect gnome snaps to add automated GUI tests. That snap generates a library (libautopilot.so) that needs to be shared with the consumer snaps.
You can see the autopilot yaml here (1)

To share the library I am using the content interface. So I have in the autopilot snap the slot:
slots:
testability:
content: testability
interface: content
read:
- usr/lib

And the consumer snap, in this example gedit (2), has the plugs:
autopilot-introspection:
testability:
interface: content
default-provider: autopilot-gtk:testability
target: snap/testability
And also I added this environment definitions:
environment:
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/lib/gedit:$SNAP/snap/testability
GTK_MODULES: $GTK_MODULES:$SNAP/snap/testability/libautopilot.so

I install the snaps and connect the interfaces properly, but when I run the gedit snap I see this message:
Gtk-Message: Failed to load module “/snap/gedit/x1/snap/testability/libautopilot.so”
That prevents me to introspect the snap.

I checked with “snap run --shell gedit” and the library libautopilot.so is in the correct path (/snap/gedit/x1/snap/testability), also I checked the variable LD_LIBRARY_PATH and it contains the path for that library: /snap/gedit/x1/snap/testability.

Am I missing something? Why does the snap fail to load that gtk-module if I can see it with snap run --shell …?

(1): http://bazaar.launchpad.net/~heber013/autopilot-gtk/snapping-autopilot-gtk/view/head:/snapcraft.yaml
(2) http://bazaar.launchpad.net/~heber013/gedit/snap-allow-introspection/view/head:/snapcraft.yaml