Merge lp:~rhuddie/ubuntu-autopilot-tests/video_playback_tests into lp:ubuntu-autopilot-tests
- video_playback_tests
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~rhuddie/ubuntu-autopilot-tests/video_playback_tests |
Merge into: | lp:ubuntu-autopilot-tests |
Diff against target: |
1871 lines (+1762/-0) (has conflicts) 19 files modified
.bzr-builddeb/default.conf (+2/-0) COPYING (+674/-0) README (+12/-0) debian/changelog (+48/-0) debian/compat (+1/-0) debian/control (+30/-0) debian/copyright (+28/-0) debian/rules (+16/-0) debian/source/format (+1/-0) setup.py (+35/-0) ubuntu_experience_tests/__init__.py (+17/-0) ubuntu_experience_tests/fixture_setup.py (+30/-0) ubuntu_experience_tests/helpers.py (+135/-0) ubuntu_experience_tests/tests/__init__.py (+36/-0) ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py (+58/-0) ubuntu_experience_tests/tests/multimedia/__init__.py (+38/-0) ubuntu_experience_tests/tests/multimedia/config.ini (+8/-0) ubuntu_experience_tests/tests/multimedia/test_video_playback.py (+537/-0) ubuntu_experience_tests/tests/test_fixture_setup.py (+56/-0) Conflict adding file debian. Moved existing file to debian.moved. Conflict adding file setup.py. Moved existing file to setup.py.moved. |
To merge this branch: | bzr merge lp:~rhuddie/ubuntu-autopilot-tests/video_playback_tests |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Testcase Admins | Pending | ||
Review via email: mp+240011@code.launchpad.net |
Commit message
Description of the change
A new test for playing videos in the mediaplayer-app and validating playback is working.
- 35. By Richard Huddie
-
change relative paths to run from tests directory
- 36. By Richard Huddie
-
update import paths
- 37. By Richard Huddie
-
Update default helpers methods and file path
- 38. By Richard Huddie
-
use parameters for defaults
- 39. By Richard Huddie
-
remove config file path and use default instead
- 40. By Richard Huddie
-
add __init__.py to samples dir
- 41. By Richard Huddie
-
add data_files to setup.py
- 42. By Richard Huddie
-
add file names
- 43. By Richard Huddie
-
use include_
package_ data - 44. By Richard Huddie
-
read boolean value from ini
- 45. By Richard Huddie
-
add MP4 and ini using package_data, exclude src types from video list
- 46. By Richard Huddie
-
remove unknown --fullscreen option
- 47. By Richard Huddie
-
change base class and tidy
Unmerged revisions
- 47. By Richard Huddie
-
change base class and tidy
- 46. By Richard Huddie
-
remove unknown --fullscreen option
- 45. By Richard Huddie
-
add MP4 and ini using package_data, exclude src types from video list
- 44. By Richard Huddie
-
read boolean value from ini
- 43. By Richard Huddie
-
use include_
package_ data - 42. By Richard Huddie
-
add file names
- 41. By Richard Huddie
-
add data_files to setup.py
- 40. By Richard Huddie
-
add __init__.py to samples dir
- 39. By Richard Huddie
-
remove config file path and use default instead
- 38. By Richard Huddie
-
use parameters for defaults
Preview Diff
1 | === added directory '.bzr-builddeb' |
2 | === added file '.bzr-builddeb/default.conf' |
3 | --- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000 |
4 | +++ .bzr-builddeb/default.conf 2014-10-29 15:00:49 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +[BUILDDEB] |
7 | +split = True |
8 | |
9 | === added file 'COPYING' |
10 | --- COPYING 1970-01-01 00:00:00 +0000 |
11 | +++ COPYING 2014-10-29 15:00:49 +0000 |
12 | @@ -0,0 +1,674 @@ |
13 | + GNU GENERAL PUBLIC LICENSE |
14 | + Version 3, 29 June 2007 |
15 | + |
16 | + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> |
17 | + Everyone is permitted to copy and distribute verbatim copies |
18 | + of this license document, but changing it is not allowed. |
19 | + |
20 | + Preamble |
21 | + |
22 | + The GNU General Public License is a free, copyleft license for |
23 | +software and other kinds of works. |
24 | + |
25 | + The licenses for most software and other practical works are designed |
26 | +to take away your freedom to share and change the works. By contrast, |
27 | +the GNU General Public License is intended to guarantee your freedom to |
28 | +share and change all versions of a program--to make sure it remains free |
29 | +software for all its users. We, the Free Software Foundation, use the |
30 | +GNU General Public License for most of our software; it applies also to |
31 | +any other work released this way by its authors. You can apply it to |
32 | +your programs, too. |
33 | + |
34 | + When we speak of free software, we are referring to freedom, not |
35 | +price. Our General Public Licenses are designed to make sure that you |
36 | +have the freedom to distribute copies of free software (and charge for |
37 | +them if you wish), that you receive source code or can get it if you |
38 | +want it, that you can change the software or use pieces of it in new |
39 | +free programs, and that you know you can do these things. |
40 | + |
41 | + To protect your rights, we need to prevent others from denying you |
42 | +these rights or asking you to surrender the rights. Therefore, you have |
43 | +certain responsibilities if you distribute copies of the software, or if |
44 | +you modify it: responsibilities to respect the freedom of others. |
45 | + |
46 | + For example, if you distribute copies of such a program, whether |
47 | +gratis or for a fee, you must pass on to the recipients the same |
48 | +freedoms that you received. You must make sure that they, too, receive |
49 | +or can get the source code. And you must show them these terms so they |
50 | +know their rights. |
51 | + |
52 | + Developers that use the GNU GPL protect your rights with two steps: |
53 | +(1) assert copyright on the software, and (2) offer you this License |
54 | +giving you legal permission to copy, distribute and/or modify it. |
55 | + |
56 | + For the developers' and authors' protection, the GPL clearly explains |
57 | +that there is no warranty for this free software. For both users' and |
58 | +authors' sake, the GPL requires that modified versions be marked as |
59 | +changed, so that their problems will not be attributed erroneously to |
60 | +authors of previous versions. |
61 | + |
62 | + Some devices are designed to deny users access to install or run |
63 | +modified versions of the software inside them, although the manufacturer |
64 | +can do so. This is fundamentally incompatible with the aim of |
65 | +protecting users' freedom to change the software. The systematic |
66 | +pattern of such abuse occurs in the area of products for individuals to |
67 | +use, which is precisely where it is most unacceptable. Therefore, we |
68 | +have designed this version of the GPL to prohibit the practice for those |
69 | +products. If such problems arise substantially in other domains, we |
70 | +stand ready to extend this provision to those domains in future versions |
71 | +of the GPL, as needed to protect the freedom of users. |
72 | + |
73 | + Finally, every program is threatened constantly by software patents. |
74 | +States should not allow patents to restrict development and use of |
75 | +software on general-purpose computers, but in those that do, we wish to |
76 | +avoid the special danger that patents applied to a free program could |
77 | +make it effectively proprietary. To prevent this, the GPL assures that |
78 | +patents cannot be used to render the program non-free. |
79 | + |
80 | + The precise terms and conditions for copying, distribution and |
81 | +modification follow. |
82 | + |
83 | + TERMS AND CONDITIONS |
84 | + |
85 | + 0. Definitions. |
86 | + |
87 | + "This License" refers to version 3 of the GNU General Public License. |
88 | + |
89 | + "Copyright" also means copyright-like laws that apply to other kinds of |
90 | +works, such as semiconductor masks. |
91 | + |
92 | + "The Program" refers to any copyrightable work licensed under this |
93 | +License. Each licensee is addressed as "you". "Licensees" and |
94 | +"recipients" may be individuals or organizations. |
95 | + |
96 | + To "modify" a work means to copy from or adapt all or part of the work |
97 | +in a fashion requiring copyright permission, other than the making of an |
98 | +exact copy. The resulting work is called a "modified version" of the |
99 | +earlier work or a work "based on" the earlier work. |
100 | + |
101 | + A "covered work" means either the unmodified Program or a work based |
102 | +on the Program. |
103 | + |
104 | + To "propagate" a work means to do anything with it that, without |
105 | +permission, would make you directly or secondarily liable for |
106 | +infringement under applicable copyright law, except executing it on a |
107 | +computer or modifying a private copy. Propagation includes copying, |
108 | +distribution (with or without modification), making available to the |
109 | +public, and in some countries other activities as well. |
110 | + |
111 | + To "convey" a work means any kind of propagation that enables other |
112 | +parties to make or receive copies. Mere interaction with a user through |
113 | +a computer network, with no transfer of a copy, is not conveying. |
114 | + |
115 | + An interactive user interface displays "Appropriate Legal Notices" |
116 | +to the extent that it includes a convenient and prominently visible |
117 | +feature that (1) displays an appropriate copyright notice, and (2) |
118 | +tells the user that there is no warranty for the work (except to the |
119 | +extent that warranties are provided), that licensees may convey the |
120 | +work under this License, and how to view a copy of this License. If |
121 | +the interface presents a list of user commands or options, such as a |
122 | +menu, a prominent item in the list meets this criterion. |
123 | + |
124 | + 1. Source Code. |
125 | + |
126 | + The "source code" for a work means the preferred form of the work |
127 | +for making modifications to it. "Object code" means any non-source |
128 | +form of a work. |
129 | + |
130 | + A "Standard Interface" means an interface that either is an official |
131 | +standard defined by a recognized standards body, or, in the case of |
132 | +interfaces specified for a particular programming language, one that |
133 | +is widely used among developers working in that language. |
134 | + |
135 | + The "System Libraries" of an executable work include anything, other |
136 | +than the work as a whole, that (a) is included in the normal form of |
137 | +packaging a Major Component, but which is not part of that Major |
138 | +Component, and (b) serves only to enable use of the work with that |
139 | +Major Component, or to implement a Standard Interface for which an |
140 | +implementation is available to the public in source code form. A |
141 | +"Major Component", in this context, means a major essential component |
142 | +(kernel, window system, and so on) of the specific operating system |
143 | +(if any) on which the executable work runs, or a compiler used to |
144 | +produce the work, or an object code interpreter used to run it. |
145 | + |
146 | + The "Corresponding Source" for a work in object code form means all |
147 | +the source code needed to generate, install, and (for an executable |
148 | +work) run the object code and to modify the work, including scripts to |
149 | +control those activities. However, it does not include the work's |
150 | +System Libraries, or general-purpose tools or generally available free |
151 | +programs which are used unmodified in performing those activities but |
152 | +which are not part of the work. For example, Corresponding Source |
153 | +includes interface definition files associated with source files for |
154 | +the work, and the source code for shared libraries and dynamically |
155 | +linked subprograms that the work is specifically designed to require, |
156 | +such as by intimate data communication or control flow between those |
157 | +subprograms and other parts of the work. |
158 | + |
159 | + The Corresponding Source need not include anything that users |
160 | +can regenerate automatically from other parts of the Corresponding |
161 | +Source. |
162 | + |
163 | + The Corresponding Source for a work in source code form is that |
164 | +same work. |
165 | + |
166 | + 2. Basic Permissions. |
167 | + |
168 | + All rights granted under this License are granted for the term of |
169 | +copyright on the Program, and are irrevocable provided the stated |
170 | +conditions are met. This License explicitly affirms your unlimited |
171 | +permission to run the unmodified Program. The output from running a |
172 | +covered work is covered by this License only if the output, given its |
173 | +content, constitutes a covered work. This License acknowledges your |
174 | +rights of fair use or other equivalent, as provided by copyright law. |
175 | + |
176 | + You may make, run and propagate covered works that you do not |
177 | +convey, without conditions so long as your license otherwise remains |
178 | +in force. You may convey covered works to others for the sole purpose |
179 | +of having them make modifications exclusively for you, or provide you |
180 | +with facilities for running those works, provided that you comply with |
181 | +the terms of this License in conveying all material for which you do |
182 | +not control copyright. Those thus making or running the covered works |
183 | +for you must do so exclusively on your behalf, under your direction |
184 | +and control, on terms that prohibit them from making any copies of |
185 | +your copyrighted material outside their relationship with you. |
186 | + |
187 | + Conveying under any other circumstances is permitted solely under |
188 | +the conditions stated below. Sublicensing is not allowed; section 10 |
189 | +makes it unnecessary. |
190 | + |
191 | + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. |
192 | + |
193 | + No covered work shall be deemed part of an effective technological |
194 | +measure under any applicable law fulfilling obligations under article |
195 | +11 of the WIPO copyright treaty adopted on 20 December 1996, or |
196 | +similar laws prohibiting or restricting circumvention of such |
197 | +measures. |
198 | + |
199 | + When you convey a covered work, you waive any legal power to forbid |
200 | +circumvention of technological measures to the extent such circumvention |
201 | +is effected by exercising rights under this License with respect to |
202 | +the covered work, and you disclaim any intention to limit operation or |
203 | +modification of the work as a means of enforcing, against the work's |
204 | +users, your or third parties' legal rights to forbid circumvention of |
205 | +technological measures. |
206 | + |
207 | + 4. Conveying Verbatim Copies. |
208 | + |
209 | + You may convey verbatim copies of the Program's source code as you |
210 | +receive it, in any medium, provided that you conspicuously and |
211 | +appropriately publish on each copy an appropriate copyright notice; |
212 | +keep intact all notices stating that this License and any |
213 | +non-permissive terms added in accord with section 7 apply to the code; |
214 | +keep intact all notices of the absence of any warranty; and give all |
215 | +recipients a copy of this License along with the Program. |
216 | + |
217 | + You may charge any price or no price for each copy that you convey, |
218 | +and you may offer support or warranty protection for a fee. |
219 | + |
220 | + 5. Conveying Modified Source Versions. |
221 | + |
222 | + You may convey a work based on the Program, or the modifications to |
223 | +produce it from the Program, in the form of source code under the |
224 | +terms of section 4, provided that you also meet all of these conditions: |
225 | + |
226 | + a) The work must carry prominent notices stating that you modified |
227 | + it, and giving a relevant date. |
228 | + |
229 | + b) The work must carry prominent notices stating that it is |
230 | + released under this License and any conditions added under section |
231 | + 7. This requirement modifies the requirement in section 4 to |
232 | + "keep intact all notices". |
233 | + |
234 | + c) You must license the entire work, as a whole, under this |
235 | + License to anyone who comes into possession of a copy. This |
236 | + License will therefore apply, along with any applicable section 7 |
237 | + additional terms, to the whole of the work, and all its parts, |
238 | + regardless of how they are packaged. This License gives no |
239 | + permission to license the work in any other way, but it does not |
240 | + invalidate such permission if you have separately received it. |
241 | + |
242 | + d) If the work has interactive user interfaces, each must display |
243 | + Appropriate Legal Notices; however, if the Program has interactive |
244 | + interfaces that do not display Appropriate Legal Notices, your |
245 | + work need not make them do so. |
246 | + |
247 | + A compilation of a covered work with other separate and independent |
248 | +works, which are not by their nature extensions of the covered work, |
249 | +and which are not combined with it such as to form a larger program, |
250 | +in or on a volume of a storage or distribution medium, is called an |
251 | +"aggregate" if the compilation and its resulting copyright are not |
252 | +used to limit the access or legal rights of the compilation's users |
253 | +beyond what the individual works permit. Inclusion of a covered work |
254 | +in an aggregate does not cause this License to apply to the other |
255 | +parts of the aggregate. |
256 | + |
257 | + 6. Conveying Non-Source Forms. |
258 | + |
259 | + You may convey a covered work in object code form under the terms |
260 | +of sections 4 and 5, provided that you also convey the |
261 | +machine-readable Corresponding Source under the terms of this License, |
262 | +in one of these ways: |
263 | + |
264 | + a) Convey the object code in, or embodied in, a physical product |
265 | + (including a physical distribution medium), accompanied by the |
266 | + Corresponding Source fixed on a durable physical medium |
267 | + customarily used for software interchange. |
268 | + |
269 | + b) Convey the object code in, or embodied in, a physical product |
270 | + (including a physical distribution medium), accompanied by a |
271 | + written offer, valid for at least three years and valid for as |
272 | + long as you offer spare parts or customer support for that product |
273 | + model, to give anyone who possesses the object code either (1) a |
274 | + copy of the Corresponding Source for all the software in the |
275 | + product that is covered by this License, on a durable physical |
276 | + medium customarily used for software interchange, for a price no |
277 | + more than your reasonable cost of physically performing this |
278 | + conveying of source, or (2) access to copy the |
279 | + Corresponding Source from a network server at no charge. |
280 | + |
281 | + c) Convey individual copies of the object code with a copy of the |
282 | + written offer to provide the Corresponding Source. This |
283 | + alternative is allowed only occasionally and noncommercially, and |
284 | + only if you received the object code with such an offer, in accord |
285 | + with subsection 6b. |
286 | + |
287 | + d) Convey the object code by offering access from a designated |
288 | + place (gratis or for a charge), and offer equivalent access to the |
289 | + Corresponding Source in the same way through the same place at no |
290 | + further charge. You need not require recipients to copy the |
291 | + Corresponding Source along with the object code. If the place to |
292 | + copy the object code is a network server, the Corresponding Source |
293 | + may be on a different server (operated by you or a third party) |
294 | + that supports equivalent copying facilities, provided you maintain |
295 | + clear directions next to the object code saying where to find the |
296 | + Corresponding Source. Regardless of what server hosts the |
297 | + Corresponding Source, you remain obligated to ensure that it is |
298 | + available for as long as needed to satisfy these requirements. |
299 | + |
300 | + e) Convey the object code using peer-to-peer transmission, provided |
301 | + you inform other peers where the object code and Corresponding |
302 | + Source of the work are being offered to the general public at no |
303 | + charge under subsection 6d. |
304 | + |
305 | + A separable portion of the object code, whose source code is excluded |
306 | +from the Corresponding Source as a System Library, need not be |
307 | +included in conveying the object code work. |
308 | + |
309 | + A "User Product" is either (1) a "consumer product", which means any |
310 | +tangible personal property which is normally used for personal, family, |
311 | +or household purposes, or (2) anything designed or sold for incorporation |
312 | +into a dwelling. In determining whether a product is a consumer product, |
313 | +doubtful cases shall be resolved in favor of coverage. For a particular |
314 | +product received by a particular user, "normally used" refers to a |
315 | +typical or common use of that class of product, regardless of the status |
316 | +of the particular user or of the way in which the particular user |
317 | +actually uses, or expects or is expected to use, the product. A product |
318 | +is a consumer product regardless of whether the product has substantial |
319 | +commercial, industrial or non-consumer uses, unless such uses represent |
320 | +the only significant mode of use of the product. |
321 | + |
322 | + "Installation Information" for a User Product means any methods, |
323 | +procedures, authorization keys, or other information required to install |
324 | +and execute modified versions of a covered work in that User Product from |
325 | +a modified version of its Corresponding Source. The information must |
326 | +suffice to ensure that the continued functioning of the modified object |
327 | +code is in no case prevented or interfered with solely because |
328 | +modification has been made. |
329 | + |
330 | + If you convey an object code work under this section in, or with, or |
331 | +specifically for use in, a User Product, and the conveying occurs as |
332 | +part of a transaction in which the right of possession and use of the |
333 | +User Product is transferred to the recipient in perpetuity or for a |
334 | +fixed term (regardless of how the transaction is characterized), the |
335 | +Corresponding Source conveyed under this section must be accompanied |
336 | +by the Installation Information. But this requirement does not apply |
337 | +if neither you nor any third party retains the ability to install |
338 | +modified object code on the User Product (for example, the work has |
339 | +been installed in ROM). |
340 | + |
341 | + The requirement to provide Installation Information does not include a |
342 | +requirement to continue to provide support service, warranty, or updates |
343 | +for a work that has been modified or installed by the recipient, or for |
344 | +the User Product in which it has been modified or installed. Access to a |
345 | +network may be denied when the modification itself materially and |
346 | +adversely affects the operation of the network or violates the rules and |
347 | +protocols for communication across the network. |
348 | + |
349 | + Corresponding Source conveyed, and Installation Information provided, |
350 | +in accord with this section must be in a format that is publicly |
351 | +documented (and with an implementation available to the public in |
352 | +source code form), and must require no special password or key for |
353 | +unpacking, reading or copying. |
354 | + |
355 | + 7. Additional Terms. |
356 | + |
357 | + "Additional permissions" are terms that supplement the terms of this |
358 | +License by making exceptions from one or more of its conditions. |
359 | +Additional permissions that are applicable to the entire Program shall |
360 | +be treated as though they were included in this License, to the extent |
361 | +that they are valid under applicable law. If additional permissions |
362 | +apply only to part of the Program, that part may be used separately |
363 | +under those permissions, but the entire Program remains governed by |
364 | +this License without regard to the additional permissions. |
365 | + |
366 | + When you convey a copy of a covered work, you may at your option |
367 | +remove any additional permissions from that copy, or from any part of |
368 | +it. (Additional permissions may be written to require their own |
369 | +removal in certain cases when you modify the work.) You may place |
370 | +additional permissions on material, added by you to a covered work, |
371 | +for which you have or can give appropriate copyright permission. |
372 | + |
373 | + Notwithstanding any other provision of this License, for material you |
374 | +add to a covered work, you may (if authorized by the copyright holders of |
375 | +that material) supplement the terms of this License with terms: |
376 | + |
377 | + a) Disclaiming warranty or limiting liability differently from the |
378 | + terms of sections 15 and 16 of this License; or |
379 | + |
380 | + b) Requiring preservation of specified reasonable legal notices or |
381 | + author attributions in that material or in the Appropriate Legal |
382 | + Notices displayed by works containing it; or |
383 | + |
384 | + c) Prohibiting misrepresentation of the origin of that material, or |
385 | + requiring that modified versions of such material be marked in |
386 | + reasonable ways as different from the original version; or |
387 | + |
388 | + d) Limiting the use for publicity purposes of names of licensors or |
389 | + authors of the material; or |
390 | + |
391 | + e) Declining to grant rights under trademark law for use of some |
392 | + trade names, trademarks, or service marks; or |
393 | + |
394 | + f) Requiring indemnification of licensors and authors of that |
395 | + material by anyone who conveys the material (or modified versions of |
396 | + it) with contractual assumptions of liability to the recipient, for |
397 | + any liability that these contractual assumptions directly impose on |
398 | + those licensors and authors. |
399 | + |
400 | + All other non-permissive additional terms are considered "further |
401 | +restrictions" within the meaning of section 10. If the Program as you |
402 | +received it, or any part of it, contains a notice stating that it is |
403 | +governed by this License along with a term that is a further |
404 | +restriction, you may remove that term. If a license document contains |
405 | +a further restriction but permits relicensing or conveying under this |
406 | +License, you may add to a covered work material governed by the terms |
407 | +of that license document, provided that the further restriction does |
408 | +not survive such relicensing or conveying. |
409 | + |
410 | + If you add terms to a covered work in accord with this section, you |
411 | +must place, in the relevant source files, a statement of the |
412 | +additional terms that apply to those files, or a notice indicating |
413 | +where to find the applicable terms. |
414 | + |
415 | + Additional terms, permissive or non-permissive, may be stated in the |
416 | +form of a separately written license, or stated as exceptions; |
417 | +the above requirements apply either way. |
418 | + |
419 | + 8. Termination. |
420 | + |
421 | + You may not propagate or modify a covered work except as expressly |
422 | +provided under this License. Any attempt otherwise to propagate or |
423 | +modify it is void, and will automatically terminate your rights under |
424 | +this License (including any patent licenses granted under the third |
425 | +paragraph of section 11). |
426 | + |
427 | + However, if you cease all violation of this License, then your |
428 | +license from a particular copyright holder is reinstated (a) |
429 | +provisionally, unless and until the copyright holder explicitly and |
430 | +finally terminates your license, and (b) permanently, if the copyright |
431 | +holder fails to notify you of the violation by some reasonable means |
432 | +prior to 60 days after the cessation. |
433 | + |
434 | + Moreover, your license from a particular copyright holder is |
435 | +reinstated permanently if the copyright holder notifies you of the |
436 | +violation by some reasonable means, this is the first time you have |
437 | +received notice of violation of this License (for any work) from that |
438 | +copyright holder, and you cure the violation prior to 30 days after |
439 | +your receipt of the notice. |
440 | + |
441 | + Termination of your rights under this section does not terminate the |
442 | +licenses of parties who have received copies or rights from you under |
443 | +this License. If your rights have been terminated and not permanently |
444 | +reinstated, you do not qualify to receive new licenses for the same |
445 | +material under section 10. |
446 | + |
447 | + 9. Acceptance Not Required for Having Copies. |
448 | + |
449 | + You are not required to accept this License in order to receive or |
450 | +run a copy of the Program. Ancillary propagation of a covered work |
451 | +occurring solely as a consequence of using peer-to-peer transmission |
452 | +to receive a copy likewise does not require acceptance. However, |
453 | +nothing other than this License grants you permission to propagate or |
454 | +modify any covered work. These actions infringe copyright if you do |
455 | +not accept this License. Therefore, by modifying or propagating a |
456 | +covered work, you indicate your acceptance of this License to do so. |
457 | + |
458 | + 10. Automatic Licensing of Downstream Recipients. |
459 | + |
460 | + Each time you convey a covered work, the recipient automatically |
461 | +receives a license from the original licensors, to run, modify and |
462 | +propagate that work, subject to this License. You are not responsible |
463 | +for enforcing compliance by third parties with this License. |
464 | + |
465 | + An "entity transaction" is a transaction transferring control of an |
466 | +organization, or substantially all assets of one, or subdividing an |
467 | +organization, or merging organizations. If propagation of a covered |
468 | +work results from an entity transaction, each party to that |
469 | +transaction who receives a copy of the work also receives whatever |
470 | +licenses to the work the party's predecessor in interest had or could |
471 | +give under the previous paragraph, plus a right to possession of the |
472 | +Corresponding Source of the work from the predecessor in interest, if |
473 | +the predecessor has it or can get it with reasonable efforts. |
474 | + |
475 | + You may not impose any further restrictions on the exercise of the |
476 | +rights granted or affirmed under this License. For example, you may |
477 | +not impose a license fee, royalty, or other charge for exercise of |
478 | +rights granted under this License, and you may not initiate litigation |
479 | +(including a cross-claim or counterclaim in a lawsuit) alleging that |
480 | +any patent claim is infringed by making, using, selling, offering for |
481 | +sale, or importing the Program or any portion of it. |
482 | + |
483 | + 11. Patents. |
484 | + |
485 | + A "contributor" is a copyright holder who authorizes use under this |
486 | +License of the Program or a work on which the Program is based. The |
487 | +work thus licensed is called the contributor's "contributor version". |
488 | + |
489 | + A contributor's "essential patent claims" are all patent claims |
490 | +owned or controlled by the contributor, whether already acquired or |
491 | +hereafter acquired, that would be infringed by some manner, permitted |
492 | +by this License, of making, using, or selling its contributor version, |
493 | +but do not include claims that would be infringed only as a |
494 | +consequence of further modification of the contributor version. For |
495 | +purposes of this definition, "control" includes the right to grant |
496 | +patent sublicenses in a manner consistent with the requirements of |
497 | +this License. |
498 | + |
499 | + Each contributor grants you a non-exclusive, worldwide, royalty-free |
500 | +patent license under the contributor's essential patent claims, to |
501 | +make, use, sell, offer for sale, import and otherwise run, modify and |
502 | +propagate the contents of its contributor version. |
503 | + |
504 | + In the following three paragraphs, a "patent license" is any express |
505 | +agreement or commitment, however denominated, not to enforce a patent |
506 | +(such as an express permission to practice a patent or covenant not to |
507 | +sue for patent infringement). To "grant" such a patent license to a |
508 | +party means to make such an agreement or commitment not to enforce a |
509 | +patent against the party. |
510 | + |
511 | + If you convey a covered work, knowingly relying on a patent license, |
512 | +and the Corresponding Source of the work is not available for anyone |
513 | +to copy, free of charge and under the terms of this License, through a |
514 | +publicly available network server or other readily accessible means, |
515 | +then you must either (1) cause the Corresponding Source to be so |
516 | +available, or (2) arrange to deprive yourself of the benefit of the |
517 | +patent license for this particular work, or (3) arrange, in a manner |
518 | +consistent with the requirements of this License, to extend the patent |
519 | +license to downstream recipients. "Knowingly relying" means you have |
520 | +actual knowledge that, but for the patent license, your conveying the |
521 | +covered work in a country, or your recipient's use of the covered work |
522 | +in a country, would infringe one or more identifiable patents in that |
523 | +country that you have reason to believe are valid. |
524 | + |
525 | + If, pursuant to or in connection with a single transaction or |
526 | +arrangement, you convey, or propagate by procuring conveyance of, a |
527 | +covered work, and grant a patent license to some of the parties |
528 | +receiving the covered work authorizing them to use, propagate, modify |
529 | +or convey a specific copy of the covered work, then the patent license |
530 | +you grant is automatically extended to all recipients of the covered |
531 | +work and works based on it. |
532 | + |
533 | + A patent license is "discriminatory" if it does not include within |
534 | +the scope of its coverage, prohibits the exercise of, or is |
535 | +conditioned on the non-exercise of one or more of the rights that are |
536 | +specifically granted under this License. You may not convey a covered |
537 | +work if you are a party to an arrangement with a third party that is |
538 | +in the business of distributing software, under which you make payment |
539 | +to the third party based on the extent of your activity of conveying |
540 | +the work, and under which the third party grants, to any of the |
541 | +parties who would receive the covered work from you, a discriminatory |
542 | +patent license (a) in connection with copies of the covered work |
543 | +conveyed by you (or copies made from those copies), or (b) primarily |
544 | +for and in connection with specific products or compilations that |
545 | +contain the covered work, unless you entered into that arrangement, |
546 | +or that patent license was granted, prior to 28 March 2007. |
547 | + |
548 | + Nothing in this License shall be construed as excluding or limiting |
549 | +any implied license or other defenses to infringement that may |
550 | +otherwise be available to you under applicable patent law. |
551 | + |
552 | + 12. No Surrender of Others' Freedom. |
553 | + |
554 | + If conditions are imposed on you (whether by court order, agreement or |
555 | +otherwise) that contradict the conditions of this License, they do not |
556 | +excuse you from the conditions of this License. If you cannot convey a |
557 | +covered work so as to satisfy simultaneously your obligations under this |
558 | +License and any other pertinent obligations, then as a consequence you may |
559 | +not convey it at all. For example, if you agree to terms that obligate you |
560 | +to collect a royalty for further conveying from those to whom you convey |
561 | +the Program, the only way you could satisfy both those terms and this |
562 | +License would be to refrain entirely from conveying the Program. |
563 | + |
564 | + 13. Use with the GNU Affero General Public License. |
565 | + |
566 | + Notwithstanding any other provision of this License, you have |
567 | +permission to link or combine any covered work with a work licensed |
568 | +under version 3 of the GNU Affero General Public License into a single |
569 | +combined work, and to convey the resulting work. The terms of this |
570 | +License will continue to apply to the part which is the covered work, |
571 | +but the special requirements of the GNU Affero General Public License, |
572 | +section 13, concerning interaction through a network will apply to the |
573 | +combination as such. |
574 | + |
575 | + 14. Revised Versions of this License. |
576 | + |
577 | + The Free Software Foundation may publish revised and/or new versions of |
578 | +the GNU General Public License from time to time. Such new versions will |
579 | +be similar in spirit to the present version, but may differ in detail to |
580 | +address new problems or concerns. |
581 | + |
582 | + Each version is given a distinguishing version number. If the |
583 | +Program specifies that a certain numbered version of the GNU General |
584 | +Public License "or any later version" applies to it, you have the |
585 | +option of following the terms and conditions either of that numbered |
586 | +version or of any later version published by the Free Software |
587 | +Foundation. If the Program does not specify a version number of the |
588 | +GNU General Public License, you may choose any version ever published |
589 | +by the Free Software Foundation. |
590 | + |
591 | + If the Program specifies that a proxy can decide which future |
592 | +versions of the GNU General Public License can be used, that proxy's |
593 | +public statement of acceptance of a version permanently authorizes you |
594 | +to choose that version for the Program. |
595 | + |
596 | + Later license versions may give you additional or different |
597 | +permissions. However, no additional obligations are imposed on any |
598 | +author or copyright holder as a result of your choosing to follow a |
599 | +later version. |
600 | + |
601 | + 15. Disclaimer of Warranty. |
602 | + |
603 | + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY |
604 | +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT |
605 | +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY |
606 | +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, |
607 | +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
608 | +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM |
609 | +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF |
610 | +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. |
611 | + |
612 | + 16. Limitation of Liability. |
613 | + |
614 | + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING |
615 | +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS |
616 | +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY |
617 | +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE |
618 | +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF |
619 | +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD |
620 | +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), |
621 | +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF |
622 | +SUCH DAMAGES. |
623 | + |
624 | + 17. Interpretation of Sections 15 and 16. |
625 | + |
626 | + If the disclaimer of warranty and limitation of liability provided |
627 | +above cannot be given local legal effect according to their terms, |
628 | +reviewing courts shall apply local law that most closely approximates |
629 | +an absolute waiver of all civil liability in connection with the |
630 | +Program, unless a warranty or assumption of liability accompanies a |
631 | +copy of the Program in return for a fee. |
632 | + |
633 | + END OF TERMS AND CONDITIONS |
634 | + |
635 | + How to Apply These Terms to Your New Programs |
636 | + |
637 | + If you develop a new program, and you want it to be of the greatest |
638 | +possible use to the public, the best way to achieve this is to make it |
639 | +free software which everyone can redistribute and change under these terms. |
640 | + |
641 | + To do so, attach the following notices to the program. It is safest |
642 | +to attach them to the start of each source file to most effectively |
643 | +state the exclusion of warranty; and each file should have at least |
644 | +the "copyright" line and a pointer to where the full notice is found. |
645 | + |
646 | + <one line to give the program's name and a brief idea of what it does.> |
647 | + Copyright (C) <year> <name of author> |
648 | + |
649 | + This program is free software: you can redistribute it and/or modify |
650 | + it under the terms of the GNU General Public License as published by |
651 | + the Free Software Foundation, either version 3 of the License, or |
652 | + (at your option) any later version. |
653 | + |
654 | + This program is distributed in the hope that it will be useful, |
655 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
656 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
657 | + GNU General Public License for more details. |
658 | + |
659 | + You should have received a copy of the GNU General Public License |
660 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
661 | + |
662 | +Also add information on how to contact you by electronic and paper mail. |
663 | + |
664 | + If the program does terminal interaction, make it output a short |
665 | +notice like this when it starts in an interactive mode: |
666 | + |
667 | + <program> Copyright (C) <year> <name of author> |
668 | + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. |
669 | + This is free software, and you are welcome to redistribute it |
670 | + under certain conditions; type `show c' for details. |
671 | + |
672 | +The hypothetical commands `show w' and `show c' should show the appropriate |
673 | +parts of the General Public License. Of course, your program's commands |
674 | +might be different; for a GUI interface, you would use an "about box". |
675 | + |
676 | + You should also get your employer (if you work as a programmer) or school, |
677 | +if any, to sign a "copyright disclaimer" for the program, if necessary. |
678 | +For more information on this, and how to apply and follow the GNU GPL, see |
679 | +<http://www.gnu.org/licenses/>. |
680 | + |
681 | + The GNU General Public License does not permit incorporating your program |
682 | +into proprietary programs. If your program is a subroutine library, you |
683 | +may consider it more useful to permit linking proprietary applications with |
684 | +the library. If this is what you want to do, use the GNU Lesser General |
685 | +Public License instead of this License. But first, please read |
686 | +<http://www.gnu.org/philosophy/why-not-lgpl.html>. |
687 | |
688 | === added file 'README' |
689 | --- README 1970-01-01 00:00:00 +0000 |
690 | +++ README 2014-10-29 15:00:49 +0000 |
691 | @@ -0,0 +1,12 @@ |
692 | +Directory structure for user experience test cases should be |
693 | + |
694 | + ubuntu_experience_tests/ |
695 | + |--tests |
696 | + |----<AppName> |
697 | + |------test_<app_name>.py |
698 | + |
699 | +Class name in test_<app_name>.py should be |
700 | + |
701 | +class <AppNameTestCase>: |
702 | + |
703 | +One py module file can contain multiple user experience test cases. |
704 | |
705 | === added directory 'debian' |
706 | === renamed directory 'debian' => 'debian.moved' |
707 | === added file 'debian/changelog' |
708 | --- debian/changelog 1970-01-01 00:00:00 +0000 |
709 | +++ debian/changelog 2014-10-29 15:00:49 +0000 |
710 | @@ -0,0 +1,48 @@ |
711 | +ubuntu-experience-tests (0.1+14.10.20140808-0ubuntu1) utopic; urgency=low |
712 | + |
713 | + [ Nicholas Skaggs ] |
714 | + * (no message) |
715 | + |
716 | + [ Omer Akram ] |
717 | + * first commit to include integration tests and debian structure |
718 | + * style changes: debial/control |
719 | + * make the module installation such a way so that we can create |
720 | + different deb packages our of this source |
721 | + * separate out helper functions into a seprate module to be consumed |
722 | + by others |
723 | + * make the testsuite architecture independant |
724 | + * update header files |
725 | + * depend on dialer-app |
726 | + * also depend on uitoolkit-autopilot |
727 | + * we are using emulators from unity8, depend on its autopilot package |
728 | + * add docstring to make it clear what the helper function does |
729 | + * added tests for the environment fixtures |
730 | + |
731 | + [ Dan Chapman ] |
732 | + * Merge: Brendan Donegan 2014-06-19 Fix call to get_vcard_uid |
733 | + |
734 | + [ Leo Arias ] |
735 | + * Added flake8 check to the debian package. |
736 | + * Update the environment to use the helpers from the toolkit. |
737 | + * Cleaned up the test to use the helpers from the dialer app. |
738 | + * Added readme file describing the directory structure and class name |
739 | + format when adding new tests. |
740 | + * Test that online accounts launched with url dispatcher can be swiped |
741 | + into background. |
742 | + * skiptest is a typo in test_osd_dialer_integration.py, should be |
743 | + skipTest |
744 | + * Ported package to python3. Removed dialer tests for now, because it |
745 | + is python2. |
746 | + * Fix a couple of minor issues that slipped in with the |
747 | + ContactsDbusService branch. |
748 | + * Fixed the packaging to install ubuntu_experience_tests as a py3 |
749 | + library. |
750 | + * Updated the test to take into account the new dash app. |
751 | + |
752 | + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 08 Aug 2014 08:15:15 +0000 |
753 | + |
754 | +ubuntu-experience-tests (0.1-0ubuntu1) utopic; urgency=medium |
755 | + |
756 | + * Initial release. (Closes: #1353842) |
757 | + |
758 | + -- Leonardo Arias Fonseca <leo.arias@canonical.com> Thu, 07 Aug 2014 00:36:42 -0600 |
759 | |
760 | === added file 'debian/compat' |
761 | --- debian/compat 1970-01-01 00:00:00 +0000 |
762 | +++ debian/compat 2014-10-29 15:00:49 +0000 |
763 | @@ -0,0 +1,1 @@ |
764 | +9 |
765 | |
766 | === added file 'debian/control' |
767 | --- debian/control 1970-01-01 00:00:00 +0000 |
768 | +++ debian/control 2014-10-29 15:00:49 +0000 |
769 | @@ -0,0 +1,30 @@ |
770 | +Source: ubuntu-experience-tests |
771 | +Section: utils |
772 | +Priority: optional |
773 | +Maintainer: Ubuntu Quality Team <ubuntu-quality@lists.ubuntu.com> |
774 | +Build-Depends: debhelper (>= 9.0.0), |
775 | + dh-python, |
776 | + pyflakes, |
777 | + python3-all, |
778 | + python3-pep8, |
779 | + python3-setuptools, |
780 | +Standards-Version: 3.9.5 |
781 | +Homepage: https://launchpad.net/ubuntu-autopilot-tests/ |
782 | +Vcs-bzr: lp:ubuntu-autopilot-tests/ubuntu-experience-tests |
783 | +X-Python3-Version: >= 3.2 |
784 | + |
785 | +Package: ubuntu-experience-tests |
786 | +Architecture: all |
787 | +Depends: ${misc:Depends}, |
788 | + ${python3:Depends}, |
789 | + ${shlibs:Depends}, |
790 | + python3-autopilot, |
791 | + ubuntu-ui-toolkit-autopilot, |
792 | + unity8-autopilot, |
793 | + url-dispatcher-tools, |
794 | + mediaplayer-app-autopilot, |
795 | + python3-evdev, |
796 | + imagemagick, |
797 | +Description: Ubuntu user experience Autopilot tests |
798 | + This package provides a set of autopilot tests for testing |
799 | + the inter-app integration under Unity8 |
800 | |
801 | === added file 'debian/copyright' |
802 | --- debian/copyright 1970-01-01 00:00:00 +0000 |
803 | +++ debian/copyright 2014-10-29 15:00:49 +0000 |
804 | @@ -0,0 +1,28 @@ |
805 | +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ |
806 | +Upstream-Name: ubuntu-experience-tests |
807 | +Source: https://code.launchpad.net/ubuntu-autopilot-tests/ubuntu-experience-tests |
808 | + |
809 | +Files: * |
810 | +Copyright: 2013 Ubuntu Quality Team <ubuntu-quality@lists.ubuntu.com> |
811 | +License: GPL-3.0+ |
812 | + |
813 | +Files: debian/* |
814 | +Copyright: 2013 Ubuntu Quality Team <ubuntu-quality@lists.ubuntu.com> |
815 | +License: GPL-3.0+ |
816 | + |
817 | +License: GPL-3.0+ |
818 | + This program is free software: you can redistribute it and/or modify |
819 | + it under the terms of the GNU General Public License as published by |
820 | + the Free Software Foundation, either version 3 of the License, or |
821 | + (at your option) any later version. |
822 | + . |
823 | + This package is distributed in the hope that it will be useful, |
824 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
825 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
826 | + GNU General Public License for more details. |
827 | + . |
828 | + You should have received a copy of the GNU General Public License |
829 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
830 | + . |
831 | + On Debian systems, the complete text of the GNU General |
832 | + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". |
833 | |
834 | === added file 'debian/rules' |
835 | --- debian/rules 1970-01-01 00:00:00 +0000 |
836 | +++ debian/rules 2014-10-29 15:00:49 +0000 |
837 | @@ -0,0 +1,16 @@ |
838 | +#!/usr/bin/make -f |
839 | +# -*- makefile -*- |
840 | + |
841 | +# Uncomment this to turn on verbose mode. |
842 | +#export DH_VERBOSE=1 |
843 | +export PYBUILD_NAME=ubuntu_experience_tests |
844 | + |
845 | +%: |
846 | + dh $@ --with python3 --buildsystem pybuild |
847 | + |
848 | +override_dh_auto_test: |
849 | + python3 -m pep8 ubuntu_experience_tests/ |
850 | + pyflakes3 ubuntu_experience_tests/ |
851 | + |
852 | +override_dh_install: |
853 | + dh_install --fail-missing |
854 | |
855 | === added directory 'debian/source' |
856 | === added file 'debian/source/format' |
857 | --- debian/source/format 1970-01-01 00:00:00 +0000 |
858 | +++ debian/source/format 2014-10-29 15:00:49 +0000 |
859 | @@ -0,0 +1,1 @@ |
860 | +1.0 |
861 | |
862 | === added file 'setup.py' |
863 | --- setup.py 1970-01-01 00:00:00 +0000 |
864 | +++ setup.py 2014-10-29 15:00:49 +0000 |
865 | @@ -0,0 +1,35 @@ |
866 | +#!/usr/bin/env python3 |
867 | + |
868 | +# Copyright 2014 Canonical Ltd. |
869 | +# |
870 | +# This file is part of ubuntu-experience-tests. |
871 | +# |
872 | +# This program is free software; you can redistribute it and/or modify |
873 | +# it under the terms of the GNU General Public License version 3, as published |
874 | +# by the Free Software Foundation. |
875 | +# |
876 | +# This program is distributed in the hope that it will be useful, |
877 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
878 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
879 | +# GNU General Public License for more details. |
880 | +# |
881 | +# You should have received a copy of the GNU General Public License |
882 | +# along with this program. If not, see <http://www.gnu.org/licenses |
883 | + |
884 | +import setuptools |
885 | + |
886 | + |
887 | +VERSION = '1.0' |
888 | + |
889 | + |
890 | +setuptools.setup( |
891 | + name='ubuntu_experience_tests', |
892 | + version=VERSION, |
893 | + description='Ubuntu user experience Autopilot tests.', |
894 | + author='Ubuntu Engineering QA Team', |
895 | + author_email='qa-team@lists.canonical.com', |
896 | + url='https://launchpad.net/ubuntu-autopilot-tests/ubuntu-experience-tests', |
897 | + license='GPLv3', |
898 | + packages=setuptools.find_packages(), |
899 | + test_suite='ubuntu_experience_tests.tests', |
900 | +) |
901 | |
902 | === renamed file 'setup.py' => 'setup.py.moved' |
903 | === added directory 'ubuntu_experience_tests' |
904 | === added file 'ubuntu_experience_tests/__init__.py' |
905 | --- ubuntu_experience_tests/__init__.py 1970-01-01 00:00:00 +0000 |
906 | +++ ubuntu_experience_tests/__init__.py 2014-10-29 15:00:49 +0000 |
907 | @@ -0,0 +1,17 @@ |
908 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
909 | +# |
910 | +# Copyright 2014 Canonical Ltd. |
911 | +# |
912 | +# This file is part of ubuntu-experience-tests. |
913 | +# |
914 | +# This program is free software; you can redistribute it and/or modify |
915 | +# it under the terms of the GNU General Public License version 3, as published |
916 | +# by the Free Software Foundation. |
917 | +# |
918 | +# This program is distributed in the hope that it will be useful, |
919 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
920 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
921 | +# GNU General Public License for more details. |
922 | +# |
923 | +# You should have received a copy of the GNU General Public License |
924 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
925 | |
926 | === added file 'ubuntu_experience_tests/fixture_setup.py' |
927 | --- ubuntu_experience_tests/fixture_setup.py 1970-01-01 00:00:00 +0000 |
928 | +++ ubuntu_experience_tests/fixture_setup.py 2014-10-29 15:00:49 +0000 |
929 | @@ -0,0 +1,30 @@ |
930 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
931 | +# |
932 | +# Copyright 2014 Canonical Ltd. |
933 | +# Author: Omer Akram <omer.akram@canonical.com> |
934 | +# |
935 | +# This file is part of ubuntu-experience-tests. |
936 | +# |
937 | +# This program is free software; you can redistribute it and/or modify |
938 | +# it under the terms of the GNU General Public License version 3, as published |
939 | +# by the Free Software Foundation. |
940 | +# |
941 | +# This program is distributed in the hope that it will be useful, |
942 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
943 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
944 | +# GNU General Public License for more details. |
945 | +# |
946 | +# You should have received a copy of the GNU General Public License |
947 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
948 | + |
949 | +"""Set up and clean up fixtures for the Inter-app integration tests.""" |
950 | + |
951 | + |
952 | +from ubuntuuitoolkit import fixture_setup as toolkit_fixtures |
953 | + |
954 | + |
955 | +class TestabilityEnvironment(toolkit_fixtures.InitctlEnvironmentVariable): |
956 | + """Setup the testabilty environment.""" |
957 | + |
958 | + def __init__(self): |
959 | + super(TestabilityEnvironment, self).__init__(QT_LOAD_TESTABILITY=1) |
960 | |
961 | === added file 'ubuntu_experience_tests/helpers.py' |
962 | --- ubuntu_experience_tests/helpers.py 1970-01-01 00:00:00 +0000 |
963 | +++ ubuntu_experience_tests/helpers.py 2014-10-29 15:00:49 +0000 |
964 | @@ -0,0 +1,135 @@ |
965 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
966 | +# |
967 | +# Copyright 2014 Canonical Ltd. |
968 | +# Author: Omer Akram <omer.akram@canonical.com> |
969 | +# Brendan Donegan <brendan.donegan@canonical.com> |
970 | +# |
971 | +# This file is part of ubuntu-experience-tests. |
972 | +# |
973 | +# This program is free software; you can redistribute it and/or modify |
974 | +# it under the terms of the GNU General Public License version 3, as published |
975 | +# by the Free Software Foundation. |
976 | +# |
977 | +# This program is distributed in the hope that it will be useful, |
978 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
979 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
980 | +# GNU General Public License for more details. |
981 | +# |
982 | +# You should have received a copy of the GNU General Public License |
983 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
984 | + |
985 | +"""Helper functions to make writing Inter-app integration tests easier.""" |
986 | + |
987 | +import dbus |
988 | +import re |
989 | +import subprocess |
990 | +import time |
991 | + |
992 | +from autopilot.introspection import get_proxy_object_for_existing_process |
993 | +from ubuntuuitoolkit import emulators as toolkit_emulators |
994 | +from unity8.shell.emulators import UnityEmulatorBase |
995 | + |
996 | +DBUS_IFACE_ADD_BOOK = 'com.canonical.pim.AddressBook' |
997 | +DBUS_IFACE_ADD_BOOKVIEW = 'com.canonical.pim.AddressBookView' |
998 | + |
999 | + |
1000 | +class ContactsDbusService(object): |
1001 | + def __init__(self): |
1002 | + self.bus = None |
1003 | + self.addr = None |
1004 | + self.addr_iface = None |
1005 | + self.bus = dbus.SessionBus() |
1006 | + self.addr = self.bus.get_object( |
1007 | + 'com.canonical.pim', '/com/canonical/pim/AddressBook') |
1008 | + self.addr_iface = dbus.Interface( |
1009 | + self.addr, dbus_interface=DBUS_IFACE_ADD_BOOK) |
1010 | + |
1011 | + def query_contacts(self, fields='', query='', sources=[]): |
1012 | + view_path = self.addr_iface.query(fields, query, []) |
1013 | + view = self.bus.get_object( |
1014 | + 'com.canonical.pim', view_path) |
1015 | + view_iface = dbus.Interface( |
1016 | + view, dbus_interface=DBUS_IFACE_ADD_BOOKVIEW) |
1017 | + contacts = view_iface.contactsDetails([], 0, -1) |
1018 | + view.close() |
1019 | + return contacts |
1020 | + |
1021 | + def update_contact(self, vcard): |
1022 | + return self.addr_iface.updateContacts([vcard]) |
1023 | + |
1024 | + def create_contact(self, vcard): |
1025 | + return self.addr_iface.createContact(vcard, "") |
1026 | + |
1027 | + def delete_contact(self, ids): |
1028 | + return self.addr_iface.removeContacts(ids) |
1029 | + |
1030 | + def get_vcard_uid(self, vcard): |
1031 | + """ |
1032 | + Return the UID of the provided vcard |
1033 | + :param vcard: vcard formatted data |
1034 | + :return: uid value from vcard, else None |
1035 | + """ |
1036 | + uid_pattern = re.compile(r''' |
1037 | + ^ # start of string |
1038 | + .* # any characters |
1039 | + UID:(.*?) # UID value, saved to group, non-greedy |
1040 | + \r\n # new line |
1041 | + .* # anything else |
1042 | + $ # end of string |
1043 | + ''', re.VERBOSE | re.IGNORECASE | re.DOTALL) |
1044 | + uid = None |
1045 | + match = uid_pattern.match(vcard) |
1046 | + if match: |
1047 | + uid = match.group(1) |
1048 | + return uid |
1049 | + |
1050 | + def delete_all_contacts(self): |
1051 | + """ |
1052 | + Delete all contacts using the dbus service |
1053 | + """ |
1054 | + uids = [] |
1055 | + contacts = self.query_contacts() |
1056 | + for contact in contacts: |
1057 | + uid = self.get_vcard_uid(contact) |
1058 | + if uid: |
1059 | + uids.append(uid) |
1060 | + self.delete_contact(uids) |
1061 | + |
1062 | + |
1063 | +def get_proxy_object_by_process_name(proc_name): |
1064 | + """Helper function to return proxy object of a process |
1065 | + |
1066 | + :param proc_name: Name of the running application process with testability |
1067 | + driver loaded. |
1068 | + :returns: Proxy object for the given process using emulator base from |
1069 | + ubuntuuittoolkit and in case proc_name is unity8 use UnityEmulatorBase. |
1070 | + :raises: RuntimeError if process is not found to be running after |
1071 | + 10 seconds. |
1072 | + |
1073 | + """ |
1074 | + return get_proxy_object_for_existing_process( |
1075 | + _get_pid_by_name(proc_name), |
1076 | + emulator_base=_get_emulator_base(proc_name) |
1077 | + ) |
1078 | + |
1079 | + |
1080 | +def _get_pid_by_name(proc_name): |
1081 | + for i in range(10): |
1082 | + try: |
1083 | + return int( |
1084 | + subprocess.check_output(['pidof', proc_name]).strip()) |
1085 | + except subprocess.CalledProcessError: |
1086 | + # application not started yet, check in a second |
1087 | + time.sleep(1) |
1088 | + else: |
1089 | + raise RuntimeError( |
1090 | + 'Could not find autopilot interface for {} after 10' |
1091 | + 'seconds'.format(proc_name) |
1092 | + ) |
1093 | + |
1094 | + |
1095 | +def _get_emulator_base(proc_name): |
1096 | + if proc_name == 'unity8': |
1097 | + return UnityEmulatorBase |
1098 | + else: |
1099 | + return toolkit_emulators.UbuntuUIToolkitEmulatorBase |
1100 | |
1101 | === added directory 'ubuntu_experience_tests/tests' |
1102 | === added file 'ubuntu_experience_tests/tests/__init__.py' |
1103 | --- ubuntu_experience_tests/tests/__init__.py 1970-01-01 00:00:00 +0000 |
1104 | +++ ubuntu_experience_tests/tests/__init__.py 2014-10-29 15:00:49 +0000 |
1105 | @@ -0,0 +1,36 @@ |
1106 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1107 | +# |
1108 | +# Copyright 2014 Canonical Ltd. |
1109 | +# Author: Omer Akram <omer.akram@canonical.com> |
1110 | +# |
1111 | +# This file is part of ubuntu-experience-tests. |
1112 | +# |
1113 | +# This program is free software; you can redistribute it and/or modify |
1114 | +# it under the terms of the GNU General Public License version 3, as published |
1115 | +# by the Free Software Foundation. |
1116 | +# |
1117 | +# This program is distributed in the hope that it will be useful, |
1118 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1119 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1120 | +# GNU General Public License for more details. |
1121 | +# |
1122 | +# You should have received a copy of the GNU General Public License |
1123 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
1124 | + |
1125 | +from autopilot.input import Touch, Pointer |
1126 | +from unity8.shell import tests as unity_tests |
1127 | +from unity8.shell.emulators import main_window |
1128 | + |
1129 | +from unity8 import process_helpers |
1130 | + |
1131 | + |
1132 | +class UbuntuExperienceTestCase(unity_tests.UnityTestCase): |
1133 | + |
1134 | + def setUp(self): |
1135 | + super(UbuntuExperienceTestCase, self).setUp() |
1136 | + self.pointing_device = Pointer(Touch.create()) |
1137 | + self._qml_mock_enabled = False |
1138 | + self._data_dirs_mock_enabled = False |
1139 | + self.unity_proxy = self.launch_unity() |
1140 | + process_helpers.unlock_unity(self.unity_proxy) |
1141 | + self.unity = self.unity_proxy.select_single(main_window.QQuickView) |
1142 | |
1143 | === added directory 'ubuntu_experience_tests/tests/application_life_cycle' |
1144 | === added file 'ubuntu_experience_tests/tests/application_life_cycle/__init__.py' |
1145 | === added file 'ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py' |
1146 | --- ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py 1970-01-01 00:00:00 +0000 |
1147 | +++ ubuntu_experience_tests/tests/application_life_cycle/test_url_dispatcher.py 2014-10-29 15:00:49 +0000 |
1148 | @@ -0,0 +1,58 @@ |
1149 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1150 | +# |
1151 | +# Copyright (C) 2014 Canonical Ltd. |
1152 | +# |
1153 | +# This file is part of ubuntu-integration-tests. |
1154 | +# |
1155 | +# ubuntu-integration-tests is free software; you can redistribute it and/or |
1156 | +# modify it under the terms of the GNU General Public License as published by |
1157 | +# the Free Software Foundation; version 3. |
1158 | +# |
1159 | +# This program is distributed in the hope that it will be useful, |
1160 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1161 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1162 | +# GNU Lesser General Public License for more details. |
1163 | +# |
1164 | +# You should have received a copy of the GNU General Public License |
1165 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1166 | + |
1167 | +import os |
1168 | +import subprocess |
1169 | + |
1170 | +from autopilot import platform |
1171 | +from autopilot.matchers import Eventually |
1172 | +from testtools.matchers import Equals |
1173 | + |
1174 | +from ubuntu_experience_tests import tests |
1175 | + |
1176 | + |
1177 | +class URLDispatcherTestCase(tests.UbuntuExperienceTestCase): |
1178 | + |
1179 | + def setUp(self): |
1180 | + super(URLDispatcherTestCase, self).setUp() |
1181 | + if platform.model() == 'Desktop': |
1182 | + self.skipTest('URL dispatcher does not work on the desktop.') |
1183 | + |
1184 | + def test_swipe_out_online_accounts_launched_with_url_dispatcher(self): |
1185 | + """Test online accounts launched with URL Dispatcher. |
1186 | + |
1187 | + Check that the application can be swiped out showing the dashboard and |
1188 | + no focused application. |
1189 | + |
1190 | + """ |
1191 | + self.assertEqual( |
1192 | + 'unity8-dash', self.unity.get_current_focused_app_id()) |
1193 | + self.addCleanup(os.system, 'pkill system-settings') |
1194 | + self.addCleanup(os.system, 'pkill online-accounts') |
1195 | + |
1196 | + subprocess.check_call( |
1197 | + ['url-dispatcher', 'settings:///system/online-accounts']) |
1198 | + |
1199 | + self.assertThat( |
1200 | + self.unity.get_current_focused_app_id, |
1201 | + Eventually(Equals('online-accounts-ui'))) |
1202 | + |
1203 | + self.unity.show_dash_swiping() |
1204 | + self.assertThat( |
1205 | + self.unity.get_current_focused_app_id, |
1206 | + Eventually(Equals('unity8-dash'))) |
1207 | |
1208 | === added directory 'ubuntu_experience_tests/tests/multimedia' |
1209 | === added file 'ubuntu_experience_tests/tests/multimedia/__init__.py' |
1210 | --- ubuntu_experience_tests/tests/multimedia/__init__.py 1970-01-01 00:00:00 +0000 |
1211 | +++ ubuntu_experience_tests/tests/multimedia/__init__.py 2014-10-29 15:00:49 +0000 |
1212 | @@ -0,0 +1,38 @@ |
1213 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1214 | +# |
1215 | +# Copyright 2014 Canonical Ltd. |
1216 | +# |
1217 | +# This file is part of ubuntu-experience-tests. |
1218 | +# |
1219 | +# This program is free software; you can redistribute it and/or modify |
1220 | +# it under the terms of the GNU General Public License version 3, as published |
1221 | +# by the Free Software Foundation. |
1222 | +# |
1223 | +# This program is distributed in the hope that it will be useful, |
1224 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1225 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1226 | +# GNU General Public License for more details. |
1227 | +# |
1228 | +# You should have received a copy of the GNU General Public License |
1229 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
1230 | + |
1231 | + |
1232 | +import os |
1233 | + |
1234 | +CONFIG_FILE = 'config.ini' |
1235 | +SAMPLES_DIR = 'video_samples' |
1236 | + |
1237 | + |
1238 | +def _get_current_dir(): |
1239 | + """Return the current dir path""" |
1240 | + return os.path.dirname(__file__) |
1241 | + |
1242 | + |
1243 | +def get_config_file(): |
1244 | + """Return the path for the config file""" |
1245 | + return os.path.join(_get_current_dir(), CONFIG_FILE) |
1246 | + |
1247 | + |
1248 | +def get_samples_dir(): |
1249 | + """Return the path for the samples dir""" |
1250 | + return os.path.join(_get_current_dir(), SAMPLES_DIR) |
1251 | |
1252 | === added file 'ubuntu_experience_tests/tests/multimedia/config.ini' |
1253 | --- ubuntu_experience_tests/tests/multimedia/config.ini 1970-01-01 00:00:00 +0000 |
1254 | +++ ubuntu_experience_tests/tests/multimedia/config.ini 2014-10-29 15:00:49 +0000 |
1255 | @@ -0,0 +1,8 @@ |
1256 | +[default] |
1257 | +sample-dir = ./multimedia/video_samples |
1258 | +sample-file = |
1259 | +sample-interval-sec = 0.5 |
1260 | +sample-check-count = 3 |
1261 | +timeout = 10 |
1262 | +run-all = |
1263 | + |
1264 | |
1265 | === added file 'ubuntu_experience_tests/tests/multimedia/test_video_playback.py' |
1266 | --- ubuntu_experience_tests/tests/multimedia/test_video_playback.py 1970-01-01 00:00:00 +0000 |
1267 | +++ ubuntu_experience_tests/tests/multimedia/test_video_playback.py 2014-10-29 15:00:49 +0000 |
1268 | @@ -0,0 +1,537 @@ |
1269 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1270 | +# |
1271 | +# Copyright 2014 Canonical Ltd. |
1272 | +# |
1273 | +# This file is part of ubuntu-experience-tests. |
1274 | +# |
1275 | +# This program is free software; you can redistribute it and/or modify |
1276 | +# it under the terms of the GNU General Public License version 3, as published |
1277 | +# by the Free Software Foundation. |
1278 | +# |
1279 | +# This program is distributed in the hope that it will be useful, |
1280 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1281 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1282 | +# GNU General Public License for more details. |
1283 | +# |
1284 | +# You should have received a copy of the GNU General Public License |
1285 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
1286 | + |
1287 | +import os |
1288 | +import subprocess |
1289 | +import time |
1290 | +import tempfile |
1291 | +import re |
1292 | +import configparser |
1293 | +from threading import Timer |
1294 | +from collections import deque |
1295 | + |
1296 | +from autopilot.testcase import AutopilotTestCase |
1297 | +from autopilot.matchers import Eventually |
1298 | +from testtools.matchers import Equals |
1299 | +from autopilot.display import Display |
1300 | +from ubuntuuitoolkit import emulators as toolkit_emulators |
1301 | +from mediaplayer_app.emulators.main_window import MainWindow |
1302 | +from autopilot import get_test_configuration |
1303 | +from multimedia import get_config_file |
1304 | +from multimedia import get_samples_dir |
1305 | + |
1306 | + |
1307 | +class ConfigData: |
1308 | + """Class to read config data from file and cmd line options""" |
1309 | + |
1310 | + # config keys |
1311 | + KEY_SAMPLE_DIR = 'sample-dir' |
1312 | + KEY_SAMPLE_FILE = 'sample-file' |
1313 | + KEY_SAMPLE_INTERVAL = 'sample-interval-sec' |
1314 | + KEY_SAMPLE_CHECK_COUNT = 'sample-check-count' |
1315 | + KEY_TIMEOUT = 'timeout' |
1316 | + KEY_CONFIG_FILE = 'config-file' |
1317 | + KEY_CONFIG_SECTION = 'config-section' |
1318 | + KEY_RUN_ALL = 'run-all' |
1319 | + KEY_DEFAULT = 'default' |
1320 | + |
1321 | + def __init__(self, cmdline_config): |
1322 | + """Init using command line options for config file and section""" |
1323 | + # get cmdline options |
1324 | + self.cmdline_config = cmdline_config |
1325 | + # set default setup parameters |
1326 | + self.run_all = False |
1327 | + self.config_file = get_config_file() |
1328 | + self.config_section = self.KEY_DEFAULT |
1329 | + self.parser = configparser.ConfigParser() |
1330 | + # now load config from files and cmdline |
1331 | + self.load_config() |
1332 | + |
1333 | + def load_config(self): |
1334 | + """Load the test config using command line and file""" |
1335 | + # reset the test config parameters |
1336 | + self.sample_dir = get_samples_dir() |
1337 | + self.sample_file = '' |
1338 | + self.sample_interval = 1 |
1339 | + self.sample_check_count = 5 |
1340 | + self.timeout = 0 |
1341 | + # get config file from cmdline options if specified |
1342 | + self.get_custom_config_from_cmdline() |
1343 | + # now read config from file |
1344 | + self.get_test_config_from_file() |
1345 | + # finally overwrite config with any cmdline options |
1346 | + self.get_test_config_from_cmdline() |
1347 | + |
1348 | + def get_custom_config_from_cmdline(self): |
1349 | + """Read the custom config options from cmd line parameters""" |
1350 | + # Get config-file and config-section from cmd line options |
1351 | + if self.KEY_CONFIG_FILE in self.cmdline_config: |
1352 | + self.config_file = self.cmdline_config[self.KEY_CONFIG_FILE] |
1353 | + if self.KEY_CONFIG_SECTION in self.cmdline_config: |
1354 | + self.config_section = self.cmdline_config[self.KEY_CONFIG_SECTION] |
1355 | + # Read the specified config file |
1356 | + self.parser.read(self.config_file) |
1357 | + # now get run-all parameter. check cmdline first, then file |
1358 | + if self.KEY_RUN_ALL in self.cmdline_config: |
1359 | + self.run_all = True |
1360 | + elif self.KEY_RUN_ALL in self.parser[self.config_section]: |
1361 | + if self.parser[self.config_section][self.KEY_RUN_ALL]: |
1362 | + self.run_all = True |
1363 | + |
1364 | + def get_test_config_from_cmdline(self): |
1365 | + """Read test parameters from cmd line options""" |
1366 | + if self.KEY_SAMPLE_DIR in self.cmdline_config: |
1367 | + self.sample_dir = self.cmdline_config[self.KEY_SAMPLE_DIR] |
1368 | + self.sample_file = '' |
1369 | + if self.KEY_SAMPLE_FILE in self.cmdline_config: |
1370 | + self.sample_file = self.cmdline_config[self.KEY_SAMPLE_FILE] |
1371 | + # if a file is specified, then remove the directory config, |
1372 | + # otherwise this will take priority |
1373 | + self.sample_dir = '' |
1374 | + if self.KEY_SAMPLE_INTERVAL in self.cmdline_config: |
1375 | + self.sample_interval = int( |
1376 | + self.cmdline_config[self.KEY_SAMPLE_INTERVAL]) |
1377 | + if self.KEY_SAMPLE_CHECK_COUNT in self.cmdline_config: |
1378 | + self.sample_check_count = int( |
1379 | + self.cmdline_config[self.KEY_SAMPLE_CHECK_COUNT]) |
1380 | + if self.KEY_TIMEOUT in self.cmdline_config: |
1381 | + self.timeout = int(self.cmdline_config[self.KEY_TIMEOUT]) |
1382 | + |
1383 | + def get_test_config_from_file(self): |
1384 | + """Read test parameters from config file""" |
1385 | + if self.KEY_SAMPLE_DIR in self.parser[self.config_section]: |
1386 | + val = self.parser[self.config_section][self.KEY_SAMPLE_DIR] |
1387 | + if len(val) > 0: |
1388 | + self.sample_dir = val |
1389 | + self.sample_file = '' |
1390 | + if self.KEY_SAMPLE_FILE in self.parser[self.config_section]: |
1391 | + val = self.parser[self.config_section][self.KEY_SAMPLE_FILE] |
1392 | + if len(val) > 0: |
1393 | + self.sample_file = val |
1394 | + # if a file is specified, then remove the directory config, |
1395 | + # otherwise this will take priority |
1396 | + self.sample_dir = '' |
1397 | + if self.KEY_SAMPLE_INTERVAL in self.parser[self.config_section]: |
1398 | + val = self.parser[self.config_section][self.KEY_SAMPLE_INTERVAL] |
1399 | + if len(val) > 0: |
1400 | + self.sample_interval = float(val) |
1401 | + if self.KEY_SAMPLE_CHECK_COUNT in self.parser[self.config_section]: |
1402 | + val = self.parser[self.config_section][self.KEY_SAMPLE_CHECK_COUNT] |
1403 | + if len(val) > 0: |
1404 | + self.sample_check_count = int(val) |
1405 | + if self.KEY_TIMEOUT in self.parser[self.config_section]: |
1406 | + val = self.parser[self.config_section][self.KEY_TIMEOUT] |
1407 | + if len(val) > 0: |
1408 | + self.timeout = int(val) |
1409 | + |
1410 | + |
1411 | +class VideoPlaybackTestCase(AutopilotTestCase): |
1412 | + """Autopilot test suite for playing videos in Mediaplayer-app""" |
1413 | + |
1414 | + def setUp(self): |
1415 | + """Setup test suite""" |
1416 | + super(VideoPlaybackTestCase, self).setUp() |
1417 | + self.pointing_device = toolkit_emulators.get_pointing_device() |
1418 | + # calculate screen crop area based on device geometry |
1419 | + self.crop_area = self.get_crop_area() |
1420 | + # create config data using any command line options |
1421 | + self.config = ConfigData(get_test_configuration()) |
1422 | + |
1423 | + def start_timer(self): |
1424 | + """Start a timer if a time limit has been set""" |
1425 | + if self.is_timeout_set(): |
1426 | + self.test_timer = Timer(self.config.timeout, self.on_timeout) |
1427 | + self.test_timer.start() |
1428 | + |
1429 | + def cancel_timer_if_active(self): |
1430 | + """Cancel timer if it is set and still running""" |
1431 | + if self.is_timeout_set() and not self.timeout: |
1432 | + self.test_timer.cancel() |
1433 | + |
1434 | + def on_timeout(self): |
1435 | + """Timer timeout event handler""" |
1436 | + # Flag that a timeout has occured |
1437 | + self.timeout = True |
1438 | + |
1439 | + def is_timeout_set(self): |
1440 | + """ |
1441 | + Decide whether a timeout is required |
1442 | + :return: True if timeout is set |
1443 | + False otherwise |
1444 | + """ |
1445 | + ret = False |
1446 | + if self.config.timeout > 0: |
1447 | + ret = True |
1448 | + return ret |
1449 | + |
1450 | + @property |
1451 | + def main_window(self): |
1452 | + """ |
1453 | + Get mediaplayer main window |
1454 | + :return: MainWindow instance of mediaplayer-app |
1455 | + """ |
1456 | + return MainWindow(self.app) |
1457 | + |
1458 | + def open_media_player_app(self, sample_file): |
1459 | + """ |
1460 | + Open media player app with the specified sample file |
1461 | + :param sample_file: Path to file to open |
1462 | + """ |
1463 | + self.app = self.launch_test_application( |
1464 | + "mediaplayer-app", |
1465 | + sample_file, |
1466 | + "--fullscreen", |
1467 | + "--desktop_file_hint=" |
1468 | + "/usr/share/applications/mediaplayer-app.desktop", |
1469 | + app_type='qt') |
1470 | + self.player = self.main_window.get_player() |
1471 | + self.assertThat(self.player.playing, Eventually(Equals(True))) |
1472 | + |
1473 | + def close_media_player_app(self): |
1474 | + """Close the running mediaplayer-app instance""" |
1475 | + out = subprocess.check_output(['pidof', '-s', 'mediaplayer-app']) |
1476 | + pid = out.decode().strip() |
1477 | + subprocess.check_call(['kill', '-9', pid]) |
1478 | + |
1479 | + def is_playing(self): |
1480 | + """ |
1481 | + Check if the media player is currently playing video |
1482 | + :return: True if it is playing, False otherwise |
1483 | + """ |
1484 | + return self.player.playing |
1485 | + |
1486 | + def show_controls(self): |
1487 | + """Show the playback controls on screen""" |
1488 | + video_area = self.main_window.get_video_area() |
1489 | + self.pointing_device.click_object(video_area) |
1490 | + toolbar = self.main_window.get_toolbar() |
1491 | + self.assertThat(toolbar.ready, Eventually(Equals(True))) |
1492 | + |
1493 | + def get_rgba_screenshot(self, target_file): |
1494 | + """ |
1495 | + Take a screenshot in rgba format |
1496 | + :return: Path of screenshot rgba file |
1497 | + """ |
1498 | + try: |
1499 | + subprocess.check_call([ |
1500 | + 'mirscreencast', |
1501 | + '-m', '/run/mir_socket', |
1502 | + '-n', '1', |
1503 | + '-f', target_file |
1504 | + ]) |
1505 | + except FileNotFoundError as e: |
1506 | + e.args += ("The utility 'mirscreencast' is not available.", ) |
1507 | + raise |
1508 | + except subprocess.CalledProcessError as e: |
1509 | + e.args += ("Failed to take screenshot.", ) |
1510 | + raise |
1511 | + |
1512 | + def convert_rgba_image(self, rgba_source_file, target_file): |
1513 | + """ |
1514 | + Convert rgba file to PNG target file |
1515 | + :param rgba_source_file: Path to rgba source image |
1516 | + :param target_file: Path to PNG target file |
1517 | + """ |
1518 | + try: |
1519 | + subprocess.check_call([ |
1520 | + 'convert', |
1521 | + '-alpha', 'off', |
1522 | + '-depth', '8', |
1523 | + '-size', '540x960', |
1524 | + 'rgba:{}[0]'.format(rgba_source_file), |
1525 | + target_file |
1526 | + ]) |
1527 | + except FileNotFoundError as e: |
1528 | + e.args += ("'convert' is not available, install imagemagick.", ) |
1529 | + raise |
1530 | + except subprocess.CalledProcessError as e: |
1531 | + e.args += ("Failed to convert screenshot to png format.", ) |
1532 | + raise |
1533 | + |
1534 | + def get_screenshot(self): |
1535 | + """ |
1536 | + Take screen shot and return file path of png file |
1537 | + :return: Path of PNG screen image file |
1538 | + """ |
1539 | + timestamp = int(time.time()) |
1540 | + filename_rgba = 'screenshot-{}.rgba'.format(timestamp) |
1541 | + filename_png = 'screenshot-{}.png'.format(timestamp) |
1542 | + temp_dir = tempfile.gettempdir() |
1543 | + filepath_rgba = os.path.join(temp_dir, filename_rgba) |
1544 | + filepath_png = os.path.join(temp_dir, filename_png) |
1545 | + self.get_rgba_screenshot(filepath_rgba) |
1546 | + self.convert_rgba_image(filepath_rgba, filepath_png) |
1547 | + # finished with rgba file so delete it |
1548 | + os.remove(filepath_rgba) |
1549 | + return filepath_png |
1550 | + |
1551 | + def get_crop_area(self): |
1552 | + """ |
1553 | + Calculate the crop area at centre of screen in pixel format |
1554 | + [width]x[height]+[x_start]+[y_start] |
1555 | + :return: Crop area measured in pixels |
1556 | + """ |
1557 | + crop_fmt = '{0}x{1}+{2}+{3}' |
1558 | + width = 100 |
1559 | + height = 100 |
1560 | + display = Display.create() |
1561 | + centre_x = display.get_screen_width() // 2 |
1562 | + centre_y = display.get_screen_height() // 2 |
1563 | + x_start = centre_x - (width // 2) |
1564 | + y_start = centre_y - (height // 2) |
1565 | + crop_str = crop_fmt.format(width, height, x_start, y_start) |
1566 | + return crop_str |
1567 | + |
1568 | + def crop_screenshot(self, source_file): |
1569 | + """ |
1570 | + Crop the screen shot and return path for cropped image |
1571 | + :param source_file: Path of image file to crop |
1572 | + :return: Path of cropped image file |
1573 | + """ |
1574 | + split_path = os.path.splitext(source_file) |
1575 | + path = split_path[0] |
1576 | + ext = split_path[1] |
1577 | + crop_file_path = '{0}_crop{1}'.format(path, ext) |
1578 | + |
1579 | + try: |
1580 | + subprocess.check_call([ |
1581 | + 'convert', |
1582 | + source_file, |
1583 | + '-crop', self.crop_area, |
1584 | + crop_file_path |
1585 | + ]) |
1586 | + except FileNotFoundError as e: |
1587 | + e.args += ("The utility 'convert' is not available.", ) |
1588 | + raise |
1589 | + except subprocess.CalledProcessError as e: |
1590 | + e.args += ("Failed to crop screenshot.", ) |
1591 | + raise |
1592 | + return crop_file_path |
1593 | + |
1594 | + def get_average_colour(self, source_file): |
1595 | + """ |
1596 | + Calculate the average colour of the specified image |
1597 | + """ |
1598 | + try: |
1599 | + ret = subprocess.check_output([ |
1600 | + 'convert', |
1601 | + source_file, |
1602 | + '-resize', '1x1', |
1603 | + 'txt:' |
1604 | + ]) |
1605 | + except FileNotFoundError as e: |
1606 | + e.args += ("The utility 'convert' is not available.", ) |
1607 | + raise |
1608 | + except subprocess.CalledProcessError as e: |
1609 | + e.args += ("Failed to get average colour.", ) |
1610 | + raise |
1611 | + return self.get_hex_colour_code(ret.decode()) |
1612 | + |
1613 | + def get_hex_colour_code(self, colour_string): |
1614 | + """ |
1615 | + Get the hex colour code from the specified colour string |
1616 | + :param colour_string: String representing colour output |
1617 | + :return: Hex representation of colour code |
1618 | + """ |
1619 | + colour_pattern = re.compile(r'^#.*#(.*?)\s+.*$', |
1620 | + re.IGNORECASE | re.DOTALL) |
1621 | + hex_code = None |
1622 | + match = colour_pattern.search(colour_string) |
1623 | + if match: |
1624 | + hex_code = match.group(1) |
1625 | + return hex_code |
1626 | + |
1627 | + def capture_and_check_frames_whilst_playing(self): |
1628 | + """ |
1629 | + Capture and check screen frames during playback |
1630 | + :return: True if playback completes, or timeout is reached. |
1631 | + False if the screen is frozen and video doesn't play' |
1632 | + """ |
1633 | + # frame_colours is a FIFO queue which holds the required number of |
1634 | + # colour samples |
1635 | + frame_colours = deque(maxlen=self.config.sample_check_count) |
1636 | + timer_started = False |
1637 | + self.timeout = False |
1638 | + while self.player.playing: |
1639 | + if self.is_timeout_set() and not timer_started: |
1640 | + # start the timer if required once playback has started |
1641 | + self.start_timer() |
1642 | + timer_started = True |
1643 | + # take screenshot |
1644 | + screenshot = self.get_screenshot() |
1645 | + # store the frame colour |
1646 | + frame_colours.append(self.calculate_frame_colour(screenshot)) |
1647 | + # no longer need the screenshot file so delete it |
1648 | + os.remove(screenshot) |
1649 | + # check frames to make sure playback is working |
1650 | + if not self.check_frame_colours(frame_colours): |
1651 | + # playback error, so exit now |
1652 | + self.cancel_timer_if_active() |
1653 | + return False |
1654 | + # wait for required interval period, checking for timeouts |
1655 | + # at 0.1 second intervals |
1656 | + # The sample interval is defined in seconds (e.g. 0.5 sec), |
1657 | + # so multiply by 10 to get required number of 0.1 second waits |
1658 | + # Note: Sample period could be large (e.g. several minutes) |
1659 | + # for long running tests, so there is a need to check for timeouts |
1660 | + # between the sample interval. |
1661 | + for count in range(int(self.config.sample_interval * 10)): |
1662 | + time.sleep(0.1) |
1663 | + # check if a timeout has occured |
1664 | + if self.timeout: |
1665 | + # timeout has triggered, so exit now |
1666 | + # this is not considered a failure |
1667 | + # no need to cancel the timer as it has triggered |
1668 | + return True |
1669 | + # playback has completed with no timeout |
1670 | + self.cancel_timer_if_active() |
1671 | + return True |
1672 | + |
1673 | + def calculate_frame_colour(self, frame): |
1674 | + """ |
1675 | + Calculate the colour of the centre of the specified image |
1676 | + :param frame: Path to image file |
1677 | + :return: Average colour of centre of image |
1678 | + """ |
1679 | + # crop to the centre of the image |
1680 | + crop = self.crop_screenshot(frame) |
1681 | + # get colour of cropped area |
1682 | + colour = self.get_average_colour(crop) |
1683 | + # now delete cropped file |
1684 | + os.remove(crop) |
1685 | + return colour |
1686 | + |
1687 | + def check_frame_colours(self, frame_colours): |
1688 | + """ |
1689 | + Analyse the frame colours to check that playback is working |
1690 | + :param frame_colours: dequeue object containing frame colours |
1691 | + :return: True if frame colours are changing |
1692 | + False if all the framecolours are the same |
1693 | + """ |
1694 | + frames_ok = True |
1695 | + for colour in frame_colours: |
1696 | + # count the number of occurances of current colour in the |
1697 | + # previous colours |
1698 | + if frame_colours.count(colour) is frame_colours.maxlen: |
1699 | + # all the frames are same colour, so this is a fail |
1700 | + frames_ok = False |
1701 | + break |
1702 | + return frames_ok |
1703 | + |
1704 | + def get_sample_files_from_dir(self, sample_dir): |
1705 | + """ |
1706 | + Recursively search the specified directory for files to test |
1707 | + :param sample_dir: Top level directory to search |
1708 | + :return: List containing path of all sub-files |
1709 | + """ |
1710 | + file_list = [] |
1711 | + for root, dirs, files in os.walk(sample_dir): |
1712 | + for file in files: |
1713 | + file_list.append(os.path.abspath(os.path.join(root, file))) |
1714 | + return file_list |
1715 | + |
1716 | + def get_sample_file_list(self): |
1717 | + """ |
1718 | + Based on supplied config get the list of files to test |
1719 | + :return: List of files required for the current test |
1720 | + """ |
1721 | + # get the list of video sample files to play, based on the test config |
1722 | + sample_files = [] |
1723 | + if self.config.sample_dir: |
1724 | + # get the files from the specified directory |
1725 | + sample_files = self.get_sample_files_from_dir( |
1726 | + self.config.sample_dir) |
1727 | + elif self.config.sample_file: |
1728 | + # use the specified file |
1729 | + sample_files.append(self.config.sample_file) |
1730 | + return sample_files |
1731 | + |
1732 | + def play_and_sample_video(self, file_path): |
1733 | + """ |
1734 | + Play the specified sample file in the mediaplayer-app |
1735 | + :param file_path: Path to video file to launch in mediaplayer-app |
1736 | + :return: True if playback comleted successfully |
1737 | + False if playback didn't complete successfully |
1738 | + """ |
1739 | + # launch media player app |
1740 | + self.open_media_player_app(file_path) |
1741 | + # capture video frames |
1742 | + # This call will run until playback is completed |
1743 | + # timeout is reached, or a freeze is detected |
1744 | + result = self.capture_and_check_frames_whilst_playing() |
1745 | + # close the media app |
1746 | + self.close_media_player_app() |
1747 | + return result |
1748 | + |
1749 | + def print_failures(self, failures): |
1750 | + """ |
1751 | + Print out a list of failed video files |
1752 | + :param failures: List containing path of all failed video files |
1753 | + """ |
1754 | + divider = '-----------------------------------------------------------' |
1755 | + fail_count = len(failures) |
1756 | + if fail_count > 0: |
1757 | + print((divider)) |
1758 | + print(('{} failures:'.format(fail_count))) |
1759 | + print((divider)) |
1760 | + for failure in failures: |
1761 | + print((' {}'.format(failure))) |
1762 | + print((divider)) |
1763 | + |
1764 | + def test_video_playback_from_samples(self): |
1765 | + """ |
1766 | + Test to play video files based on test config |
1767 | + """ |
1768 | + failures = [] |
1769 | + sections = [] |
1770 | + if self.config.run_all: |
1771 | + # run through every config section in the config file |
1772 | + sections = self.config.parser.sections() |
1773 | + else: |
1774 | + # only use the specified config section |
1775 | + sections.append(self.config.config_section) |
1776 | + |
1777 | + for section in sections: |
1778 | + # copy the current section into the config |
1779 | + self.config.config_section = section |
1780 | + # now update config for current section |
1781 | + self.config.load_config() |
1782 | + # run the test for this section |
1783 | + video_files = self.get_sample_file_list() |
1784 | + for video in video_files: |
1785 | + # play all of the samples before checking results |
1786 | + start_time = time.time() |
1787 | + result = self.play_and_sample_video(video) |
1788 | + if not result: |
1789 | + # record failure time |
1790 | + end_time = time.time() |
1791 | + elapsed = time.gmtime(end_time - start_time) |
1792 | + elapsed_str = time.strftime("%H:%M:%S", elapsed) |
1793 | + # print time of failure with file name |
1794 | + failures.append(' {0} {1}'.format(elapsed_str, video)) |
1795 | + # take a screenshot of the failure with name of video file |
1796 | + # this will be added to the test details by autopilot |
1797 | + video_file, video_ext = os.path.splitext( |
1798 | + os.path.split(video)[1]) |
1799 | + screenshot_name = '{0}-{1}{2}'.format( |
1800 | + video_file, elapsed_str, video_ext) |
1801 | + self.take_screenshot(screenshot_name) |
1802 | + |
1803 | + self.print_failures(failures) |
1804 | + # fail the test if there were any failures |
1805 | + self.assertThat(len(failures), Equals(0)) |
1806 | |
1807 | === added directory 'ubuntu_experience_tests/tests/multimedia/video_samples' |
1808 | === added file 'ubuntu_experience_tests/tests/multimedia/video_samples/big_buck_bunny_480p_H264_AAC_25fps_1800K_short.MP4' |
1809 | Binary files ubuntu_experience_tests/tests/multimedia/video_samples/big_buck_bunny_480p_H264_AAC_25fps_1800K_short.MP4 1970-01-01 00:00:00 +0000 and ubuntu_experience_tests/tests/multimedia/video_samples/big_buck_bunny_480p_H264_AAC_25fps_1800K_short.MP4 2014-10-29 15:00:49 +0000 differ |
1810 | === added file 'ubuntu_experience_tests/tests/multimedia/video_samples/big_buck_bunny_720p_H264_AAC_25fps_3400K_short.MP4' |
1811 | Binary files ubuntu_experience_tests/tests/multimedia/video_samples/big_buck_bunny_720p_H264_AAC_25fps_3400K_short.MP4 1970-01-01 00:00:00 +0000 and ubuntu_experience_tests/tests/multimedia/video_samples/big_buck_bunny_720p_H264_AAC_25fps_3400K_short.MP4 2014-10-29 15:00:49 +0000 differ |
1812 | === added file 'ubuntu_experience_tests/tests/test_fixture_setup.py' |
1813 | --- ubuntu_experience_tests/tests/test_fixture_setup.py 1970-01-01 00:00:00 +0000 |
1814 | +++ ubuntu_experience_tests/tests/test_fixture_setup.py 2014-10-29 15:00:49 +0000 |
1815 | @@ -0,0 +1,56 @@ |
1816 | +# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- |
1817 | +# |
1818 | +# Copyright 2014 Canonical Ltd. |
1819 | +# Author: Omer Akram <omer.akram@canonical.com> |
1820 | +# |
1821 | +# This file is part of ubuntu-experience-tests. |
1822 | +# |
1823 | +# This program is free software; you can redistribute it and/or modify |
1824 | +# it under the terms of the GNU General Public License version 3, as published |
1825 | +# by the Free Software Foundation. |
1826 | +# |
1827 | +# This program is distributed in the hope that it will be useful, |
1828 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1829 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1830 | +# GNU General Public License for more details. |
1831 | +# |
1832 | +# You should have received a copy of the GNU General Public License |
1833 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
1834 | + |
1835 | +import testtools |
1836 | + |
1837 | +from ubuntuuitoolkit import environment |
1838 | + |
1839 | +from ubuntu_experience_tests import fixture_setup |
1840 | + |
1841 | + |
1842 | +class TestabilityEnvironmentTestCase(testtools.TestCase): |
1843 | + |
1844 | + def get_testability_environment_variable(self): |
1845 | + try: |
1846 | + return environment.get_initctl_env_var('QT_LOAD_TESTABILITY') |
1847 | + except: |
1848 | + return None |
1849 | + |
1850 | + def test_fixture_must_setup_testability_environment(self): |
1851 | + """Test the testability environment fixture is setting the variable.""" |
1852 | + fixture = fixture_setup.TestabilityEnvironment() |
1853 | + self.useFixture(fixture) |
1854 | + |
1855 | + self.assertEquals('1', self.get_testability_environment_variable()) |
1856 | + |
1857 | + def test_fixture_must_cleanup_testability_environment(self): |
1858 | + """Test the testability fixture cleans the variable.""" |
1859 | + original_value = self.get_testability_environment_variable() |
1860 | + fixture = fixture_setup.TestabilityEnvironment() |
1861 | + |
1862 | + def inner_test(): |
1863 | + class TestWithFakeApplication(testtools.TestCase): |
1864 | + def test_it(self): |
1865 | + self.useFixture(fixture) |
1866 | + return TestWithFakeApplication('test_it') |
1867 | + |
1868 | + inner_test().run() |
1869 | + |
1870 | + self.assertEqual( |
1871 | + original_value, self.get_testability_environment_variable()) |