Merge lp:~mzanetti/unity8/move-screenshots-to-tests into lp:unity8

Proposed by Michael Zanetti
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 2028
Merged at revision: 2058
Proposed branch: lp:~mzanetti/unity8/move-screenshots-to-tests
Merge into: lp:unity8
Prerequisite: lp:~mzanetti/unity8/modeswitchwarning
Diff against target: 149 lines (+31/-18)
6 files modified
po/shn.po (+5/-5)
tests/mocks/Unity/Application/ApplicationInfo.cpp (+4/-8)
tests/mocks/Unity/Application/ApplicationScreenshotProvider.cpp (+6/-2)
tests/mocks/Unity/Application/ApplicationTestInterface.cpp (+2/-2)
tests/mocks/Unity/Application/resources/surfaces.qrc (+13/-0)
tests/qmltests/Components/tst_ZoomableImage.qml (+1/-1)
To merge this branch: bzr merge lp:~mzanetti/unity8/move-screenshots-to-tests
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+276798@code.launchpad.net

This proposal supersedes a proposal from 2015-11-05.

Commit message

move screenshots out of the Dash dir

This was consuming 2.5 megs of installed size while they really are
only used for testing.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

see prereq

 * Did you perform an exploratory manual test run of your code change and any related functionality?

yes

 * Did you make sure that your branch does not contain spurious tags?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

n/a

 * If you changed the UI, has there been a design review?

n/a

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :

ApplicationInfo::createSession has

QUrl screenshotUrl = QString("file://%1").arg(m_screenshotFileName);

which i guess needs changing?

review: Needs Fixing
2024. By Michael Zanetti

fix createSession

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> ApplicationInfo::createSession has
>
> QUrl screenshotUrl = QString("file://%1").arg(m_screenshotFileName);
>
> which i guess needs changing?

Fixed, thanks.

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

Text conflict in tests/qmltests/tst_Shell.qml
1 conflicts encountered.

review: Needs Fixing
2025. By Michael Zanetti

merge prereq

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Text conflict in tests/qmltests/tst_Shell.qml
> 1 conflicts encountered.

the conflict was resolved by the prereq already... anyhow, merged with with the prereq

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
Albert Astals Cid (aacid) wrote :

Needs remerging of pre-requisite for CI to run

review: Needs Fixing
2026. By Michael Zanetti

mege trunk

2027. By Michael Zanetti

merge prereq

Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Needs remerging of pre-requisite for CI to run
done

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

FAILED: Continuous integration, rev:2027
http://jenkins.qa.ubuntu.com/job/unity8-ci/6740/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5259
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/155/console
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1453
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/155/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1347
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1348
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4174
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5279
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5279/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25268
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/35/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/155
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/155/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25269

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

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

  make testApplicationWindow
fails

review: Needs Fixing
2028. By Michael Zanetti

strip qrc to make QImage understand it

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

FAILED: Continuous integration, rev:2028
http://jenkins.qa.ubuntu.com/job/unity8-ci/6747/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/5280
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-xenial-touch/162/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1460
    FAILURE: http://jenkins.qa.ubuntu.com/job/unity8-qmluitest-xenial-amd64/162/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1354
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1355
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-amd64-ci/161
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-xenial-i386-ci/161
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-touch/4189
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5300
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/5300/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25301
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-xenial-touch/39/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/162
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-xenial-armhf/162/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/25300

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

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

 * Did you perform an exploratory manual test run of the code change and any related functionality?
No need, only changes test files.

 * Did CI run pass? If not, please explain why.
Yes for vivid

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/shn.po'
2--- po/shn.po 2015-11-11 05:47:53 +0000
3+++ po/shn.po 2015-11-19 20:34:30 +0000
4@@ -8,15 +8,15 @@
5 "Project-Id-Version: unity8\n"
6 "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
7 "POT-Creation-Date: 2015-10-19 14:34+0100\n"
8-"PO-Revision-Date: 2015-11-10 12:09+0000\n"
9-"Last-Translator: Rockworld <sumoisrock@gmail.com>\n"
10+"PO-Revision-Date: 2013-10-07 11:46+0000\n"
11+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: Shan <shn@li.org>\n"
13 "MIME-Version: 1.0\n"
14 "Content-Type: text/plain; charset=UTF-8\n"
15 "Content-Transfer-Encoding: 8bit\n"
16 "Plural-Forms: nplurals=2; plural=(n == 1) ? 0 : 1;\n"
17-"X-Launchpad-Export-Date: 2015-11-11 05:47+0000\n"
18-"X-Generator: Launchpad (build 17843)\n"
19+"X-Launchpad-Export-Date: 2015-11-07 05:13+0000\n"
20+"X-Generator: Launchpad (build 17838)\n"
21
22 #: plugins/IntegratedLightDM/Greeter.cpp:112
23 msgid "Password: "
24@@ -29,7 +29,7 @@
25
26 #: plugins/Unity/Launcher/launcheritem.cpp:52
27 msgid "Quit"
28-msgstr "ဢိုတ်း"
29+msgstr ""
30
31 #: plugins/Unity/Launcher/launcheritem.cpp:106
32 msgid "Unpin shortcut"
33
34=== modified file 'tests/mocks/Unity/Application/ApplicationInfo.cpp'
35--- tests/mocks/Unity/Application/ApplicationInfo.cpp 2015-10-01 17:43:10 +0000
36+++ tests/mocks/Unity/Application/ApplicationInfo.cpp 2015-11-19 20:34:30 +0000
37@@ -73,8 +73,7 @@
38 {
39 if (m_session || state() == ApplicationInfo::Stopped) { return; }
40
41- QUrl screenshotUrl = QString("file://%1").arg(m_screenshotFileName);
42- setSession(SessionManager::singleton()->createSession(appId(), screenshotUrl));
43+ setSession(SessionManager::singleton()->createSession(appId(), m_screenshotFileName));
44 }
45
46 void ApplicationInfo::destroySession()
47@@ -125,21 +124,18 @@
48 QString screenshotFileName;
49
50 if (screenshotId.endsWith(".svg")) {
51- screenshotFileName = QString("%1/Dash/graphics/phone/screenshots/%2")
52- .arg(qmlDirectory())
53+ screenshotFileName = QString("qrc:///Unity/Application/screenshots/%2")
54 .arg(screenshotId);
55 } else {
56- screenshotFileName = QString("%1/Dash/graphics/phone/screenshots/%2@12.png")
57- .arg(qmlDirectory())
58+ screenshotFileName = QString("qrc:///Unity/Application/screenshots/%2@12.png")
59 .arg(screenshotId);
60 }
61
62 if (screenshotFileName != m_screenshotFileName) {
63 m_screenshotFileName = screenshotFileName;
64
65- QUrl screenshotUrl = QString("file://%1").arg(m_screenshotFileName);
66 if (m_session) {
67- m_session->setScreenshot(screenshotUrl);
68+ m_session->setScreenshot(screenshotFileName);
69 }
70 }
71 }
72
73=== modified file 'tests/mocks/Unity/Application/ApplicationScreenshotProvider.cpp'
74--- tests/mocks/Unity/Application/ApplicationScreenshotProvider.cpp 2014-08-18 17:19:08 +0000
75+++ tests/mocks/Unity/Application/ApplicationScreenshotProvider.cpp 2015-11-19 20:34:30 +0000
76@@ -44,9 +44,13 @@
77 return QImage();
78 }
79
80+ QString screenshot = app->screenshot();
81+ // QImage doesn't understand qrc:/// but we have QUrls in use which don't like the empty protcol ":/"
82+ screenshot.replace("qrc:///", ":/");
83+
84 QImage image;
85- if (!image.load(app->screenshot())) {
86- qWarning() << "failed loading app image" << app->screenshot();
87+ if (!image.load(screenshot)) {
88+ qWarning() << "failed loading app image" << screenshot;
89 }
90
91
92
93=== modified file 'tests/mocks/Unity/Application/ApplicationTestInterface.cpp'
94--- tests/mocks/Unity/Application/ApplicationTestInterface.cpp 2015-08-03 15:00:47 +0000
95+++ tests/mocks/Unity/Application/ApplicationTestInterface.cpp 2015-11-19 20:34:30 +0000
96@@ -40,7 +40,7 @@
97 {
98 if (!existingSession) return nullptr;
99
100- QUrl screenshotUrl = QString("file://%1/Dash/graphics/phone/screenshots/%2@12.png")
101+ QUrl screenshotUrl = QString("qrc:///Unity/Application/screenshots/%2@12.png")
102 .arg(qmlDirectory())
103 .arg(surfaceImage);
104
105@@ -90,7 +90,7 @@
106 return 0;
107 }
108
109- QUrl screenshotUrl = QString("file://%1/Dash/graphics/phone/screenshots/%2@12.png")
110+ QUrl screenshotUrl = QString("qrc:///Unity/Application/screenshots/%2@12.png")
111 .arg(qmlDirectory())
112 .arg(surfaceImage);
113
114
115=== renamed directory 'qml/Dash/graphics/phone/screenshots' => 'tests/mocks/Unity/Application/resources/screenshots'
116=== modified file 'tests/mocks/Unity/Application/resources/surfaces.qrc'
117--- tests/mocks/Unity/Application/resources/surfaces.qrc 2015-04-30 20:46:41 +0000
118+++ tests/mocks/Unity/Application/resources/surfaces.qrc 2015-11-19 20:34:30 +0000
119@@ -3,5 +3,18 @@
120 <file>VirtualKeyboard.qml</file>
121 <file>MirSurfaceItem.qml</file>
122 <file>vkb_portrait.png</file>
123+ <file>screenshots/browser@12.png</file>
124+ <file>screenshots/camera@12.png</file>
125+ <file>screenshots/dialer@12.png</file>
126+ <file>screenshots/facebook@12.png</file>
127+ <file>screenshots/gallery@12.png</file>
128+ <file>screenshots/gmail-webapp.svg</file>
129+ <file>screenshots/map@12.png</file>
130+ <file>screenshots/music@12.png</file>
131+ <file>screenshots/twitter@12.png</file>
132+ <file>screenshots/ubuntu-weather-app.svg</file>
133+ <file>screenshots/unity8-dash@12.png</file>
134+ <file>screenshots/vkb_portrait.png</file>
135+ <file>screenshots/libreoffice@12.png</file>
136 </qresource>
137 </RCC>
138
139=== modified file 'tests/qmltests/Components/tst_ZoomableImage.qml'
140--- tests/qmltests/Components/tst_ZoomableImage.qml 2015-07-15 15:07:19 +0000
141+++ tests/qmltests/Components/tst_ZoomableImage.qml 2015-11-19 20:34:30 +0000
142@@ -36,7 +36,7 @@
143 }
144
145 property var widgetData2: {
146- "source": "../../../qml/Dash/graphics/phone/screenshots/gallery@12.png",
147+ "source": "../../mocks/Unity/Application/resources/screenshots/gallery@12.png",
148 "zoomable": true
149 }
150

Subscribers

People subscribed via source and target branches