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
1=== modified file 'tests/autopilot/ubuntu_keyboard/emulators/keyboard.py'
2--- tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-07-28 12:01:12 +0000
3+++ tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-08-18 11:38:07 +0000
4@@ -211,6 +211,20 @@
5 self.press_key(char)
6 sleep(delay)
7
8+ def reset(self):
9+ """Reconnect to the maliit process. This should be called by any tests
10+ which restart unity8 (thus causing the maliit-server process to also
11+ be restarted).
12+ """
13+ Keyboard.__maliit = None
14+ # self.maliit is a dynamic property (using the @property decorator),
15+ # so this is actually a function call to the maliit() function,
16+ # which triggers the maliit reconnection.
17+ self.maliit
18+ self._keyboard_container = self.keyboard.select_single(
19+ "KeyboardContainer"
20+ )
21+
22 @property
23 def current_state(self):
24 return self.keyboard.state
25@@ -232,8 +246,8 @@
26 need_to_update = True
27
28 if (
29- need_to_update
30- or self._stored_active_keypad_name != self._current_keypad_name
31+ need_to_update or
32+ self._stored_active_keypad_name != self._current_keypad_name
33 ):
34 self._stored_active_keypad_name = self._current_keypad_name
35 logger.debug("Keypad lookup")

Subscribers

People subscribed via source and target branches