Merge lp:~elopio/unity8/app_preview into lp:unity8

Proposed by Leo Arias
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 649
Merged at revision: 647
Proposed branch: lp:~elopio/unity8/app_preview
Merge into: lp:unity8
Diff against target: 381 lines (+173/-16)
12 files modified
debian/control (+1/-0)
debian/unity8-fake-env.install (+1/-0)
qml/Dash/Apps/AppPreview.qml (+1/-0)
tests/autopilot/unity8/shell/emulators/__init__.py (+1/-1)
tests/autopilot/unity8/shell/emulators/dash.py (+53/-2)
tests/autopilot/unity8/shell/tests/test_emulators.py (+89/-2)
tests/mocks/Unity/CMakeLists.txt (+9/-2)
tests/mocks/Unity/fake_applications_scope.cpp (+2/-1)
tests/mocks/Unity/fake_preview.cpp (+5/-3)
tests/mocks/Unity/fake_preview.h (+5/-2)
tests/mocks/Unity/fake_scope.cpp (+3/-2)
tests/mocks/Unity/fake_scope.h (+3/-1)
To merge this branch: bzr merge lp:~elopio/unity8/app_preview
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Albert Astals Cid (community) Approve
Alejandro J. Cura (community) Approve
Michael Zanetti Pending
Javier Collado Pending
Richard Huddie Pending
VĂ­ctor R. Ruiz Pending
Review via email: mp+201718@code.launchpad.net

Commit message

Added autopilot helpers for the app scope and the app preview.
Install the fake scopes in order to use them on the tests.

To post a comment you must log in.
Revision history for this message
Leo Arias (elopio) wrote :

Not yet ready. Marking as Needs review to see how jenkins tests fare.

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

FAILED: Continuous integration, rev:639
http://jenkins.qa.ubuntu.com/job/unity8-ci/2078/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2378
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2251/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/932
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/600
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/602
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/602/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/600
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2087
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2380
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2380/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2251
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2251/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4704/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3131

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2078/rebuild

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

FAILED: Continuous integration, rev:640
http://jenkins.qa.ubuntu.com/job/unity8-ci/2079/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2379
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2252/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/933
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/601
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/603
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/603/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/601
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2088
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2381
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2381/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2252
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2252/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4705/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3132

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2079/rebuild

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

FAILED: Continuous integration, rev:641
http://jenkins.qa.ubuntu.com/job/unity8-ci/2080/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2380
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2253/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/934
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/602
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/604
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/604/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/602
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2089
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2382
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2382/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2253
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2253/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4706/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3133

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2080/rebuild

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

FAILED: Continuous integration, rev:642
http://jenkins.qa.ubuntu.com/job/unity8-ci/2081/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2384
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2255/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/935
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/603
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/605
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/605/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/603
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2093
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2386
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2386/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2255
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2255/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4708/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3136

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2081/rebuild

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

FAILED: Continuous integration, rev:642
http://jenkins.qa.ubuntu.com/job/unity8-ci/2087/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2395
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2266/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/944
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/609
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/611
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/611/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/609
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2102
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2397
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2397/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2266
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2266/artifact/work/output/*zip*/output.zip
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4717/console
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3146

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2087/rebuild

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

It looks good, +1

btw, I ran these tests with:

alecu@bollo:~/canonical/unity8/review_app_preview/builddir$ PYTHONPATH=../tests/autopilot autopilot run unity8.shell.tests.test_emulators.DashAppsEmulatorTestCase

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:648
http://jenkins.qa.ubuntu.com/job/unity8-ci/2092/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2403
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2273
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/949
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/614
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/616
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/616/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/614
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2106
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2405
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2405/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2273
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2273/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4721
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3152

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2092/rebuild

review: Approve (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Why the change in the CODING file? make autopilot already runs make install so I don't see the need to mention it before make autopilot

review: Needs Information
Revision history for this message
Leo Arias (elopio) wrote :

You are right. I didn't get that from the current CODING file and got confused. I reverted the changes on that file.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/946/
Executed test runs:
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-cleanup-mbs/3909
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2435
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2286
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/956/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/332
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/332
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/332/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/332
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2125
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2437
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2437/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2286
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2286/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4732
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3170

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

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/947/
Executed test runs:
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-cleanup-mbs/3910
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2438
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2289
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/958
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/333
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/333
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/333/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/333
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2128
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2440
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2440/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2289
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2289/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4735
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3173

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

FAILED: Continuous integration, rev:649
http://jenkins.qa.ubuntu.com/job/unity8-ci/2100/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2443
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2293
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/961
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-ci/622
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/624
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-ci/624/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-ci/622
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2133
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2445
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2445/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2293
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2293/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4739
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3177

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/2100/rebuild

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

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/unity8-autolanding/951/
Executed test runs:
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/generic-cleanup-mbs/3920
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty/2463
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-trusty-touch/2306
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-trusty/964
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-amd64-autolanding/337
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/337
        deb: http://jenkins.qa.ubuntu.com/job/unity8-trusty-armhf-autolanding/337/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-trusty-i386-autolanding/337
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-trusty/2151
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2465
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-amd64/2465/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2306
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-trusty-armhf/2306/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-runner-mako/4752
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/3197

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-01-14 15:20:38 +0000
3+++ debian/control 2014-01-17 13:59:58 +0000
4@@ -102,6 +102,7 @@
5 libqt5test5,
6 libqt5widgets5,
7 python-evdev,
8+ python-fixtures,
9 python-gi,
10 python-mock,
11 unity8 (>= ${source:Version}),
12
13=== modified file 'debian/unity8-fake-env.install'
14--- debian/unity8-fake-env.install 2013-10-16 14:23:03 +0000
15+++ debian/unity8-fake-env.install 2014-01-17 13:59:58 +0000
16@@ -1,2 +1,3 @@
17 usr/lib/*/unity8/qml/mocks
18+usr/lib/*/unity8/qml/scopefakes
19 usr/share/unity8/mocks
20
21=== modified file 'qml/Dash/Apps/AppPreview.qml'
22--- qml/Dash/Apps/AppPreview.qml 2013-10-04 17:46:31 +0000
23+++ qml/Dash/Apps/AppPreview.qml 2014-01-17 13:59:58 +0000
24@@ -97,6 +97,7 @@
25 spacing: units.gu(1)
26
27 Label {
28+ objectName: "descriptionLabel"
29 anchors { left: parent.left; right: parent.right }
30 text: root.previewData.description
31 fontSize: "medium"
32
33=== modified file 'tests/autopilot/unity8/shell/emulators/__init__.py'
34--- tests/autopilot/unity8/shell/emulators/__init__.py 2014-01-03 18:22:53 +0000
35+++ tests/autopilot/unity8/shell/emulators/__init__.py 2014-01-17 13:59:58 +0000
36@@ -25,7 +25,7 @@
37
38 def __init__(self, *args):
39 super(UnityEmulatorBase, self).__init__(*args)
40- self.pointing_device = input.Touch.create()
41+ self.pointing_device = input.Pointer(device=input.Touch.create())
42
43
44 class UnityEmulatorException(Exception):
45
46=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
47--- tests/autopilot/unity8/shell/emulators/dash.py 2014-01-08 16:49:42 +0000
48+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-01-17 13:59:58 +0000
49@@ -138,8 +138,59 @@
50
51
52 class GenericScopeView(emulators.UnityEmulatorBase):
53- """Autopilot emulators for generic scopes."""
54+ """Autopilot emulator for generic scopes."""
55
56
57 class DashApps(emulators.UnityEmulatorBase):
58- """Autopilot emulators for the applications scope."""
59+ """Autopilot emulator for the applications scope."""
60+
61+ def get_applications(self, category):
62+ """Return the list of applications on a category.
63+
64+ :parameter category: The name of the category.
65+
66+ """
67+ category_element = self._get_category_element(category)
68+ application_tiles = category_element.select_many('Tile')
69+ # TODO return them on the same order they are displayed.
70+ # --elopio - 2014-1-15
71+ return [tile.text for tile in application_tiles]
72+
73+ def _get_category_element(self, category):
74+ try:
75+ return self.select_single(
76+ 'Base', objectName='dashCategory{}'.format(category))
77+ except dbus.StateNotFoundError:
78+ raise emulators.UnityEmulatorException(
79+ 'No category found with name {}'.format(category))
80+
81+ @autopilot_logging.log_action(logger.info)
82+ def open_preview(self, category, app_name):
83+ """Open the preview of an application.
84+
85+ :parameter category: The name of the category where the application is.
86+ :app_name: The name of the application.
87+
88+ """
89+ category_element = self._get_category_element(category)
90+ icon = category_element.select_single('Tile', text=app_name)
91+ # FIXME some categories need a long press in order to see the preview.
92+ # Some categories do not show previews, like recent apps.
93+ # --elopio - 2014-1-14
94+ self.pointing_device.click_object(icon)
95+ return self.get_root_instance().wait_select_single(AppPreview)
96+
97+
98+class AppPreview(emulators.UnityEmulatorBase):
99+ """Autopilot emulator for the application preview."""
100+
101+ def get_details(self):
102+ """Return the details of the application showed in its preview."""
103+ title = self.select_single('Label', objectName='titleLabel').text
104+ publisher = self.select_single(
105+ 'Label', objectName='subtitleLabel').text
106+ description = self.select_single(
107+ 'Label', objectName='descriptionLabel').text
108+ # TODO return screenshots, icon, rating and reviews.
109+ # --elopio - 2014-1-15
110+ return dict(title=title, publisher=publisher, description=description)
111
112=== modified file 'tests/autopilot/unity8/shell/tests/test_emulators.py'
113--- tests/autopilot/unity8/shell/tests/test_emulators.py 2014-01-09 21:30:23 +0000
114+++ tests/autopilot/unity8/shell/tests/test_emulators.py 2014-01-17 13:59:58 +0000
115@@ -17,23 +17,43 @@
116 # along with this program. If not, see <http://www.gnu.org/licenses/>.
117 #
118
119+"""Tests for the Dash autopilot emulators.
120+
121+The autopilot emulators are helpers for tests that check a user journey that
122+involves the dash. The code for some of those tests will not be inside this
123+branch, but in projects that depend on unity or that test the whole system
124+integration. So, we need to test the helpers in order to make sure that we
125+don't break them for those external projects.
126+
127+"""
128+
129+import os
130+import sysconfig
131+
132 import mock
133
134+import fixtures
135+from testtools.matchers import Contains, HasLength
136+
137+import unity8
138 from unity8 import process_helpers
139 from unity8.shell import emulators, tests
140 from unity8.shell.emulators import dash as dash_emulators
141
142
143-class DashEmulatorTestCase(tests.UnityTestCase):
144+class DashBaseTestCase(tests.UnityTestCase):
145
146 scenarios = tests._get_device_emulation_scenarios()
147
148 def setUp(self):
149- super(DashEmulatorTestCase, self).setUp()
150+ super(DashBaseTestCase, self).setUp()
151 unity_proxy = self.launch_unity()
152 process_helpers.unlock_unity(unity_proxy)
153 self.dash = self.main_window.get_dash()
154
155+
156+class DashEmulatorTestCase(DashBaseTestCase):
157+
158 def test_open_unexisting_scope(self):
159 scope_name = 'unexisting'
160 with mock.patch.object(self.dash, 'pointing_device') as mock_pointer:
161@@ -118,3 +138,70 @@
162 scope = self.dash.open_scope(self._get_scope_name_from_id(scope_id))
163 self._assert_scope_is_opened(scope, scope_id)
164 self.assertIsInstance(scope, dash_emulators.DashApps)
165+
166+
167+class DashAppsEmulatorTestCase(DashBaseTestCase):
168+
169+ available_applications = [
170+ 'Title.1', 'Title.21', 'Title.41', 'Title.61', 'Title.81',
171+ 'Title.101', 'Title.121', 'Title.141', 'Title.161', 'Title.181',
172+ 'Title.201', 'Title.221', 'Title.241', 'Title.261', 'Title.281']
173+
174+ def setUp(self):
175+ self._use_scope_fakes()
176+ super(DashAppsEmulatorTestCase, self).setUp()
177+ self.applications_scope = self.dash.open_scope('applications')
178+
179+ def _use_scope_fakes(self):
180+ self.useFixture(
181+ fixtures.EnvironmentVariable(
182+ 'QML2_IMPORT_PATH',
183+ newvalue=self._get_fake_scopes_library_path()))
184+
185+ def _get_fake_scopes_library_path(self):
186+ if unity8.running_installed_tests():
187+ mock_path = 'qml/scopefakes/'
188+ else:
189+ mock_path = os.path.join(
190+ '../lib/', sysconfig.get_config_var('MULTIARCH'),
191+ 'unity8/qml/scopefakes/')
192+ lib_path = unity8.get_lib_path()
193+ ld_library_path = os.path.abspath(os.path.join(lib_path, mock_path))
194+
195+ if not os.path.exists(ld_library_path):
196+ raise RuntimeError(
197+ 'Expected library path does not exists: %s.' % (
198+ ld_library_path))
199+ return ld_library_path
200+
201+ def test_get_applications_with_unexisting_category(self):
202+ exception = self.assertRaises(
203+ emulators.UnityEmulatorException,
204+ self.applications_scope.get_applications,
205+ 'unexisting category')
206+
207+ self.assertEqual(
208+ 'No category found with name unexisting category', str(exception))
209+
210+ def test_get_applications_should_return_list_with_names(self):
211+ category = 'installed'
212+ expected_apps_count = self._get_number_of_application_slots(category)
213+ expected_applications = self.available_applications[
214+ :expected_apps_count]
215+
216+ applications = self.applications_scope.get_applications(category)
217+
218+ self.assertThat(applications, HasLength(expected_apps_count))
219+ for expected in expected_applications:
220+ self.assertThat(applications, Contains(expected))
221+
222+ def _get_number_of_application_slots(self, category):
223+ category_element = self.applications_scope._get_category_element(
224+ category)
225+ grid = category_element.select_single('GenericFilterGrid')
226+ return grid.columns * grid.rows
227+
228+ def test_open_preview(self):
229+ preview = self.applications_scope.open_preview('installed', 'Title.1')
230+ self.assertIsInstance(preview, dash_emulators.AppPreview)
231+ self.assertTrue(preview.isCurrent)
232
233=== modified file 'tests/mocks/Unity/CMakeLists.txt'
234--- tests/mocks/Unity/CMakeLists.txt 2013-11-12 18:21:40 +0000
235+++ tests/mocks/Unity/CMakeLists.txt 2014-01-17 13:59:58 +0000
236@@ -1,5 +1,7 @@
237 add_subdirectory(Application)
238 add_subdirectory(Indicators)
239+add_subdirectory(Launcher)
240+add_subdirectory(Notifications)
241
242 pkg_search_module(DEE dee-1.0 REQUIRED)
243 pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
244@@ -41,5 +43,10 @@
245 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}
246 )
247
248-add_subdirectory(Launcher)
249-add_subdirectory(Notifications)
250+install(TARGETS FakeUnityQml
251+ DESTINATION ${SHELL_INSTALL_QML}/scopefakes/Unity
252+ )
253+
254+install(FILES qmldir
255+ DESTINATION ${SHELL_INSTALL_QML}/scopefakes/Unity
256+ )
257
258=== modified file 'tests/mocks/Unity/fake_applications_scope.cpp'
259--- tests/mocks/Unity/fake_applications_scope.cpp 2013-09-30 15:47:18 +0000
260+++ tests/mocks/Unity/fake_applications_scope.cpp 2014-01-17 13:59:58 +0000
261@@ -1,5 +1,5 @@
262 /*
263- * Copyright (C) 2013 Canonical, Ltd.
264+ * Copyright (C) 2013, 2014 Canonical, Ltd.
265 *
266 * This program is free software; you can redistribute it and/or modify
267 * it under the terms of the GNU General Public License as published by
268@@ -30,6 +30,7 @@
269 m_id = "applications.scope";
270 m_name = "Applications";
271 m_visible = visible;
272+ m_previewRendererName = "preview-application";
273 m_categories->setModel(createCategoriesModel());
274 }
275
276
277=== modified file 'tests/mocks/Unity/fake_preview.cpp'
278--- tests/mocks/Unity/fake_preview.cpp 2013-10-31 15:13:50 +0000
279+++ tests/mocks/Unity/fake_preview.cpp 2014-01-17 13:59:58 +0000
280@@ -1,5 +1,5 @@
281 /*
282- * Copyright (C) 2013 Canonical, Ltd.
283+ * Copyright (C) 2013, 2014 Canonical, Ltd.
284 *
285 * This program is free software; you can redistribute it and/or modify
286 * it under the terms of the GNU General Public License as published by
287@@ -16,13 +16,15 @@
288
289 #include "fake_preview.h"
290
291-Preview::Preview(QObject *parent): QObject(parent)
292+Preview::Preview(const QString &rendererName, QObject *parent):
293+ QObject(parent),
294+ m_rendererName(rendererName)
295 {
296 }
297
298 QString Preview::rendererName() const
299 {
300- return "generic-preview";
301+ return m_rendererName;
302 }
303
304 QString Preview::title() const
305
306=== modified file 'tests/mocks/Unity/fake_preview.h'
307--- tests/mocks/Unity/fake_preview.h 2013-10-31 15:13:50 +0000
308+++ tests/mocks/Unity/fake_preview.h 2014-01-17 13:59:58 +0000
309@@ -1,5 +1,5 @@
310 /*
311- * Copyright (C) 2013 Canonical, Ltd.
312+ * Copyright (C) 2013, 2014 Canonical, Ltd.
313 *
314 * This program is free software; you can redistribute it and/or modify
315 * it under the terms of the GNU General Public License as published by
316@@ -38,7 +38,7 @@
317 Q_PROPERTY(QString image READ image NOTIFY previewChanged)
318
319 public:
320- explicit Preview(QObject *parent = 0);
321+ explicit Preview(const QString &rendererName, QObject *parent = 0);
322
323 QString rendererName() const;
324 QString title() const;
325@@ -55,6 +55,9 @@
326
327 Q_SIGNALS:
328 void previewChanged();
329+
330+private:
331+ QString m_rendererName;
332 };
333
334 Q_DECLARE_METATYPE(Preview *)
335
336=== modified file 'tests/mocks/Unity/fake_scope.cpp'
337--- tests/mocks/Unity/fake_scope.cpp 2013-12-17 16:04:47 +0000
338+++ tests/mocks/Unity/fake_scope.cpp 2014-01-17 13:59:58 +0000
339@@ -1,5 +1,5 @@
340 /*
341- * Copyright (C) 2013 Canonical, Ltd.
342+ * Copyright (C) 2013, 2014 Canonical, Ltd.
343 *
344 * This program is free software; you can redistribute it and/or modify
345 * it under the terms of the GNU General Public License as published by
346@@ -38,6 +38,7 @@
347 , m_isActive(false)
348 , m_categories(new Categories(this))
349 , m_results(new DeeListModel(this))
350+ , m_previewRendererName("preview-generic")
351 {
352 DeeModel* results_model = create_results_model(20, 300);
353 m_categories->setResultModel(results_model);
354@@ -47,7 +48,7 @@
355 m_timer.setInterval(1000);
356 m_timer.setSingleShot(true);
357 connect(&m_timer, &QTimer::timeout, [this]() {
358- Preview *p = new Preview(this);
359+ Preview *p = new Preview(m_previewRendererName, this);
360 Q_EMIT previewReady(p);
361 });
362 }
363
364=== modified file 'tests/mocks/Unity/fake_scope.h'
365--- tests/mocks/Unity/fake_scope.h 2013-10-31 15:13:50 +0000
366+++ tests/mocks/Unity/fake_scope.h 2014-01-17 13:59:58 +0000
367@@ -1,5 +1,5 @@
368 /*
369- * Copyright (C) 2013 Canonical, Ltd.
370+ * Copyright (C) 2013, 2014 Canonical, Ltd.
371 *
372 * This program is free software; you can redistribute it and/or modify
373 * it under the terms of the GNU General Public License as published by
374@@ -116,6 +116,8 @@
375 bool m_searching;
376 bool m_isActive;
377
378+ QString m_previewRendererName;
379+
380 Categories* m_categories;
381 DeeListModel* m_results;
382

Subscribers

People subscribed via source and target branches