Merge lp:~timo-jyrinki/ubuntu-ui-toolkit/drop_deprecated_pickerpanel_tests into lp:ubuntu-ui-toolkit

Proposed by Timo Jyrinki
Status: Needs review
Proposed branch: lp:~timo-jyrinki/ubuntu-ui-toolkit/drop_deprecated_pickerpanel_tests
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 253 lines (+0/-249)
1 file modified
tests/unit/visual/tst_pickerpanel.11.qml (+0/-249)
To merge this branch: bzr merge lp:~timo-jyrinki/ubuntu-ui-toolkit/drop_deprecated_pickerpanel_tests
Reviewer Review Type Date Requested Status
Ubuntu SDK team Pending
Review via email: mp+308724@code.launchpad.net

Commit message

Drop tst_pickerpanel.11.qml (deprecated)

To post a comment you must log in.

Unmerged revisions

1370. By Timo Jyrinki

Drop tst_pickerpanel.11.qml (deprecated)

1369. By Launchpad Translations on behalf of ubuntu-sdk-team

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'tests/unit/visual/tst_pickerpanel.11.qml'
--- tests/unit/visual/tst_pickerpanel.11.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_pickerpanel.11.qml 1970-01-01 00:00:00 +0000
@@ -1,249 +0,0 @@
1/*
2 * Copyright 2013 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import QtTest 1.0
19import Ubuntu.Test 1.0
20import Ubuntu.Components 1.1
21import Ubuntu.Components.Pickers 1.0
22
23Item {
24 id: testSuite
25 width: units.gu(40)
26 height: units.gu(71)
27
28 Flow {
29 anchors {
30 fill: parent
31 // give a margin so we can dismiss panels
32 topMargin: units.gu(4)
33 }
34
35 Button {
36 id: defaultMode
37 text: "defaultMode"
38 property date buttonDate: new Date()
39 property Item panel
40 onClicked: panel = PickerPanel.openDatePicker(defaultMode, "buttonDate")
41 }
42 Button {
43 id: modeSet
44 text: "modeSet"
45 property string mode
46 property date buttonDate: new Date()
47 property Item panel
48 onClicked: panel = PickerPanel.openDatePicker(modeSet, "buttonDate", mode)
49 }
50 }
51
52 SignalSpy {
53 id: closeSpy
54 signalName: "closed"
55 }
56
57 UbuntuTestCase {
58 name: "PickerPanelAPI"
59 when: windowShown
60
61 function initTestCase() {
62 waitForRendering(testSuite);
63 }
64
65 function test_0_clickOndefaultMode() {
66 mouseClick(defaultMode, units.gu(1), units.gu(1));
67 verify(defaultMode.panel !== null, "the picker is not opened");
68 verify(defaultMode.panel.picker !== null, "the DatePicker is not defined");
69 compare(defaultMode.panel.pickerMode, "Years|Months|Days", "the mode from the picker is not the default");
70 compare(defaultMode.panel.date, defaultMode.buttonDate, "the date from the picker differs from the button's");
71 compare(defaultMode.panel.caller, defaultMode, "wrong caller");
72 compare(defaultMode.panel.callerProperty, "buttonDate", "wrong callerProperty");
73 verify(defaultMode.panel.hasOwnProperty("closed"), "the object has no closed signal");
74
75 // dismiss
76 closeSpy.clear();
77 closeSpy.target = defaultMode.panel;
78 mouseClick(testSuite, units.gu(1), units.gu(1));
79 closeSpy.wait();
80 }
81
82 function test_1_modeSet_YM() {
83 modeSet.mode = "Years|Months" ;
84 mouseClick(modeSet, units.gu(1), units.gu(1));
85 verify(modeSet.panel !== null, "the picker is opened");
86 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
87 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
88 // check the number of pickers
89 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
90 compare(picker.children.length, 3, "there is not enough pickers in the panel");
91
92 // dismiss
93 closeSpy.clear();
94 closeSpy.target = modeSet.panel;
95 mouseClick(testSuite, units.gu(1), units.gu(1));
96 closeSpy.wait();
97 }
98
99 function test_1_modeSet_YD() {
100 ignoreWarning("Invalid DatePicker mode: Years|Days")
101 modeSet.mode = "Years|Days" ;
102 mouseClick(modeSet, units.gu(1), units.gu(1));
103 verify(modeSet.panel !== null, "the picker is opened");
104 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
105 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
106 // check the number of pickers
107 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
108 expectFailContinue("", "this mode is invalid");
109 compare(picker.children.length, 2, "there is not enough pickers in the panel");
110
111 // dismiss
112 closeSpy.clear();
113 closeSpy.target = modeSet.panel;
114 mouseClick(testSuite, units.gu(1), units.gu(1));
115 closeSpy.wait();
116 }
117
118 function test_1_modeSet_HMS() {
119 modeSet.mode = "Hours|Minutes|Seconds" ;
120 mouseClick(modeSet, units.gu(1), units.gu(1));
121 verify(modeSet.panel !== null, "the picker is opened");
122 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
123 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
124 // check the number of pickers
125 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
126 compare(picker.children.length, 4, "there is not enough pickers in the panel");
127
128 // dismiss
129 closeSpy.clear();
130 closeSpy.target = modeSet.panel;
131 mouseClick(testSuite, units.gu(1), units.gu(1));
132 closeSpy.wait();
133 }
134
135 function test_1_modeSet_HS() {
136 ignoreWarning("Invalid DatePicker mode: Hours|Seconds")
137 modeSet.mode = "Hours|Seconds" ;
138 mouseClick(modeSet, units.gu(1), units.gu(1));
139 verify(modeSet.panel !== null, "the picker is opened");
140 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
141 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
142 // check the number of pickers
143 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
144 expectFailContinue("", "this mode is invalid");
145 compare(picker.children.length, 2, "there is not enough pickers in the panel");
146
147 // dismiss
148 closeSpy.clear();
149 closeSpy.target = modeSet.panel;
150 mouseClick(testSuite, units.gu(1), units.gu(1));
151 closeSpy.wait();
152 }
153
154 // forced panel tests
155 // these should be executed as last ones
156 function test_2_clickOndefaultMode() {
157 // force panel - this is private specific!!!
158 var privates = findChild(PickerPanel, "PickerPanel_Internals");
159 privates.isPhone = true;
160
161 mouseClick(defaultMode, units.gu(1), units.gu(1));
162 verify(defaultMode.panel !== null, "the picker is not opened");
163 verify(defaultMode.panel.picker !== null, "the DatePicker is not defined");
164 compare(defaultMode.panel.pickerMode, "Years|Months|Days", "the mode from the picker is not the default");
165 compare(defaultMode.panel.date, defaultMode.buttonDate, "the date from the picker differs from the button's");
166 compare(defaultMode.panel.caller, defaultMode, "wrong caller");
167 compare(defaultMode.panel.callerProperty, "buttonDate", "wrong callerProperty");
168 verify(defaultMode.panel.hasOwnProperty("closed"), "the object has no closed signal");
169
170 // dismiss
171 closeSpy.clear();
172 closeSpy.target = defaultMode.panel;
173 mouseClick(testSuite, units.gu(1), units.gu(1));
174 closeSpy.wait();
175 }
176
177 function test_3_modeSet_YM() {
178 modeSet.mode = "Years|Months" ;
179 mouseClick(modeSet, units.gu(1), units.gu(1));
180 verify(modeSet.panel !== null, "the picker is opened");
181 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
182 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
183 // check the number of pickers
184 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
185 compare(picker.children.length, 3, "there is not enough pickers in the panel");
186
187 // dismiss
188 closeSpy.clear();
189 closeSpy.target = modeSet.panel;
190 mouseClick(testSuite, units.gu(1), units.gu(1));
191 closeSpy.wait();
192 }
193
194 function test_3_modeSet_YD() {
195 ignoreWarning("Invalid DatePicker mode: Years|Days")
196 modeSet.mode = "Years|Days" ;
197 mouseClick(modeSet, units.gu(1), units.gu(1));
198 verify(modeSet.panel !== null, "the picker is opened");
199 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
200 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
201 // check the number of pickers
202 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
203 expectFailContinue("", "this mode is invalid");
204 compare(picker.children.length, 2, "there is not enough pickers in the panel");
205
206 // dismiss
207 closeSpy.clear();
208 closeSpy.target = modeSet.panel;
209 mouseClick(testSuite, units.gu(1), units.gu(1));
210 closeSpy.wait();
211 }
212
213 function test_3_modeSet_HMS() {
214 modeSet.mode = "Hours|Minutes|Seconds" ;
215 mouseClick(modeSet, units.gu(1), units.gu(1));
216 verify(modeSet.panel !== null, "the picker is opened");
217 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
218 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
219 // check the number of pickers
220 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
221 compare(picker.children.length, 4, "there is not enough pickers in the panel");
222
223 // dismiss
224 closeSpy.clear();
225 closeSpy.target = modeSet.panel;
226 mouseClick(testSuite, units.gu(1), units.gu(1));
227 closeSpy.wait();
228 }
229
230 function test_3_modeSet_HS() {
231 ignoreWarning("Invalid DatePicker mode: Hours|Seconds")
232 modeSet.mode = "Hours|Seconds" ;
233 mouseClick(modeSet, units.gu(1), units.gu(1));
234 verify(modeSet.panel !== null, "the picker is opened");
235 compare(modeSet.panel.date, modeSet.buttonDate, "the date from the picker differs from the button's");
236 compare(modeSet.panel.pickerMode, modeSet.mode, "the mode from the picker differs from the button's");
237 // check the number of pickers
238 var picker = findChild(modeSet.panel.picker, "PickerRow_Positioner");
239 expectFailContinue("", "this mode is invalid");
240 compare(picker.children.length, 2, "there is not enough pickers in the panel");
241
242 // dismiss
243 closeSpy.clear();
244 closeSpy.target = modeSet.panel;
245 mouseClick(testSuite, units.gu(1), units.gu(1));
246 closeSpy.wait();
247 }
248 }
249}

Subscribers

People subscribed via source and target branches

to status/vote changes: