on xenial help sign in
Corrected DefaultIndicatorWidget inheritance, other swiping fixes.
411ed29Allan LeSage
tests/autopilot/unity8/indicators/emulators/__init__.py−7
@@ -16,10 +16,3 @@
16# You should have received a copy of the GNU General Public License
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18#
18#
19−
20−
21−from autopilot.introspection.dbus import CustomEmulatorBase
22−
23−
24−class IndicatorEmulatorBase(CustomEmulatorBase):
25− """A base class for indicator emulators."""
tests/autopilot/unity8/indicators/emulators/widget.py+10−6
@@ -16,20 +16,24 @@
16# You should have received a copy of the GNU General Public License
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
19−from autopilot.input import Touch
19+from autopilot.input import Pointer, Touch
20
20
21−from unity8.indicators.emulators import IndicatorEmulatorBase
21+from unity8.shell.emulators import UnityEmulatorBase
22
22
23
23
24−class DefaultIndicatorWidget(IndicatorEmulatorBase):
24+class DefaultIndicatorWidget(UnityEmulatorBase):
25
25
26 """The indicator's icon in the menu-bar."""
26 """The indicator's icon in the menu-bar."""
27
27
28+ def __init__(self, *args, **kwargs):
29+ super(DefaultIndicatorWidget, self).__init__(*args, **kwargs)
30+ self.pointer = Pointer(Touch.create())
31+
28 # TODO: submit to autopilot.introspection.types.Rectangle
32 # TODO: submit to autopilot.introspection.types.Rectangle
29− def get_center(global_rect):
33+ def get_center(self):
30 """Returns (x, y) representing the center of a globalRect."""
34 """Returns (x, y) representing the center of a globalRect."""
31− return (self.global_rect[0]+int(self.global_rect[2]/2),
35+ return (self.globalRect[0]+int(self.globalRect[2]/2),
32− self.global_rect[1]+int(self.global_rect[3]/2))
36+ self.globalRect[1]+int(self.globalRect[3]/2))
33
37
34 def swipe_to_open_indicator(self, window):
38 def swipe_to_open_indicator(self, window):
35 """Swipe to open the indicator, wait until it's open."""
39 """Swipe to open the indicator, wait until it's open."""