Merge lp:~michael-sheldon/ubuntu-keyboard/autopilot-reset into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Michael Sheldon
Approved revision: 406
Merged at revision: 404
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/autopilot-reset
Merge into: lp:ubuntu-keyboard
Diff against target: 35 lines (+16/-2)
1 file modified
tests/autopilot/ubuntu_keyboard/emulators/keyboard.py (+16/-2)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/autopilot-reset
Reviewer Review Type Date Requested Status
Brendan Donegan (community) Approve
PS Jenkins bot continuous-integration Needs Fixing
Review via email: mp+267345@code.launchpad.net

Commit message

Add reset function to autopilot emulator so that maliit can be reconnected after a unity8 restart.

Description of the change

Add reset function to autopilot emulator so that maliit can be reconnected after a unity8 restart.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Small comment but otherwise it works well

review: Needs Information
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Responded inline

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

There is some trailing whitespace according to Jenkins

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes (tested against ubuntu-system-tests)

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ubuntu-keyboard) on device or emulator?

 * No (changes only provide an extra function for autopilot to use in other packages, with no effect on the keyboard's own behaviour)

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed UI labels, did you update the pot file?

 * No change

If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?

 * No change

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Looks good now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/autopilot/ubuntu_keyboard/emulators/keyboard.py'
--- tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-07-28 12:01:12 +0000
+++ tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-08-18 11:38:07 +0000
@@ -211,6 +211,20 @@
211 self.press_key(char)211 self.press_key(char)
212 sleep(delay)212 sleep(delay)
213213
214 def reset(self):
215 """Reconnect to the maliit process. This should be called by any tests
216 which restart unity8 (thus causing the maliit-server process to also
217 be restarted).
218 """
219 Keyboard.__maliit = None
220 # self.maliit is a dynamic property (using the @property decorator),
221 # so this is actually a function call to the maliit() function,
222 # which triggers the maliit reconnection.
223 self.maliit
224 self._keyboard_container = self.keyboard.select_single(
225 "KeyboardContainer"
226 )
227
214 @property228 @property
215 def current_state(self):229 def current_state(self):
216 return self.keyboard.state230 return self.keyboard.state
@@ -232,8 +246,8 @@
232 need_to_update = True246 need_to_update = True
233247
234 if (248 if (
235 need_to_update249 need_to_update or
236 or self._stored_active_keypad_name != self._current_keypad_name250 self._stored_active_keypad_name != self._current_keypad_name
237 ):251 ):
238 self._stored_active_keypad_name = self._current_keypad_name252 self._stored_active_keypad_name = self._current_keypad_name
239 logger.debug("Keypad lookup")253 logger.debug("Keypad lookup")

Subscribers

People subscribed via source and target branches