Merge lp:~michael-sheldon/ubuntu-keyboard/test-oxide-visibility into lp:ubuntu-keyboard
- test-oxide-visibility
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Bill Filler |
Approved revision: | 351 |
Merged at revision: | 369 |
Proposed branch: | lp:~michael-sheldon/ubuntu-keyboard/test-oxide-visibility |
Merge into: | lp:ubuntu-keyboard |
Prerequisite: | lp:~michael-sheldon/ubuntu-keyboard/oxide-tests |
Diff against target: |
641 lines (+198/-65) 8 files modified
debian/control (+1/-0) debian/rules (+1/-0) tests/autopilot/ubuntu_keyboard/emulators/__init__.py (+1/-7) tests/autopilot/ubuntu_keyboard/emulators/key.py (+5/-5) tests/autopilot/ubuntu_keyboard/emulators/keyboard.py (+16/-11) tests/autopilot/ubuntu_keyboard/emulators/keypad.py (+17/-6) tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py (+154/-35) tools/overrides-from-hunspell.py (+3/-1) |
To merge this branch: | bzr merge lp:~michael-sheldon/ubuntu-keyboard/test-oxide-visibility |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Ubuntu Phablet Team | Pending | ||
Review via email: mp+254880@code.launchpad.net |
Commit message
Add test for the keyboard remaining dismissed when scrolling in Oxide.
Description of the change
Add test for the keyboard remaining dismissed when scrolling in Oxide.
PS Jenkins bot (ps-jenkins) wrote : | # |
- 348. By Michael Sheldon
-
Merge from trunk
Michael Sheldon (michael-sheldon) wrote : | # |
Are there any related MPs required for this MP to build/function as expected? Please list.
* Needs a release of Oxide 1.6 (tests won't pass otherwise)
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:/
* 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
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:348
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 349. By Michael Sheldon
-
Merge flake8 fixes
- 350. By Michael Sheldon
-
Fix flake8 tests
- 351. By Michael Sheldon
-
Merge from trunk
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:351
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2015-04-20 15:33:41 +0000 |
3 | +++ debian/control 2015-05-14 16:18:28 +0000 |
4 | @@ -17,6 +17,7 @@ |
5 | maliit-framework-dev (>= 0.99.0+git20130615+97e8335-0ubuntu3), |
6 | pkg-config, |
7 | python3, |
8 | + python3-flake8, |
9 | python3-setuptools, |
10 | qt5-default, |
11 | qtbase5-dev, |
12 | |
13 | === modified file 'debian/rules' |
14 | --- debian/rules 2014-11-18 14:55:12 +0000 |
15 | +++ debian/rules 2015-05-14 16:18:28 +0000 |
16 | @@ -16,6 +16,7 @@ |
17 | CONFIG+=enable-pinyin |
18 | |
19 | override_dh_auto_test: |
20 | + python3 -m flake8.run . |
21 | # Tests write $HOME/.presage/lm.db, make sure $HOME is |
22 | # writable. |
23 | rm -rf $(CURDIR)/debian/test-home |
24 | |
25 | === modified file 'tests/autopilot/ubuntu_keyboard/emulators/__init__.py' |
26 | --- tests/autopilot/ubuntu_keyboard/emulators/__init__.py 2013-09-26 16:02:12 +0000 |
27 | +++ tests/autopilot/ubuntu_keyboard/emulators/__init__.py 2015-05-14 16:18:28 +0000 |
28 | @@ -1,7 +1,7 @@ |
29 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
30 | # |
31 | # Ubuntu Keyboard Test Suite |
32 | -# Copyright (C) 2013 Canonical |
33 | +# Copyright (C) 2013, 2015 Canonical |
34 | # |
35 | # This program is free software: you can redistribute it and/or modify |
36 | # it under the terms of the GNU General Public License as published by |
37 | @@ -16,9 +16,3 @@ |
38 | # You should have received a copy of the GNU General Public License |
39 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
40 | # |
41 | - |
42 | -from autopilot.introspection import CustomEmulatorBase |
43 | - |
44 | - |
45 | -class UbuntuKeyboardEmulatorBase(CustomEmulatorBase): |
46 | - """A base class for all Ubuntu Keyboard emulators.""" |
47 | |
48 | === modified file 'tests/autopilot/ubuntu_keyboard/emulators/key.py' |
49 | --- tests/autopilot/ubuntu_keyboard/emulators/key.py 2013-10-10 09:06:50 +0000 |
50 | +++ tests/autopilot/ubuntu_keyboard/emulators/key.py 2015-05-14 16:18:28 +0000 |
51 | @@ -1,7 +1,7 @@ |
52 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
53 | # |
54 | # Ubuntu Keyboard Test Suite |
55 | -# Copyright (C) 2013 Canonical |
56 | +# Copyright (C) 2013, 2015 Canonical |
57 | # |
58 | # This program is free software: you can redistribute it and/or modify |
59 | # it under the terms of the GNU General Public License as published by |
60 | @@ -17,15 +17,15 @@ |
61 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
62 | # |
63 | |
64 | -from ubuntu_keyboard.emulators import UbuntuKeyboardEmulatorBase |
65 | - |
66 | +import logging |
67 | from collections import namedtuple |
68 | -import logging |
69 | + |
70 | +import ubuntuuitoolkit |
71 | |
72 | logger = logging.getLogger(__name__) |
73 | |
74 | |
75 | -class Key(UbuntuKeyboardEmulatorBase): |
76 | +class Key(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
77 | """An emulator that encapsulates details of a keyboard key (i.e. extended |
78 | characters). |
79 | |
80 | |
81 | === modified file 'tests/autopilot/ubuntu_keyboard/emulators/keyboard.py' |
82 | --- tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-03-12 17:34:47 +0000 |
83 | +++ tests/autopilot/ubuntu_keyboard/emulators/keyboard.py 2015-05-14 16:18:28 +0000 |
84 | @@ -1,7 +1,7 @@ |
85 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
86 | # |
87 | # Ubuntu Keyboard Test Suite |
88 | -# Copyright (C) 2013 Canonical |
89 | +# Copyright (C) 2013, 2015 Canonical |
90 | # |
91 | # This program is free software: you can redistribute it and/or modify |
92 | # it under the terms of the GNU General Public License as published by |
93 | @@ -19,13 +19,13 @@ |
94 | |
95 | from collections import defaultdict |
96 | |
97 | -from ubuntu_keyboard.emulators import UbuntuKeyboardEmulatorBase |
98 | from ubuntu_keyboard.emulators.keypad import KeyPad |
99 | |
100 | from time import sleep |
101 | import logging |
102 | import os |
103 | |
104 | +import ubuntuuitoolkit as toolkit |
105 | from autopilot.input import Pointer, Touch |
106 | from autopilot.introspection import ( |
107 | get_proxy_object_for_existing_process, |
108 | @@ -114,7 +114,7 @@ |
109 | try: |
110 | Keyboard.__maliit = get_proxy_object_for_existing_process( |
111 | connection_name='org.maliit.server', |
112 | - emulator_base=UbuntuKeyboardEmulatorBase |
113 | + emulator_base=toolkit.UbuntuUIToolkitCustomProxyObjectBase |
114 | ) |
115 | |
116 | if Keyboard.__maliit is None: |
117 | @@ -161,7 +161,8 @@ |
118 | except AssertionError: |
119 | return False |
120 | |
121 | - def press_key(self, key, capslock_switch=False, long_press=False, slide_offset=None): |
122 | + def press_key(self, key, capslock_switch=False, long_press=False, |
123 | + slide_offset=None): |
124 | """Tap on the key with the internal pointer |
125 | |
126 | :params key: String containing the text of the key to tap. |
127 | @@ -192,7 +193,7 @@ |
128 | self._show_keypad(req_keypad) |
129 | self._change_keypad_to_state(req_key_state) |
130 | |
131 | - if slide_offset != None: |
132 | + if slide_offset is not None: |
133 | self._select_extended_key(key_pos, slide_offset) |
134 | elif long_press: |
135 | self._long_press_key(key_pos) |
136 | @@ -304,7 +305,7 @@ |
137 | "shift" |
138 | ) |
139 | |
140 | - if key_pos == None: |
141 | + if key_pos is None: |
142 | # Not all layouts have a shift key |
143 | return |
144 | |
145 | @@ -320,7 +321,8 @@ |
146 | def _long_press_key(self, key_rect, pointer=None): |
147 | if pointer is None: |
148 | pointer = Pointer(Touch.create()) |
149 | - pointer.move(key_rect.x + key_rect.w / 2.0, key_rect.y + key_rect.h / 2.0) |
150 | + pointer.move( |
151 | + key_rect.x + key_rect.w / 2.0, key_rect.y + key_rect.h / 2.0) |
152 | pointer.press() |
153 | sleep(0.5) |
154 | pointer.release() |
155 | @@ -329,11 +331,14 @@ |
156 | if pointer is None: |
157 | pointer = Pointer(Touch.create()) |
158 | |
159 | - gu = float(os.environ.get('GRID_UNIT_PX', 8)) |
160 | + gu = float(os.environ.get('GRID_UNIT_PX', 8)) |
161 | |
162 | - pointer.drag(key_rect.x + key_rect.w / 2.0, key_rect.y + key_rect.h / 2.0, |
163 | - key_rect.x + key_rect.w / 2.0 + offset, key_rect.y + key_rect.h / 2.0, |
164 | - rate=2.77 * gu, time_between_events=2) |
165 | + pointer.drag( |
166 | + key_rect.x + key_rect.w / 2.0, |
167 | + key_rect.y + key_rect.h / 2.0, |
168 | + key_rect.x + key_rect.w / 2.0 + offset, |
169 | + key_rect.y + key_rect.h / 2.0, |
170 | + rate=2.77 * gu, time_between_events=2) |
171 | |
172 | def _keyboard_details_changed(self): |
173 | return self._orientation_changed() |
174 | |
175 | === modified file 'tests/autopilot/ubuntu_keyboard/emulators/keypad.py' |
176 | --- tests/autopilot/ubuntu_keyboard/emulators/keypad.py 2015-03-09 13:07:56 +0000 |
177 | +++ tests/autopilot/ubuntu_keyboard/emulators/keypad.py 2015-05-14 16:18:28 +0000 |
178 | @@ -1,7 +1,7 @@ |
179 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
180 | # |
181 | # Ubuntu Keyboard Test Suite |
182 | -# Copyright (C) 2013 Canonical |
183 | +# Copyright (C) 2013, 2015 Canonical |
184 | # |
185 | # This program is free software: you can redistribute it and/or modify |
186 | # it under the terms of the GNU General Public License as published by |
187 | @@ -17,10 +17,12 @@ |
188 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
189 | # |
190 | |
191 | -from ubuntu_keyboard.emulators import UbuntuKeyboardEmulatorBase |
192 | +import logging |
193 | + |
194 | +import ubuntuuitoolkit |
195 | + |
196 | from ubuntu_keyboard.emulators.key import Key |
197 | |
198 | -import logging |
199 | |
200 | logger = logging.getLogger(__name__) |
201 | |
202 | @@ -31,7 +33,7 @@ |
203 | CAPSLOCK = "CAPSLOCK" |
204 | |
205 | |
206 | -class KeyPad(UbuntuKeyboardEmulatorBase): |
207 | +class KeyPad(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase): |
208 | """A basic emulator that provides the details of the keys contained within. |
209 | |
210 | """ |
211 | @@ -45,9 +47,17 @@ |
212 | with key.no_automatic_refreshing(): |
213 | rect = key.globalRect |
214 | if key.leftSide: |
215 | - rect = (key.globalRect[0] + key.leftOffset, key.globalRect[1], key.globalRect[2] - key.leftOffset, key.globalRect[3]) |
216 | + rect = ( |
217 | + key.globalRect[0] + key.leftOffset, |
218 | + key.globalRect[1], |
219 | + key.globalRect[2] - key.leftOffset, |
220 | + key.globalRect[3]) |
221 | elif key.rightSide: |
222 | - rect = (key.globalRect[0], key.globalRect[1], key.globalRect[2] - key.rightOffset, key.globalRect[3]) |
223 | + rect = ( |
224 | + key.globalRect[0], |
225 | + key.globalRect[1], |
226 | + key.globalRect[2] - key.rightOffset, |
227 | + key.globalRect[3]) |
228 | key_pos = Key.Pos(*rect) |
229 | label = label_fn(key) |
230 | if label != '': |
231 | @@ -61,5 +71,6 @@ |
232 | _iter_keys("ActionKey", lambda x: x.action) |
233 | _iter_keys("ShiftKey", lambda x: x.action) |
234 | _iter_keys("LanguageKey", lambda x: x.action) |
235 | + _iter_keys("ReturnKey", lambda x: x.action) |
236 | |
237 | return (contained_keys, key_positions) |
238 | |
239 | === modified file 'tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py' |
240 | --- tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-04-14 10:19:18 +0000 |
241 | +++ tests/autopilot/ubuntu_keyboard/tests/test_keyboard.py 2015-05-14 16:18:28 +0000 |
242 | @@ -1,7 +1,7 @@ |
243 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
244 | # |
245 | # Ubuntu Keyboard Test Suite |
246 | -# Copyright (C) 2013 Canonical |
247 | +# Copyright (C) 2013, 2015 Canonical |
248 | # |
249 | # This program is free software: you can redistribute it and/or modify |
250 | # it under the terms of the GNU General Public License as published by |
251 | @@ -17,12 +17,11 @@ |
252 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
253 | # |
254 | |
255 | -import os, os.path |
256 | +import os |
257 | import shutil |
258 | import subprocess |
259 | import atexit |
260 | |
261 | -from testtools import skip |
262 | from testtools.matchers import Equals |
263 | import tempfile |
264 | from textwrap import dedent |
265 | @@ -30,7 +29,6 @@ |
266 | |
267 | from autopilot.testcase import AutopilotTestCase |
268 | from autopilot.input import Pointer, Touch |
269 | -from autopilot.introspection import get_proxy_object_for_existing_process |
270 | from autopilot.matchers import Eventually |
271 | from autopilot.platform import model |
272 | from ubuntuuitoolkit import base |
273 | @@ -50,23 +48,23 @@ |
274 | |
275 | @classmethod |
276 | def setUpClass(cls): |
277 | - #### FIXME: This is a work around re: lp:1238417 #### |
278 | + # FIXME: This is a work around re: lp:1238417 #### |
279 | if model() != "Desktop": |
280 | from autopilot.input import _uinput |
281 | _uinput._touch_device = _uinput.create_touch_device() |
282 | - #### |
283 | |
284 | def setUp(self): |
285 | if model() == "Desktop": |
286 | self.skipTest("Ubuntu Keyboard tests only run on device.") |
287 | super(UbuntuKeyboardTests, self).setUp() |
288 | self.set_test_settings() |
289 | - sleep(5) # Have to give time for gsettings change to propogate |
290 | + sleep(5) # Have to give time for gsettings change to propogate |
291 | self.pointer = Pointer(Touch.create()) |
292 | |
293 | def set_test_settings(self): |
294 | gsettings = Gio.Settings.new("com.canonical.keyboard.maliit") |
295 | - gsettings.set_strv("enabled-languages", ["en", "es", "de", "zh", "emoji"]) |
296 | + gsettings.set_strv( |
297 | + "enabled-languages", ["en", "es", "de", "zh", "emoji"]) |
298 | gsettings.set_string("active-language", "en") |
299 | gsettings.set_string("previous-language", "es") |
300 | gsettings.set_boolean("auto-capitalization", True) |
301 | @@ -219,7 +217,8 @@ |
302 | ] |
303 | |
304 | def test_can_type_string(self): |
305 | - text_area = self.launch_test_input_area(label=self.label, input_hints=['Qt.ImhNoPredictiveText']) |
306 | + text_area = self.launch_test_input_area( |
307 | + label=self.label, input_hints=['Qt.ImhNoPredictiveText']) |
308 | self.ensure_focus_on_input(text_area) |
309 | keyboard = Keyboard() |
310 | self.addCleanup(keyboard.dismiss) |
311 | @@ -235,7 +234,8 @@ |
312 | shifted/capitalised. |
313 | |
314 | """ |
315 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
316 | + text_area = self.launch_test_input_area( |
317 | + input_hints=['Qt.ImhNoPredictiveText']) |
318 | self.ensure_focus_on_input(text_area) |
319 | keyboard = Keyboard() |
320 | self.addCleanup(keyboard.dismiss) |
321 | @@ -254,7 +254,8 @@ |
322 | until the shift key is clicked again. |
323 | |
324 | """ |
325 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
326 | + text_area = self.launch_test_input_area( |
327 | + input_hints=['Qt.ImhNoPredictiveText']) |
328 | self.ensure_focus_on_input(text_area) |
329 | keyboard = Keyboard() |
330 | self.addCleanup(keyboard.dismiss) |
331 | @@ -276,7 +277,8 @@ |
332 | shift the keyboard back into the default state. |
333 | |
334 | """ |
335 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
336 | + text_area = self.launch_test_input_area( |
337 | + input_hints=['Qt.ImhNoPredictiveText']) |
338 | self.ensure_focus_on_input(text_area) |
339 | keyboard = Keyboard() |
340 | self.addCleanup(keyboard.dismiss) |
341 | @@ -301,7 +303,8 @@ |
342 | automatically enter the shifted state. |
343 | |
344 | """ |
345 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
346 | + text_area = self.launch_test_input_area( |
347 | + input_hints=['Qt.ImhNoPredictiveText']) |
348 | self.ensure_focus_on_input(text_area) |
349 | keyboard = Keyboard() |
350 | self.addCleanup(keyboard.dismiss) |
351 | @@ -322,7 +325,8 @@ |
352 | """After deleting a fullstop the keyboard should return to the normal |
353 | state. |
354 | """ |
355 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
356 | + text_area = self.launch_test_input_area( |
357 | + input_hints=['Qt.ImhNoPredictiveText']) |
358 | self.ensure_focus_on_input(text_area) |
359 | keyboard = Keyboard() |
360 | self.addCleanup(keyboard.dismiss) |
361 | @@ -344,7 +348,8 @@ |
362 | spaces and backspaces. |
363 | |
364 | """ |
365 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
366 | + text_area = self.launch_test_input_area( |
367 | + input_hints=['Qt.ImhNoPredictiveText']) |
368 | self.ensure_focus_on_input(text_area) |
369 | keyboard = Keyboard() |
370 | self.addCleanup(keyboard.dismiss) |
371 | @@ -403,7 +408,7 @@ |
372 | self.assertThat( |
373 | text_area.visibilityChangeCount, |
374 | Eventually(Equals(2)) |
375 | - ) |
376 | + ) |
377 | |
378 | |
379 | class UbuntuKeyboardInputTypeStateChange(UbuntuKeyboardTests): |
380 | @@ -468,7 +473,7 @@ |
381 | keyboard.press_key(".com") |
382 | else: |
383 | keyboard.type(self.text) |
384 | - |
385 | + |
386 | self.assertThat( |
387 | text_area.text, |
388 | Eventually(Equals(self.text)) |
389 | @@ -481,7 +486,8 @@ |
390 | """After tapping space twice a fullstop should be entered. |
391 | |
392 | """ |
393 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
394 | + text_area = self.launch_test_input_area( |
395 | + input_hints=['Qt.ImhNoPredictiveText']) |
396 | self.ensure_focus_on_input(text_area) |
397 | keyboard = Keyboard() |
398 | self.addCleanup(keyboard.dismiss) |
399 | @@ -495,8 +501,8 @@ |
400 | ) |
401 | |
402 | def test_override(self): |
403 | - """After typing 'i' followed by a space it should get auto-corrected to 'I' |
404 | - via the override mechanism. |
405 | + """After typing 'i' followed by a space it should get auto-corrected |
406 | + to 'I' via the override mechanism. |
407 | |
408 | """ |
409 | text_area = self.launch_test_input_area() |
410 | @@ -636,7 +642,7 @@ |
411 | keyboard.press_key('.', slide_offset=1) |
412 | keyboard.press_key('.', slide_offset=3.5 * gu) |
413 | keyboard.press_key('.', slide_offset=7 * gu) |
414 | - |
415 | + |
416 | keyboard.press_key(',', slide_offset=-10.5 * gu) |
417 | keyboard.press_key(',', slide_offset=-7 * gu) |
418 | keyboard.press_key(',', slide_offset=-3.5 * gu) |
419 | @@ -652,9 +658,8 @@ |
420 | Eventually(Equals(expected)) |
421 | ) |
422 | |
423 | - |
424 | def test_single_quotes(self): |
425 | - """Single quotes placed around a word shouldn't get removed by |
426 | + """Single quotes placed around a word shouldn't get removed by |
427 | autocomplete. |
428 | |
429 | """ |
430 | @@ -675,7 +680,7 @@ |
431 | class UbuntuKeyboardPinyin(UbuntuKeyboardTests): |
432 | |
433 | scenarios = [ |
434 | - ( |
435 | + ( |
436 | "Url", |
437 | dict( |
438 | label="Url", |
439 | @@ -683,7 +688,7 @@ |
440 | expected_activeview="url" |
441 | ) |
442 | ), |
443 | - ( |
444 | + ( |
445 | "Email", |
446 | dict( |
447 | label="Email", |
448 | @@ -719,8 +724,9 @@ |
449 | gsettings.set_boolean("double-space-full-stop", True) |
450 | |
451 | def test_pinyin(self): |
452 | - """Switching to Chinese should result in pinyin characters being entered |
453 | - via autocomplete regardless of layout or prediction being disabled. |
454 | + """Switching to Chinese should result in pinyin characters being |
455 | + entered via autocomplete regardless of layout or prediction being |
456 | + disabled. |
457 | |
458 | """ |
459 | text_area = self.launch_test_input_area(self.label, self.hints) |
460 | @@ -777,8 +783,9 @@ |
461 | class UbuntuKeyboardSelection(UbuntuKeyboardTests): |
462 | |
463 | def test_delete_selection(self): |
464 | - """Selecting a word and then pressing backspace should delete the world. |
465 | - |
466 | + """Selecting a word and then pressing backspace should delete the |
467 | + world. |
468 | + |
469 | """ |
470 | text_area = self.launch_test_input_area() |
471 | self.ensure_focus_on_input(text_area) |
472 | @@ -800,7 +807,8 @@ |
473 | ) |
474 | |
475 | def test_selection_focus(self): |
476 | - """Focusing on a field with selected text should leave the text unchanged. |
477 | + """Focusing on a field with selected text should leave the text |
478 | + unchanged. |
479 | |
480 | """ |
481 | text_area = self.launch_test_input_area() |
482 | @@ -959,12 +967,123 @@ |
483 | Eventually(Equals(expected)) |
484 | ) |
485 | |
486 | - |
487 | + |
488 | +class UbuntuKeyboardOxide(UbuntuKeyboardTests): |
489 | + |
490 | + def test_autocomplete(self): |
491 | + """Test that words are auto-completed when entered into an oxide text |
492 | + field. |
493 | + |
494 | + """ |
495 | + qml = dedent(""" |
496 | + import QtQuick 2.0 |
497 | + import Ubuntu.Components 1.1 |
498 | + import Ubuntu.Web 0.2 |
499 | + |
500 | + Rectangle { |
501 | + id: window |
502 | + objectName: "windowRectangle" |
503 | + color: "lightgrey" |
504 | + |
505 | + WebView { |
506 | + anchors.fill: parent |
507 | + objectName: "webview" |
508 | + Component.onCompleted: { |
509 | + loadHtml(" |
510 | + <html><body><textarea id='textarea' |
511 | + onkeyup=\\\"document.title= |
512 | + document.getElementById('textarea').value;\\\" |
513 | + style='width: 100%; height: 100%;'> |
514 | + </textarea></body></html>" |
515 | + ); |
516 | + } |
517 | + } |
518 | + } |
519 | + |
520 | + """) |
521 | + app = self._start_qml_script(qml) |
522 | + webview = app.select_single(objectName='webview') |
523 | + |
524 | + self.ensure_focus_on_input(webview) |
525 | + keyboard = Keyboard() |
526 | + self.addCleanup(keyboard.dismiss) |
527 | + |
528 | + keyboard.type('Pic ') |
529 | + |
530 | + expected = 'Picture' |
531 | + self.assertThat( |
532 | + webview.title, |
533 | + Eventually(Equals(expected)) |
534 | + ) |
535 | + |
536 | + def test_hiding(self): |
537 | + """Verify that the keyboard remains hidden after being dismissed from |
538 | + a field that is no longer enabled. |
539 | + |
540 | + """ |
541 | + qml = dedent(""" |
542 | + import QtQuick 2.0 |
543 | + import Ubuntu.Components 1.1 |
544 | + import Ubuntu.Web 0.2 |
545 | + |
546 | + Rectangle { |
547 | + id: window |
548 | + objectName: "windowRectangle" |
549 | + color: "lightgrey" |
550 | + |
551 | + WebView { |
552 | + anchors.fill: parent |
553 | + objectName: "webview" |
554 | + Component.onCompleted: { |
555 | + loadHtml(" |
556 | + <html><body><div id='scroll' style='width: 100%; |
557 | + height: 200%; position: absolute; background: green; |
558 | + visibility: hidden;'></div><input id='input' |
559 | + type='text' |
560 | + onkeyup=\\\"if (event.keyCode == 13) |
561 | + {document.getElementById('input').disabled=true; |
562 | + document.getElementById('scroll').style.visibility= |
563 | + 'visible';}\\\" style='width: 100%%; |
564 | + height: 100%%;' /></body></html>"); |
565 | + } |
566 | + } |
567 | + } |
568 | + |
569 | + """) |
570 | + app = self._start_qml_script(qml) |
571 | + webview = app.select_single(objectName='webview') |
572 | + |
573 | + self.ensure_focus_on_input(webview) |
574 | + keyboard = Keyboard() |
575 | + self.addCleanup(keyboard.dismiss) |
576 | + |
577 | + keyboard.type('Test\n') |
578 | + |
579 | + keyboard.dismiss() |
580 | + |
581 | + pointer = Pointer(Touch.create()) |
582 | + pointer.drag( |
583 | + webview.width / 2.0, |
584 | + webview.height / 2.0, |
585 | + webview.width / 2.0, |
586 | + webview.height / 2.0 + 100 |
587 | + ) |
588 | + |
589 | + self.assertThat( |
590 | + keyboard.is_available, |
591 | + Eventually(Equals(False)) |
592 | + ) |
593 | + |
594 | + |
595 | class UbuntuKeyboardPluginPaths(UbuntuKeyboardTests): |
596 | |
597 | def set_test_settings(self): |
598 | gsettings = Gio.Settings.new("com.canonical.keyboard.maliit") |
599 | - gsettings.set_strv("plugin-paths", ["/custom/share/maliit/plugins/com/ubuntu/lib", "/usr/share/maliit/tests/ubuntu-keyboard/"]) |
600 | + gsettings.set_strv( |
601 | + "plugin-paths", [ |
602 | + "/custom/share/maliit/plugins/com/ubuntu/lib", |
603 | + "/usr/share/maliit/tests/ubuntu-keyboard/" |
604 | + ]) |
605 | gsettings.set_strv("enabled-languages", ["en", "testlayout"]) |
606 | gsettings.set_string("previous-language", "testlayout") |
607 | gsettings.set_string("active-language", "testlayout") |
608 | @@ -978,7 +1097,8 @@ |
609 | """Test that typing works using a plugin loaded from a custom location. |
610 | |
611 | """ |
612 | - text_area = self.launch_test_input_area(input_hints=['Qt.ImhNoPredictiveText']) |
613 | + text_area = self.launch_test_input_area( |
614 | + input_hints=['Qt.ImhNoPredictiveText']) |
615 | self.ensure_focus_on_input(text_area) |
616 | keyboard = Keyboard() |
617 | self.addCleanup(keyboard.dismiss) |
618 | @@ -1009,7 +1129,6 @@ |
619 | |
620 | atexit.register(maliit_cleanup) |
621 | |
622 | -#### FIXME: Workaround re: lp:1248902 and lp:1248913 |
623 | +# FIXME: Workaround re: lp:1248902 and lp:1248913 |
624 | logger.debug("Waiting for maliit-server to be ready") |
625 | sleep(10) |
626 | -#### |
627 | |
628 | === modified file 'tools/overrides-from-hunspell.py' |
629 | --- tools/overrides-from-hunspell.py 2015-02-02 15:09:28 +0000 |
630 | +++ tools/overrides-from-hunspell.py 2015-05-14 16:18:28 +0000 |
631 | @@ -4,7 +4,9 @@ |
632 | import sys |
633 | |
634 | if len(sys.argv) != 3: |
635 | - print("Usage: ./overrides-from-hunspell /usr/share/hunspell/en_US.dic /usr/share/hunspell/en_US.aff") |
636 | + print( |
637 | + "Usage: ./overrides-from-hunspell /usr/share/hunspell/en_US.dic " |
638 | + "/usr/share/hunspell/en_US.aff") |
639 | sys.exit(1) |
640 | |
641 | hun = hunspell.HunSpell(sys.argv[1], sys.argv[2]) |
FAILED: Continuous integration, rev:347 jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- ci/577/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 2076 jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- vivid-amd64- ci/78 jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- vivid-armhf- ci/78 jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- vivid-armhf- ci/78/artifact/ work/output/ *zip*/output. zip jenkins. qa.ubuntu. com/job/ ubuntu- keyboard- vivid-i386- ci/78 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-mako/ 1828 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2074 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 2074/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 19340
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- keyboard- ci/577/ rebuild
http://