Merge lp:~michael-sheldon/ubuntu-keyboard/fix-extended-key-ordering into lp:ubuntu-keyboard

Proposed by Michael Sheldon
Status: Merged
Approved by: Bill Filler
Approved revision: 327
Merged at revision: 338
Proposed branch: lp:~michael-sheldon/ubuntu-keyboard/fix-extended-key-ordering
Merge into: lp:ubuntu-keyboard
Diff against target: 50 lines (+21/-2)
2 files modified
qml/keys/ExtendedKeysSelector.qml (+1/-1)
tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+20/-1)
To merge this branch: bzr merge lp:~michael-sheldon/ubuntu-keyboard/fix-extended-key-ordering
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+250641@code.launchpad.net

Commit message

Ensure that extended key selector array is cloned

Description of the change

Ensure that extended key selector array is cloned (Qt 5.4 just creates a reference)

To post a comment you must log in.
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

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?

 * Yes

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
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/keys/ExtendedKeysSelector.qml'
2--- qml/keys/ExtendedKeysSelector.qml 2014-08-21 11:18:02 +0000
3+++ qml/keys/ExtendedKeysSelector.qml 2015-02-23 15:36:08 +0000
4@@ -41,7 +41,7 @@
5 // Place the first key in the middle of the model so that it gets
6 // selected by default
7 var middleKey = Math.floor(extendedKeysModel.length / 2);
8- var reorderedModel = extendedKeysModel;
9+ var reorderedModel = extendedKeysModel.slice(0); // Ensure the array is cloned
10 reorderedModel.splice(extendedKeysModel.length % 2 == 0 ? middleKey : middleKey + 1, 0, extendedKeysModel[0]);
11 reorderedModel.shift();
12 keyRepeater.model = reorderedModel;
13
14=== modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py'
15--- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-02-09 18:18:20 +0000
16+++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-02-23 15:36:08 +0000
17@@ -570,7 +570,6 @@
18 text_area.text,
19 Eventually(Equals(expected))
20 )
21-
22
23 def test_long_press(self):
24 """Long pressing a key should enter the default extended character.
25@@ -590,6 +589,26 @@
26 Eventually(Equals(expected))
27 )
28
29+ def test_repeated_long_press(self):
30+ """The default key should stay in the middle after each long press.
31+
32+ """
33+
34+ text_area = self.launch_test_input_area()
35+ self.ensure_focus_on_input(text_area)
36+ keyboard = Keyboard()
37+ self.addCleanup(keyboard.dismiss)
38+
39+ keyboard.press_key('u', long_press=True)
40+ keyboard.press_key('u', long_press=True)
41+ keyboard.press_key('u', long_press=True)
42+
43+ expected = "777"
44+ self.assertThat(
45+ text_area.text,
46+ Eventually(Equals(expected))
47+ )
48+
49
50 class UbuntuKeyboardPinyin(UbuntuKeyboardTests):
51

Subscribers

People subscribed via source and target branches