Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputMainFocusTrunk into lp:ubuntu-ui-toolkit

Proposed by Cris Dywan
Status: Rejected
Rejected by: Cris Dywan
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputMainFocusTrunk
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 122 lines (+69/-5)
2 files modified
src/Ubuntu/Components/1.3/InputHandler.qml (+1/-3)
tests/unit_x11/tst_components/tst_textinput_common13.qml (+68/-2)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inputMainFocusTrunk
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu SDK team Pending
Review via email: mp+294096@code.launchpad.net

Commit message

Text input focus must always follow main component

New tests assert that the OSK is shown.

To post a comment you must log in.
1315. By Cris Dywan

Text input focus must always follow main component

New tests assert that the OSK is shown.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1316. By Cris Dywan

Add unit tests for osk evokation

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

Unmerged revisions

1316. By Cris Dywan

Add unit tests for osk evokation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/Components/1.3/InputHandler.qml'
2--- src/Ubuntu/Components/1.3/InputHandler.qml 2016-04-25 10:45:41 +0000
3+++ src/Ubuntu/Components/1.3/InputHandler.qml 2016-05-11 10:54:26 +0000
4@@ -292,9 +292,7 @@
5 target: main
6 ignoreUnknownSignals: true
7 onActiveFocusChanged: {
8- if (!main.activeFocus) {
9- input.focus = false;
10- }
11+ input.focus = main.activeFocus;
12 }
13 onKeyNavigationFocusChanged: {
14 if (main.keyNavigationFocus) {
15
16=== modified file 'tests/unit_x11/tst_components/tst_textinput_common13.qml'
17--- tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-04-08 07:40:38 +0000
18+++ tests/unit_x11/tst_components/tst_textinput_common13.qml 2016-05-11 10:54:26 +0000
19@@ -23,7 +23,7 @@
20 Item {
21 id: testMain
22 width: units.gu(40)
23- height: units.gu(50)
24+ height: units.gu(70)
25
26 Component {
27 id: popoverComponent
28@@ -97,6 +97,33 @@
29 id: textField
30 }
31
32+ FocusScope {
33+ id: scope
34+ width: textFieldInMouseArea.implicitWidth
35+ height: textFieldInMouseArea.implicitHeight
36+ TextField {
37+ anchors.fill: parent
38+ id: textFieldInMouseArea
39+ text: 'Lorem ipsum dolor sit amet'
40+ color: UbuntuColors.blue
41+ }
42+ MouseArea {
43+ anchors.fill: parent
44+ enabled: !scope.activeFocus
45+ onClicked: {
46+ textFieldInMouseArea.forceActiveFocus()
47+ textFieldInMouseArea.selectAll()
48+ }
49+ UbuntuShape {
50+ anchors.fill: parent
51+ aspect: UbuntuShape.Flat
52+ backgroundColor: UbuntuColors.blue
53+ opacity: 0.1
54+ visible: parent.enabled
55+ }
56+ }
57+ }
58+
59 TextField {
60 id: customTextField
61 text: 'Lorem ipsum dolor sit amet'
62@@ -198,6 +225,11 @@
63 cursorRectSpy.clear();
64 scrollerSpy.clear();
65 escapePressedSpy.clear();
66+ // Hide OSK if showing
67+ UbuntuApplication.inputMethod.visible = false;
68+ // Dismiss popover if any
69+ mouseClick(testMain, testMain.width - units.gu(1), testMain.height - units.gu(1));
70+ waitForRendering(testMain);
71 }
72
73 function test_context_menu_items_data() {
74@@ -377,7 +409,7 @@
75 // dismiss popover
76 mouseClick(testMain, 0, 0);
77 // add some timeout to get the event buffer cleaned
78- wait(500);
79+ wait(500);
80 }
81
82 function test_clear_selection_on_click_data() {
83@@ -543,5 +575,39 @@
84 keyClick(Qt.Key_Escape);
85 compare(escapePressedSpy.count, 1);
86 }
87+
88+ function test_text_field_evokes_osk_data() {
89+ return [
90+ { tag: 'textField', input: textField },
91+ { tag: 'textField with icons', input: customTextField },
92+ { tag: 'textArea', input: textArea },
93+ { tag: 'focusScope', input: textFieldInMouseArea },
94+ ];
95+ }
96+ function test_text_field_evokes_osk(data) {
97+ mouseClick(data.input);
98+ waitForRendering(data.input);
99+ compare(data.input.activeFocus, true, 'TextField is focused');
100+ compare(UbuntuApplication.inputMethod.visible, true, 'OSK is visible');
101+ }
102+
103+ function test_text_field_evokes_osk_bug1545802_data() {
104+ return [
105+ { tag: 'textField', input: textField },
106+ { tag: 'textField with icons', input: customTextField },
107+ { tag: 'textArea', input: textArea },
108+ { tag: 'focusScope', input: textFieldInMouseArea },
109+ ];
110+ }
111+ function test_text_field_evokes_osk_bug1545802(data) {
112+ // FIXME: Figure out the CI failures and unskip, bug #1580538
113+ skip("This test fails on amd64-stable and i386-gles on CI and passes locally on amd64-devel.");
114+ waitForRendering(data.input);
115+ compare(data.input.activeFocus, false, 'TextField is not yet focused');
116+ mouseClick(data.input);
117+ waitForRendering(data.input);
118+ compare(data.input.activeFocus, true, 'TextField is focused');
119+ compare(UbuntuApplication.inputMethod.visible, true, 'OSK is visible');
120+ }
121 }
122 }

Subscribers

People subscribed via source and target branches

to status/vote changes: