Merge lp:~dobey/unity-scope-click/nonclick-touch-apps into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: Ted Gould
Approved revision: 482
Merged at revision: 490
Proposed branch: lp:~dobey/unity-scope-click/nonclick-touch-apps
Merge into: lp:unity-scope-click
Prerequisite: lp:~dobey/unity-scope-click/update-harness-tests
Diff against target: 84 lines (+41/-4)
3 files modified
libclickscope/click/interface.cpp (+9/-4)
libclickscope/tests/mock_ual.h (+1/-0)
libclickscope/tests/test_interface.cpp (+31/-0)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/nonclick-touch-apps
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
unity-api-1-bot continuous-integration Approve
Review via email: mp+307612@code.launchpad.net

Commit message

Fix regression from switch to ual, to show X-Ubuntu-Touch=true apps.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:482
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/116/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/834
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/841
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/648/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/116/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

Not directly related to this MR, but we should probably just kill the whitelist of allowed applications and show everything installed that is valid. This fix is fine on its own though.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libclickscope/click/interface.cpp'
--- libclickscope/click/interface.cpp 2016-09-26 21:00:12 +0000
+++ libclickscope/click/interface.cpp 2016-10-04 17:39:01 +0000
@@ -207,10 +207,6 @@
207 if (app.name.empty()) {207 if (app.name.empty()) {
208 app.name = std::string{ualapp->appId().appname.value()} + ".desktop";208 app.name = std::string{ualapp->appId().appname.value()} + ".desktop";
209 app.url = "application:///" + app.name;209 app.url = "application:///" + app.name;
210 if (!is_non_click_app(app.name)) {
211 qDebug() << "Skipping legacy app:" << QString::fromStdString(app.name);
212 continue;
213 }
214 } else {210 } else {
215 app.url = "appid://" + app.name + "/" + ualapp->appId().appname.value() + "/current-user-version";211 app.url = "appid://" + app.name + "/" + ualapp->appId().appname.value() + "/current-user-version";
216 }212 }
@@ -225,6 +221,15 @@
225 // Get the .desktop file info from UAL, since we're not ignoring221 // Get the .desktop file info from UAL, since we're not ignoring
226 try {222 try {
227 auto appinfo = ualapp->info();223 auto appinfo = ualapp->info();
224
225 // Only skip legacy apps that don't support Ubuntu Lifecycle
226 if (app.version.empty() &&
227 !is_non_click_app(app.name) &&
228 !appinfo->supportsUbuntuLifecycle()) {
229 qDebug() << "Skipping legacy app:" << QString::fromStdString(app.name);
230 continue;
231 }
232
228 app.title = appinfo->name();233 app.title = appinfo->name();
229 app.description = appinfo->description();234 app.description = appinfo->description();
230 app.icon_url = appinfo->iconPath();235 app.icon_url = appinfo->iconPath();
231236
=== modified file 'libclickscope/tests/mock_ual.h'
--- libclickscope/tests/mock_ual.h 2016-09-26 19:05:22 +0000
+++ libclickscope/tests/mock_ual.h 2016-10-04 17:39:01 +0000
@@ -96,6 +96,7 @@
96 DefaultValue<const ual::Application::Info::DefaultDepartment&>::Set(m_defaultDept);96 DefaultValue<const ual::Application::Info::DefaultDepartment&>::Set(m_defaultDept);
97 DefaultValue<const ual::Application::Info::IconPath&>::Set(m_ssPath);97 DefaultValue<const ual::Application::Info::IconPath&>::Set(m_ssPath);
98 DefaultValue<const ual::Application::Info::Keywords&>::Set(m_keywords);98 DefaultValue<const ual::Application::Info::Keywords&>::Set(m_keywords);
99 DefaultValue<ual::Application::Info::UbuntuLifecycle>::Set(ual::Application::Info::UbuntuLifecycle::from_raw(false));
99 }100 }
100101
101 const ual::Application::Info::Name& name()102 const ual::Application::Info::Name& name()
102103
=== modified file 'libclickscope/tests/test_interface.cpp'
--- libclickscope/tests/test_interface.cpp 2016-09-26 19:05:22 +0000
+++ libclickscope/tests/test_interface.cpp 2016-10-04 17:39:01 +0000
@@ -207,6 +207,37 @@
207 EXPECT_EQ("application:///messaging-app.desktop", results.begin()->url);207 EXPECT_EQ("application:///messaging-app.desktop", results.begin()->url);
208}208}
209209
210TEST_F(ClickInterfaceTest, testFindLegacyAppSkipped)
211{
212 FakeClickInterface iface;
213
214 EXPECT_CALL(iface, installed_apps()).Times(1).
215 WillOnce(Return(std::list<std::shared_ptr<ual::Application>>{
216 MockUALApplication::create(ual::AppID::find("skipped-app"),
217 std::shared_ptr<MockUALApplication::MockInfo>{new MockUALApplication::MockInfo("Skipped", "An app that's skipped", "skipped-app")})
218 }));
219 auto results = iface.search("");
220 ASSERT_EQ(0, results.size());
221}
222
223TEST_F(ClickInterfaceTest, testFindLegacyAppNotSkipped)
224{
225 FakeClickInterface iface;
226
227 std::shared_ptr<MockUALApplication::MockInfo> mockinfo{new MockUALApplication::MockInfo("Validity", "Valid app", "valid-app")};
228 EXPECT_CALL(iface, installed_apps()).Times(1).
229 WillOnce(Return(std::list<std::shared_ptr<ual::Application>>{
230 MockUALApplication::create(ual::AppID::find("valid-app"),
231 mockinfo)
232 }));
233 EXPECT_CALL(*mockinfo, supportsUbuntuLifecycle()).Times(1).
234 WillOnce(Return(ual::Application::Info::UbuntuLifecycle::from_raw(true)));
235
236 auto results = iface.search("Valid");
237 ASSERT_EQ(1u, results.size());
238 EXPECT_EQ("application:///valid-app.desktop", results.begin()->url);
239}
240
210// test that application with a default department id key in the desktop241// test that application with a default department id key in the desktop
211// file is returned when department matches242// file is returned when department matches
212TEST_F(ClickInterfaceTest, testFindAppsWithAppWithDefaultDepartmentId)243TEST_F(ClickInterfaceTest, testFindAppsWithAppWithDefaultDepartmentId)

Subscribers

People subscribed via source and target branches

to all changes: