@@ -34,7 +34,6 @@ import logging
34import os.path
34import os.path
35import subprocess
35import subprocess
38from testtools.matchers import Equals
37from testtools.matchers import Equals
39from ubuntuuitoolkit import (
38from ubuntuuitoolkit import (
40 fixture_setup as toolkit_fixtures,
39 fixture_setup as toolkit_fixtures,
@@ -164,8 +163,6 @@ class UnityTestCase(AutopilotTestCase):
164 _uinput._touch_device = _uinput.create_touch_device()
163 _uinput._touch_device = _uinput.create_touch_device()
165 self.addCleanup(_uinput._touch_device.close)
164 self.addCleanup(_uinput._touch_device.close)
167− self.uinput = evdev.UInput(name='unity8-autopilot-power-button',
168− devnode='/dev/autopilot-uinput')
169 self.touch = Touch.create()
166 self.touch = Touch.create()
170 self._setup_display_details()
167 self._setup_display_details()
@@ -390,23 +387,6 @@ class UnityTestCase(AutopilotTestCase):
390 dash_app = dash_helpers.DashApp(dash_proxy)
387 dash_app = dash_helpers.DashApp(dash_proxy)
391 return dash_app.dash
388 return dash_app.dash
393− def lock_unity(self):
394− """Helper function that attempts to lock the unity greeter."""
396− # One press and release to turn screen off (locking unity)
397− self.uinput.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_POWER, 1)
398− self.uinput.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_POWER, 0)
401− # And another press and release to turn screen back on
402− self.uinput.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_POWER, 1)
403− self.uinput.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_POWER, 0)
406− greeter = self.main_window.wait_select_single(objectName='greeter')
407− print("Greeter status ", greeter.fullyShown, greeter.active, greeter.waiting, greeter.locked);
408− greeter.fullyShown.wait_for(True);
410 @property
390 @property
411 def main_window(self):
391 def main_window(self):
412 return self._proxy.select_single(main_window_emulator.QQuickView)
392 return self._proxy.select_single(main_window_emulator.QQuickView)