Merge lp:~ted/url-dispatcher/devel into lp:url-dispatcher/16.10
- devel
- Merge into trunk.16.10
Status: | Merged |
---|---|
Approved by: | Ted Gould |
Approved revision: | 107 |
Merged at revision: | 94 |
Proposed branch: | lp:~ted/url-dispatcher/devel |
Merge into: | lp:url-dispatcher/16.10 |
Diff against target: |
2187 lines (+1247/-130) 50 files modified
CMakeLists.txt (+12/-4) data/CMakeLists.txt (+10/-0) data/bad-url.qml (+42/-0) data/url-dispatcher-update-user.conf.in (+1/-1) data/url-dispatcher.conf.in (+4/-0) debian/apparmor/url-dispatcher-bad-url-helper (+15/-0) debian/changelog (+25/-2) debian/control (+24/-5) debian/rules (+4/-0) debian/url-dispatcher-tools-gui.install (+2/-0) debian/url-dispatcher.install (+3/-0) gui/CMakeLists.txt (+13/-0) gui/url-dispatcher-gui.desktop.in (+6/-0) gui/url-dispatcher-gui.qml (+59/-0) gui/url-dispatcher-gui.svg (+129/-0) po/CMakeLists.txt (+39/-0) po/POTFILES.in (+1/-0) po/genpotfiles.sh (+6/-0) service/CMakeLists.txt (+11/-13) service/bad-url/CMakeLists.txt (+14/-0) service/bad-url/exec-tool.c (+42/-0) service/dispatcher.c (+141/-6) service/dispatcher.h (+2/-1) service/overlay-tracker-iface.h (+1/-0) service/overlay-tracker-mir.cpp (+70/-39) service/overlay-tracker-mir.h (+22/-8) service/overlay-tracker.cpp (+9/-0) service/overlay-tracker.h (+1/-0) service/scope-checker-facade.h (+27/-0) service/scope-checker.cpp (+114/-0) service/scope-checker.h (+29/-0) service/service.c (+9/-1) service/url-overlay/CMakeLists.txt (+14/-0) tests/CMakeLists.txt (+3/-0) tests/app-id-test.cc (+27/-29) tests/apparmor-mock.c (+36/-0) tests/apparmor-mock.h (+20/-0) tests/click-data/manifests/com.test.good.manifest (+1/-1) tests/click-data/manifests/com.test.multiple.manifest (+3/-3) tests/dispatcher-test.cc (+84/-1) tests/overlay-tracker-mock.h (+6/-0) tests/overlay-tracker-test.cpp (+41/-12) tests/scope-mock.h (+95/-0) tests/service-test.cc (+8/-3) tests/test-config.h.in (+1/-1) tests/ual-link-farm/com.test.good_app1_1.2.3.desktop (+1/-0) tests/ual-link-farm/com.test.multiple_app-first_1.2.3.desktop (+1/-0) tests/xdg-cache/libertine-container/container-id/rootfs/usr/share/applications/org.canonical.app1.desktop (+4/-0) tests/xdg-data/applications/foo-bar.desktop (+1/-0) tests/xdg-data/libertine/ContainersConfig.json (+14/-0) |
To merge this branch: | bzr merge lp:~ted/url-dispatcher/devel |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
unity-api-1-bot | continuous-integration | Needs Fixing | |
Unity API Team | Pending | ||
Review via email: mp+306286@code.launchpad.net |
This proposal supersedes a proposal from 2016-09-20.
Commit message
Pull all the branches together for merge conflicts
Description of the change
The merge conflicts were too difficult to make easy sense of, so pulled everything into a single branch that we can then land. This is the combination of a whole host of branches.
unity-api-1-bot (unity-api-1-bot) wrote : | # |
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:105
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:106
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:106
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:106
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
unity-api-1-bot (unity-api-1-bot) wrote : | # |
FAILED: Continuous integration, rev:107
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Ted Gould (ted) wrote : | # |
Marking as approved as the subbranches are and this is just an integration branch.
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2015-06-11 21:38:13 +0000 | |||
3 | +++ CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
4 | @@ -3,7 +3,7 @@ | |||
5 | 3 | 3 | ||
6 | 4 | string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not. | 4 | string(TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_lower) # Build types should always be lowercase but sometimes they are not. |
7 | 5 | 5 | ||
9 | 6 | if (${cmake_build_type_lower} STREQUAL debug) | 6 | if ("${cmake_build_type_lower}" STREQUAL "debug") |
10 | 7 | option (werror "Treat warnings as errors." FALSE) | 7 | option (werror "Treat warnings as errors." FALSE) |
11 | 8 | else() | 8 | else() |
12 | 9 | option (werror "Treat warnings as errors." TRUE) | 9 | option (werror "Treat warnings as errors." TRUE) |
13 | @@ -30,7 +30,7 @@ | |||
14 | 30 | include(UseConstantBuilder) | 30 | include(UseConstantBuilder) |
15 | 31 | 31 | ||
16 | 32 | # Workaround for libexecdir on debian | 32 | # Workaround for libexecdir on debian |
18 | 33 | if (EXISTS "/etc/debian_version") | 33 | if (EXISTS "/etc/debian_version") |
19 | 34 | set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR}) | 34 | set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR}) |
20 | 35 | set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}") | 35 | set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}") |
21 | 36 | endif() | 36 | endif() |
22 | @@ -42,7 +42,7 @@ | |||
23 | 42 | # Since gdbus-codegen does not produce warning-free code | 42 | # Since gdbus-codegen does not produce warning-free code |
24 | 43 | # and we use -Werror, only enable these warnings for debug | 43 | # and we use -Werror, only enable these warnings for debug |
25 | 44 | # builds. Drop this once the issue has been fixed and landed. | 44 | # builds. Drop this once the issue has been fixed and landed. |
27 | 45 | if (${cmake_build_type_lower} STREQUAL debug) | 45 | if ("${cmake_build_type_lower}" STREQUAL debug) |
28 | 46 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")# -Wextra") | 46 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpedantic")# -Wextra") |
29 | 47 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wextra") | 47 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wextra") |
30 | 48 | endif() | 48 | endif() |
31 | @@ -50,7 +50,7 @@ | |||
32 | 50 | if (${werror}) | 50 | if (${werror}) |
33 | 51 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") | 51 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") |
34 | 52 | set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror") | 52 | set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -Werror") |
36 | 53 | endif() | 53 | endif() |
37 | 54 | 54 | ||
38 | 55 | pkg_check_modules(UBUNTU_APP_LAUNCH REQUIRED ubuntu-app-launch-2>=0.5) | 55 | pkg_check_modules(UBUNTU_APP_LAUNCH REQUIRED ubuntu-app-launch-2>=0.5) |
39 | 56 | include_directories(${UBUNTU_APP_LAUNCH_INCLUDE_DIRS}) | 56 | include_directories(${UBUNTU_APP_LAUNCH_INCLUDE_DIRS}) |
40 | @@ -79,6 +79,12 @@ | |||
41 | 79 | pkg_check_modules(CLICK REQUIRED click-0.4) | 79 | pkg_check_modules(CLICK REQUIRED click-0.4) |
42 | 80 | include_directories(${CLICK_INCLUDE_DIRS}) | 80 | include_directories(${CLICK_INCLUDE_DIRS}) |
43 | 81 | 81 | ||
44 | 82 | pkg_check_modules(SCOPES REQUIRED libunity-scopes) | ||
45 | 83 | include_directories(${SCOPES_INCLUDE_DIRS}) | ||
46 | 84 | |||
47 | 85 | pkg_check_modules(APPARMOR REQUIRED libapparmor) | ||
48 | 86 | include_directories(${APPARMOR_INCLUDE_DIRS}) | ||
49 | 87 | |||
50 | 82 | if(${LOCAL_INSTALL}) | 88 | if(${LOCAL_INSTALL}) |
51 | 83 | set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services/") | 89 | set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services/") |
52 | 84 | else() | 90 | else() |
53 | @@ -103,6 +109,7 @@ | |||
54 | 103 | add_subdirectory(service) | 109 | add_subdirectory(service) |
55 | 104 | add_subdirectory(liburl-dispatcher) | 110 | add_subdirectory(liburl-dispatcher) |
56 | 105 | add_subdirectory(tools) | 111 | add_subdirectory(tools) |
57 | 112 | add_subdirectory(gui) | ||
58 | 106 | 113 | ||
59 | 107 | # testing & coverage | 114 | # testing & coverage |
60 | 108 | if (${enable_tests}) | 115 | if (${enable_tests}) |
61 | @@ -116,3 +123,4 @@ | |||
62 | 116 | add_subdirectory(tests) | 123 | add_subdirectory(tests) |
63 | 117 | endif () | 124 | endif () |
64 | 118 | 125 | ||
65 | 126 | add_subdirectory(po) | ||
66 | 119 | 127 | ||
67 | === modified file 'data/CMakeLists.txt' | |||
68 | --- data/CMakeLists.txt 2015-11-06 22:59:11 +0000 | |||
69 | +++ data/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
70 | @@ -102,3 +102,13 @@ | |||
71 | 102 | @ONLY | 102 | @ONLY |
72 | 103 | ) | 103 | ) |
73 | 104 | 104 | ||
74 | 105 | ########################### | ||
75 | 106 | # QML | ||
76 | 107 | ########################### | ||
77 | 108 | |||
78 | 109 | install( | ||
79 | 110 | FILES | ||
80 | 111 | bad-url.qml | ||
81 | 112 | DESTINATION ${datadir}/url-dispatcher | ||
82 | 113 | ) | ||
83 | 114 | |||
84 | 105 | 115 | ||
85 | === added file 'data/bad-url.qml' | |||
86 | --- data/bad-url.qml 1970-01-01 00:00:00 +0000 | |||
87 | +++ data/bad-url.qml 2016-11-07 16:32:23 +0000 | |||
88 | @@ -0,0 +1,42 @@ | |||
89 | 1 | /* | ||
90 | 2 | * Copyright © 2015 Canonical Ltd. | ||
91 | 3 | * | ||
92 | 4 | * This program is free software; you can redistribute it and/or modify | ||
93 | 5 | * it under the terms of the GNU General Public License as published by | ||
94 | 6 | * the Free Software Foundation; version 3. | ||
95 | 7 | * | ||
96 | 8 | * This program is distributed in the hope that it will be useful, | ||
97 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
98 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
99 | 11 | * GNU General Public License for more details. | ||
100 | 12 | * | ||
101 | 13 | * You should have received a copy of the GNU General Public License | ||
102 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
103 | 15 | */ | ||
104 | 16 | |||
105 | 17 | import QtQuick 2.0 | ||
106 | 18 | import Ubuntu.Components 1.0 | ||
107 | 19 | import Ubuntu.Components.Popups 1.0 | ||
108 | 20 | |||
109 | 21 | MainView { | ||
110 | 22 | applicationName: "com.canonical.url-dispatcher.bad-url-prompt" | ||
111 | 23 | automaticOrientation: true | ||
112 | 24 | backgroundColor: "transparent" | ||
113 | 25 | anchors.fill: parent | ||
114 | 26 | |||
115 | 27 | Component { | ||
116 | 28 | id: dialog | ||
117 | 29 | Dialog { | ||
118 | 30 | title: i18n.tr("Unrecognized Address") | ||
119 | 31 | text: i18n.tr("Ubuntu can't open addresses of type “%1”.").arg(Qt.application.arguments[2].split(':')[0]) | ||
120 | 32 | |||
121 | 33 | Button { | ||
122 | 34 | text: i18n.tr("OK") | ||
123 | 35 | color: UbuntuColors.orange | ||
124 | 36 | onClicked: Qt.quit() | ||
125 | 37 | } | ||
126 | 38 | } | ||
127 | 39 | } | ||
128 | 40 | |||
129 | 41 | Component.onCompleted: PopupUtils.open(dialog) | ||
130 | 42 | } | ||
131 | 0 | 43 | ||
132 | === modified file 'data/url-dispatcher-update-user.conf.in' | |||
133 | --- data/url-dispatcher-update-user.conf.in 2015-09-04 19:53:45 +0000 | |||
134 | +++ data/url-dispatcher-update-user.conf.in 2016-11-07 16:32:23 +0000 | |||
135 | @@ -13,4 +13,4 @@ | |||
136 | 13 | fi | 13 | fi |
137 | 14 | end script | 14 | end script |
138 | 15 | 15 | ||
140 | 16 | exec @pkglibexecdir@/update-directory "~/.config/url-dispatcher/urls/*.url-dispatcher" | 16 | exec @pkglibexecdir@/update-directory "${HOME}/.config/url-dispatcher/urls/" |
141 | 17 | 17 | ||
142 | === modified file 'data/url-dispatcher.conf.in' | |||
143 | --- data/url-dispatcher.conf.in 2015-11-06 23:05:12 +0000 | |||
144 | +++ data/url-dispatcher.conf.in 2016-11-07 16:32:23 +0000 | |||
145 | @@ -7,6 +7,7 @@ | |||
146 | 7 | respawn | 7 | respawn |
147 | 8 | 8 | ||
148 | 9 | emits application-start | 9 | emits application-start |
149 | 10 | emits untrusted-helper-type-end | ||
150 | 10 | 11 | ||
151 | 11 | script | 12 | script |
152 | 12 | @pkglibexecdir@/url-dispatcher | 13 | @pkglibexecdir@/url-dispatcher |
153 | @@ -18,3 +19,6 @@ | |||
154 | 18 | fi | 19 | fi |
155 | 19 | end script | 20 | end script |
156 | 20 | 21 | ||
157 | 22 | post-stop script | ||
158 | 23 | initctl emit untrusted-helper-type-end HELPER_TYPE=url-overlay | ||
159 | 24 | end script | ||
160 | 21 | 25 | ||
161 | === added directory 'debian/apparmor' | |||
162 | === added file 'debian/apparmor/url-dispatcher-bad-url-helper' | |||
163 | --- debian/apparmor/url-dispatcher-bad-url-helper 1970-01-01 00:00:00 +0000 | |||
164 | +++ debian/apparmor/url-dispatcher-bad-url-helper 2016-11-07 16:32:23 +0000 | |||
165 | @@ -0,0 +1,15 @@ | |||
166 | 1 | # vim:syntax=apparmor | ||
167 | 2 | #include <tunables/global> | ||
168 | 3 | |||
169 | 4 | # Mostly unconfined. Don't allow capability or any mount rules. Also ensure that | ||
170 | 5 | # exec inherits from this profile | ||
171 | 6 | profile url-dispatcher-bad-url-helper (attach_disconnected) { | ||
172 | 7 | network, | ||
173 | 8 | / rwkl, | ||
174 | 9 | /** rwlkm, | ||
175 | 10 | /** pix, | ||
176 | 11 | dbus, | ||
177 | 12 | signal, | ||
178 | 13 | ptrace, | ||
179 | 14 | unix, | ||
180 | 15 | } | ||
181 | 0 | 16 | ||
182 | === modified file 'debian/changelog' | |||
183 | --- debian/changelog 2016-08-16 15:20:27 +0000 | |||
184 | +++ debian/changelog 2016-11-07 16:32:23 +0000 | |||
185 | @@ -1,3 +1,26 @@ | |||
186 | 1 | url-dispatcher (0.1+16.04.20151110-0ubuntu2) UNRELEASED; urgency=medium | ||
187 | 2 | |||
188 | 3 | [ Florian Boucault ] | ||
189 | 4 | * Crossbuilding Fixes | ||
190 | 5 | |||
191 | 6 | [ Larry Price ] | ||
192 | 7 | * App ID should allow package names with dots. (LP: #1591342) (LP: #1606498) | ||
193 | 8 | |||
194 | 9 | [ Ted Gould ] | ||
195 | 10 | * Check versions of appid:// urls to reduce the number of invalid appids | ||
196 | 11 | we send to UAL (LP: #1352656) | ||
197 | 12 | * Scope testing for the scope:// URL and overlays that should be over | ||
198 | 13 | the dash | ||
199 | 14 | * Protect the dash from getting NULL urls (LP: #1476257) | ||
200 | 15 | * Make sure URL Overlays are shutdown on exit | ||
201 | 16 | * Remove the wildcard that is confusing the update script (LP: #1461496) | ||
202 | 17 | * Not using a message that isn't set properly (LP: #1608009) | ||
203 | 18 | * Fixing tests to adjust for UAL changes | ||
204 | 19 | * Add a small GUI helper tool for testing | ||
205 | 20 | * Show error dialog over apps that use Bad URLs (LP: #1370008) | ||
206 | 21 | |||
207 | 22 | -- Ted Gould <ted@ubuntu.com> Tue, 20 Sep 2016 16:17:26 -0500 | ||
208 | 23 | |||
209 | 1 | url-dispatcher (0.1+16.10.20160816.1-0ubuntu1) yakkety; urgency=medium | 24 | url-dispatcher (0.1+16.10.20160816.1-0ubuntu1) yakkety; urgency=medium |
210 | 2 | 25 | ||
211 | 3 | * No chnage rebuild for UAL migration | 26 | * No chnage rebuild for UAL migration |
212 | @@ -5,9 +28,9 @@ | |||
213 | 5 | -- Ted Gould <ted@gould.cx> Tue, 16 Aug 2016 15:20:27 +0000 | 28 | -- Ted Gould <ted@gould.cx> Tue, 16 Aug 2016 15:20:27 +0000 |
214 | 6 | 29 | ||
215 | 7 | url-dispatcher (0.1+16.04.20151110-0ubuntu2) xenial; urgency=high | 30 | url-dispatcher (0.1+16.04.20151110-0ubuntu2) xenial; urgency=high |
217 | 8 | 31 | ||
218 | 9 | * No change rebuild for s390x. | 32 | * No change rebuild for s390x. |
220 | 10 | 33 | ||
221 | 11 | -- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 11 Dec 2015 01:30:51 +0000 | 34 | -- Dimitri John Ledkov <xnox@ubuntu.com> Fri, 11 Dec 2015 01:30:51 +0000 |
222 | 12 | 35 | ||
223 | 13 | url-dispatcher (0.1+16.04.20151110-0ubuntu1) xenial; urgency=medium | 36 | url-dispatcher (0.1+16.04.20151110-0ubuntu1) xenial; urgency=medium |
224 | 14 | 37 | ||
225 | === modified file 'debian/control' | |||
226 | --- debian/control 2015-06-08 15:27:58 +0000 | |||
227 | +++ debian/control 2016-11-07 16:32:23 +0000 | |||
228 | @@ -7,8 +7,10 @@ | |||
229 | 7 | dbus-test-runner, | 7 | dbus-test-runner, |
230 | 8 | debhelper (>= 9), | 8 | debhelper (>= 9), |
231 | 9 | dh-autoreconf, | 9 | dh-autoreconf, |
232 | 10 | dh-apparmor, | ||
233 | 10 | gtester2xunit, | 11 | gtester2xunit, |
234 | 11 | intltool, | 12 | intltool, |
235 | 13 | libapparmor-dev, | ||
236 | 12 | libclick-0.4-dev, | 14 | libclick-0.4-dev, |
237 | 13 | libdbus-1-dev, | 15 | libdbus-1-dev, |
238 | 14 | libdbustest1-dev (>= 14.04.0), | 16 | libdbustest1-dev (>= 14.04.0), |
239 | @@ -17,11 +19,12 @@ | |||
240 | 17 | libgtest-dev, | 19 | libgtest-dev, |
241 | 18 | libsqlite3-dev, | 20 | libsqlite3-dev, |
242 | 19 | libubuntu-app-launch2-dev (>= 0.5), | 21 | libubuntu-app-launch2-dev (>= 0.5), |
248 | 20 | python3, | 22 | libunity-scopes-dev, |
249 | 21 | python3-dbusmock, | 23 | python3:any, |
250 | 22 | python3-fixtures, | 24 | python3-dbusmock <!cross>, |
251 | 23 | python3-nose, | 25 | python3-fixtures <!cross>, |
252 | 24 | python3-testtools, | 26 | python3-nose <!cross>, |
253 | 27 | python3-testtools <!cross>, | ||
254 | 25 | sqlite3, | 28 | sqlite3, |
255 | 26 | upstart, | 29 | upstart, |
256 | 27 | Standards-Version: 3.9.4 | 30 | Standards-Version: 3.9.4 |
257 | @@ -38,6 +41,9 @@ | |||
258 | 38 | Pre-Depends: ${misc:Pre-Depends}, | 41 | Pre-Depends: ${misc:Pre-Depends}, |
259 | 39 | Depends: ${misc:Depends}, | 42 | Depends: ${misc:Depends}, |
260 | 40 | ${shlibs:Depends}, | 43 | ${shlibs:Depends}, |
261 | 44 | # For the bad URL dialog | ||
262 | 45 | qtchooser, | ||
263 | 46 | qtdeclarative5-ubuntu-ui-toolkit-plugin, | ||
264 | 41 | Description: service to allow sending of URLs and get handlers started | 47 | Description: service to allow sending of URLs and get handlers started |
265 | 42 | Allows applications to request a URL to be opened and handled by another | 48 | Allows applications to request a URL to be opened and handled by another |
266 | 43 | process without seeing the list of other applications on the system or | 49 | process without seeing the list of other applications on the system or |
267 | @@ -57,6 +63,19 @@ | |||
268 | 57 | . | 63 | . |
269 | 58 | This package provides tools for working with the URL Dispatcher. | 64 | This package provides tools for working with the URL Dispatcher. |
270 | 59 | 65 | ||
271 | 66 | Package: url-dispatcher-tools-gui | ||
272 | 67 | Architecture: any | ||
273 | 68 | Depends: url-dispatcher (= ${binary:Version}), | ||
274 | 69 | ${misc:Depends}, | ||
275 | 70 | ${shlibs:Depends}, | ||
276 | 71 | qtchooser, | ||
277 | 72 | Description: GUI tools for working with the URL Dispatcher. | ||
278 | 73 | Allows applications to request a URL to be opened and handled by another | ||
279 | 74 | process without seeing the list of other applications on the system or | ||
280 | 75 | starting them inside its own Application Confinement. | ||
281 | 76 | . | ||
282 | 77 | This package provides GUI tools for working with the URL Dispatcher. | ||
283 | 78 | |||
284 | 60 | Package: liburl-dispatcher1 | 79 | Package: liburl-dispatcher1 |
285 | 61 | Section: libs | 80 | Section: libs |
286 | 62 | Architecture: any | 81 | Architecture: any |
287 | 63 | 82 | ||
288 | === modified file 'debian/rules' | |||
289 | --- debian/rules 2015-05-20 16:22:44 +0000 | |||
290 | +++ debian/rules 2016-11-07 16:32:23 +0000 | |||
291 | @@ -3,6 +3,9 @@ | |||
292 | 3 | export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 | 3 | export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 |
293 | 4 | export G_MESSAGES_DEBUG=all | 4 | export G_MESSAGES_DEBUG=all |
294 | 5 | export URL_DISPATCHER_DISABLE_RECOVERABLE_ERROR=1 | 5 | export URL_DISPATCHER_DISABLE_RECOVERABLE_ERROR=1 |
295 | 6 | ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) | ||
296 | 7 | export DEB_BUILD_PROFILES := cross | ||
297 | 8 | endif | ||
298 | 6 | 9 | ||
299 | 7 | %: | 10 | %: |
300 | 8 | dh $@ --fail-missing --with click | 11 | dh $@ --fail-missing --with click |
301 | @@ -12,6 +15,7 @@ | |||
302 | 12 | install -m 644 debian/source_url-dispatcher.py debian/url-dispatcher/usr/share/apport/package-hooks/ | 15 | install -m 644 debian/source_url-dispatcher.py debian/url-dispatcher/usr/share/apport/package-hooks/ |
303 | 13 | mkdir -p debian/url-dispatcher/etc/apport/crashdb.conf.d/ | 16 | mkdir -p debian/url-dispatcher/etc/apport/crashdb.conf.d/ |
304 | 14 | install -m 644 debian/url-dispatcher-crashdb.conf debian/url-dispatcher/etc/apport/crashdb.conf.d/ | 17 | install -m 644 debian/url-dispatcher-crashdb.conf debian/url-dispatcher/etc/apport/crashdb.conf.d/ |
305 | 18 | dh_apparmor --profile-name=url-dispatcher-bad-url-helper -p url-dispatcher | ||
306 | 15 | dh_install --fail-missing | 19 | dh_install --fail-missing |
307 | 16 | 20 | ||
308 | 17 | override_dh_click: | 21 | override_dh_click: |
309 | 18 | 22 | ||
310 | === added file 'debian/url-dispatcher-tools-gui.install' | |||
311 | --- debian/url-dispatcher-tools-gui.install 1970-01-01 00:00:00 +0000 | |||
312 | +++ debian/url-dispatcher-tools-gui.install 2016-11-07 16:32:23 +0000 | |||
313 | @@ -0,0 +1,2 @@ | |||
314 | 1 | /usr/share/applications/ | ||
315 | 2 | /usr/share/url-dispatcher/gui/ | ||
316 | 0 | 3 | ||
317 | === modified file 'debian/url-dispatcher.install' | |||
318 | --- debian/url-dispatcher.install 2015-06-12 16:00:37 +0000 | |||
319 | +++ debian/url-dispatcher.install 2016-11-07 16:32:23 +0000 | |||
320 | @@ -1,5 +1,8 @@ | |||
321 | 1 | usr/lib/*/url-dispatcher | 1 | usr/lib/*/url-dispatcher |
322 | 2 | usr/lib/*/ubuntu-app-launch/url-overlay/exec-tool | 2 | usr/lib/*/ubuntu-app-launch/url-overlay/exec-tool |
323 | 3 | usr/lib/*/ubuntu-app-launch/bad-url/exec-tool | ||
324 | 3 | usr/share/dbus-1 | 4 | usr/share/dbus-1 |
325 | 4 | usr/share/upstart/sessions | 5 | usr/share/upstart/sessions |
326 | 6 | usr/share/url-dispatcher/bad-url.qml | ||
327 | 5 | usr/bin/url-dispatcher-dump | 7 | usr/bin/url-dispatcher-dump |
328 | 8 | debian/apparmor/url-dispatcher-bad-url-helper etc/apparmor.d | ||
329 | 6 | 9 | ||
330 | === added directory 'gui' | |||
331 | === added file 'gui/CMakeLists.txt' | |||
332 | --- gui/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
333 | +++ gui/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
334 | @@ -0,0 +1,13 @@ | |||
335 | 1 | |||
336 | 2 | install(FILES | ||
337 | 3 | url-dispatcher-gui.qml | ||
338 | 4 | url-dispatcher-gui.svg | ||
339 | 5 | DESTINATION "${CMAKE_INSTALL_DATADIR}/url-dispatcher/gui/") | ||
340 | 6 | install(FILES | ||
341 | 7 | ${CMAKE_CURRENT_BINARY_DIR}/url-dispatcher-gui.desktop | ||
342 | 8 | DESTINATION "${CMAKE_INSTALL_DATADIR}/applications/") | ||
343 | 9 | |||
344 | 10 | configure_file( | ||
345 | 11 | "url-dispatcher-gui.desktop.in" | ||
346 | 12 | "url-dispatcher-gui.desktop" | ||
347 | 13 | @ONLY) | ||
348 | 0 | 14 | ||
349 | === added file 'gui/url-dispatcher-gui.desktop.in' | |||
350 | --- gui/url-dispatcher-gui.desktop.in 1970-01-01 00:00:00 +0000 | |||
351 | +++ gui/url-dispatcher-gui.desktop.in 2016-11-07 16:32:23 +0000 | |||
352 | @@ -0,0 +1,6 @@ | |||
353 | 1 | [Desktop Entry] | ||
354 | 2 | Name=URL Dispatcher GUI | ||
355 | 3 | Icon=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/url-dispatcher/gui/url-dispatcher-gui.svg | ||
356 | 4 | Type=Application | ||
357 | 5 | Exec=qmlscene @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATADIR@/url-dispatcher/gui/url-dispatcher-gui.qml | ||
358 | 6 | X-Ubuntu-Touch=true | ||
359 | 0 | 7 | ||
360 | === added file 'gui/url-dispatcher-gui.qml' | |||
361 | --- gui/url-dispatcher-gui.qml 1970-01-01 00:00:00 +0000 | |||
362 | +++ gui/url-dispatcher-gui.qml 2016-11-07 16:32:23 +0000 | |||
363 | @@ -0,0 +1,59 @@ | |||
364 | 1 | import QtQuick 2.4 | ||
365 | 2 | import Ubuntu.Components 1.3 | ||
366 | 3 | import Ubuntu.Components.ListItems 1.3 | ||
367 | 4 | |||
368 | 5 | MainView { | ||
369 | 6 | applicationName: "url-dispatcher-gui" | ||
370 | 7 | |||
371 | 8 | Page { | ||
372 | 9 | header: PageHeader { | ||
373 | 10 | title: "URL Dispatcher GUI" | ||
374 | 11 | flickable: flickme | ||
375 | 12 | } | ||
376 | 13 | |||
377 | 14 | Flickable { | ||
378 | 15 | id: flickme | ||
379 | 16 | anchors.fill: parent | ||
380 | 17 | |||
381 | 18 | Column { | ||
382 | 19 | anchors.fill: parent | ||
383 | 20 | |||
384 | 21 | ListItem { | ||
385 | 22 | contentItem.anchors { | ||
386 | 23 | leftMargin: units.gu(2) | ||
387 | 24 | rightMargin: units.gu(2) | ||
388 | 25 | topMargin: units.gu(1) | ||
389 | 26 | bottomMargin: units.gu(1) | ||
390 | 27 | } | ||
391 | 28 | |||
392 | 29 | TextField { | ||
393 | 30 | id: textbox | ||
394 | 31 | anchors.fill: parent | ||
395 | 32 | placeholderText: "URL (e.g. 'http://ubuntu.com')" | ||
396 | 33 | } | ||
397 | 34 | } | ||
398 | 35 | |||
399 | 36 | ListItem { | ||
400 | 37 | contentItem.anchors { | ||
401 | 38 | leftMargin: units.gu(2) | ||
402 | 39 | rightMargin: units.gu(2) | ||
403 | 40 | topMargin: units.gu(1) | ||
404 | 41 | bottomMargin: units.gu(1) | ||
405 | 42 | } | ||
406 | 43 | |||
407 | 44 | Button { | ||
408 | 45 | anchors.fill: parent | ||
409 | 46 | text: "Send URL" | ||
410 | 47 | onClicked: { | ||
411 | 48 | console.log("Sending URL: " + textbox.text) | ||
412 | 49 | Qt.openUrlExternally(textbox.text) | ||
413 | 50 | } | ||
414 | 51 | } | ||
415 | 52 | } | ||
416 | 53 | } | ||
417 | 54 | } | ||
418 | 55 | |||
419 | 56 | } | ||
420 | 57 | |||
421 | 58 | |||
422 | 59 | } | ||
423 | 0 | 60 | ||
424 | === added file 'gui/url-dispatcher-gui.svg' | |||
425 | --- gui/url-dispatcher-gui.svg 1970-01-01 00:00:00 +0000 | |||
426 | +++ gui/url-dispatcher-gui.svg 2016-11-07 16:32:23 +0000 | |||
427 | @@ -0,0 +1,129 @@ | |||
428 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
429 | 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
430 | 3 | |||
431 | 4 | <svg | ||
432 | 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
433 | 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
434 | 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
435 | 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
436 | 9 | xmlns="http://www.w3.org/2000/svg" | ||
437 | 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
438 | 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
439 | 12 | width="256" | ||
440 | 13 | height="256" | ||
441 | 14 | viewBox="0 0 67.733332 67.733335" | ||
442 | 15 | version="1.1" | ||
443 | 16 | id="svg8" | ||
444 | 17 | inkscape:version="0.92pre1 15068" | ||
445 | 18 | sodipodi:docname="url-dispatcher-gui.svg"> | ||
446 | 19 | <defs | ||
447 | 20 | id="defs2" /> | ||
448 | 21 | <sodipodi:namedview | ||
449 | 22 | id="base" | ||
450 | 23 | pagecolor="#ffffff" | ||
451 | 24 | bordercolor="#666666" | ||
452 | 25 | borderopacity="1.0" | ||
453 | 26 | inkscape:pageopacity="1" | ||
454 | 27 | inkscape:pageshadow="2" | ||
455 | 28 | inkscape:zoom="3.375" | ||
456 | 29 | inkscape:cx="128" | ||
457 | 30 | inkscape:cy="128.88889" | ||
458 | 31 | inkscape:document-units="mm" | ||
459 | 32 | inkscape:current-layer="g3484" | ||
460 | 33 | showgrid="false" | ||
461 | 34 | units="px" | ||
462 | 35 | inkscape:showpageshadow="false" | ||
463 | 36 | inkscape:pagecheckerboard="false" | ||
464 | 37 | inkscape:window-width="1920" | ||
465 | 38 | inkscape:window-height="1050" | ||
466 | 39 | inkscape:window-x="0" | ||
467 | 40 | inkscape:window-y="30" | ||
468 | 41 | inkscape:window-maximized="1" /> | ||
469 | 42 | <metadata | ||
470 | 43 | id="metadata5"> | ||
471 | 44 | <rdf:RDF> | ||
472 | 45 | <cc:Work | ||
473 | 46 | rdf:about=""> | ||
474 | 47 | <dc:format>image/svg+xml</dc:format> | ||
475 | 48 | <dc:type | ||
476 | 49 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
477 | 50 | <dc:title></dc:title> | ||
478 | 51 | </cc:Work> | ||
479 | 52 | </rdf:RDF> | ||
480 | 53 | </metadata> | ||
481 | 54 | <g | ||
482 | 55 | inkscape:label="Layer 1" | ||
483 | 56 | inkscape:groupmode="layer" | ||
484 | 57 | id="layer1" | ||
485 | 58 | transform="translate(0,-229.26665)"> | ||
486 | 59 | <g | ||
487 | 60 | id="g3484" | ||
488 | 61 | transform="translate(0,-2.732619)"> | ||
489 | 62 | <path | ||
490 | 63 | inkscape:connector-curvature="0" | ||
491 | 64 | id="path3486" | ||
492 | 65 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:17.4939785px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.69975913px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
493 | 66 | d="m 16.89882,270.19082 q -1.903345,0 -3.302863,-0.5878 -1.399518,-0.58779 -2.29521,-1.59545 -0.895692,-1.03564 -1.3435374,-2.43516 -0.4198555,-1.39952 -0.4198555,-3.02296 V 250.37364 H 12.25242 v 11.86792 q 0,2.911 1.287556,4.22654 1.287557,1.31555 3.358844,1.31555 1.035644,0 1.875355,-0.30789 0.867701,-0.33589 1.483489,-1.00766 0.615788,-0.67177 0.951673,-1.70741 0.335884,-1.06363 0.335884,-2.51913 v -11.86792 h 2.715066 v 12.17581 q 0,1.62344 -0.447846,3.02296 -0.419856,1.39952 -1.343538,2.43516 -0.895692,1.00766 -2.29521,1.59545 -1.371528,0.5878 -3.274873,0.5878 z" /> | ||
494 | 67 | <path | ||
495 | 68 | inkscape:connector-curvature="0" | ||
496 | 69 | id="path3488" | ||
497 | 70 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:17.4939785px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.69975913px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
498 | 71 | d="m 38.409416,261.65376 q 0.447846,0.55981 1.119614,1.48349 0.69976,0.89569 1.427509,2.01531 0.72775,1.09162 1.427509,2.29521 0.727749,1.20358 1.231576,2.3232 h -2.966979 q -0.559807,-1.06364 -1.231576,-2.15526 -0.643778,-1.09163 -1.315547,-2.07129 -0.671769,-1.00765 -1.343538,-1.87535 -0.643778,-0.86771 -1.175595,-1.51148 -0.363875,0.028 -0.75574,0.028 -0.363875,0 -0.75574,0 h -2.435162 v 7.58539 h -2.715065 v -19.11742 q 1.147605,-0.27991 2.547123,-0.36388 1.427509,-0.11196 2.603104,-0.11196 4.086593,0 6.213861,1.53947 2.155258,1.53947 2.155258,4.59042 0,1.93133 -1.035643,3.30286 -1.007653,1.37153 -2.994969,2.0433 z m -4.114584,-9.09687 q -1.735403,0 -2.659085,0.084 v 7.30549 h 1.931335 q 1.399519,0 2.519133,-0.13995 1.119615,-0.13996 1.875355,-0.53182 0.78373,-0.39187 1.203586,-1.09163 0.419855,-0.72775 0.419855,-1.90334 0,-1.09163 -0.419855,-1.81937 -0.419856,-0.72775 -1.147605,-1.14761 -0.69976,-0.41986 -1.679422,-0.5878 -0.951673,-0.16794 -2.043297,-0.16794 z" /> | ||
499 | 72 | <path | ||
500 | 73 | inkscape:connector-curvature="0" | ||
501 | 74 | id="path3490" | ||
502 | 75 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:17.4939785px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.69975913px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
503 | 76 | d="m 58.19598,267.41977 v 2.3512 H 46.523997 v -19.39733 h 2.715066 v 17.04613 z" /> | ||
504 | 77 | <path | ||
505 | 78 | inkscape:connector-curvature="0" | ||
506 | 79 | id="path3493" | ||
507 | 80 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
508 | 81 | d="m 16.002471,276.35782 q 0,0.87908 -0.273492,1.5335 -0.273492,0.64466 -0.771638,1.07444 -0.498145,0.42 -1.191643,0.63489 -0.693497,0.20512 -1.52374,0.20512 -0.410238,0 -0.908384,-0.0391 -0.488379,-0.0293 -0.888849,-0.12698 v -6.56381 q 0.40047,-0.0977 0.888849,-0.12698 0.498146,-0.0391 0.908384,-0.0391 0.830243,0 1.52374,0.21489 0.693498,0.20512 1.191643,0.63489 0.498146,0.42001 0.771638,1.07444 0.273492,0.64465 0.273492,1.52374 z m -3.682373,2.6177 q 1.347925,0 2.012119,-0.68373 0.664195,-0.69349 0.664195,-1.93397 0,-1.24049 -0.664195,-1.92421 -0.664194,-0.6935 -2.012119,-0.6935 -0.40047,0 -0.625124,0.01 -0.214887,0.01 -0.302795,0.0195 v 5.17681 q 0.08791,0.01 0.302795,0.0195 0.224654,0.01 0.625124,0.01 z" /> | ||
509 | 82 | <path | ||
510 | 83 | inkscape:connector-curvature="0" | ||
511 | 84 | id="path3495" | ||
512 | 85 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
513 | 86 | d="m 18.257711,279.74716 h -0.908384 v -5.07913 h 0.908384 z m -0.459076,-5.99728 q -0.244189,0 -0.420005,-0.15629 -0.166049,-0.16604 -0.166049,-0.43954 0,-0.27349 0.166049,-0.42977 0.175816,-0.16605 0.420005,-0.16605 0.244189,0 0.410238,0.16605 0.175816,0.15628 0.175816,0.42977 0,0.2735 -0.175816,0.43954 -0.166049,0.15629 -0.410238,0.15629 z" /> | ||
514 | 87 | <path | ||
515 | 88 | inkscape:connector-curvature="0" | ||
516 | 89 | id="path3497" | ||
517 | 90 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
518 | 91 | d="m 21.011249,279.09273 q 0.556751,0 0.820476,-0.14651 0.273492,-0.14651 0.273492,-0.46884 0,-0.3321 -0.263725,-0.52745 -0.263724,-0.19535 -0.869313,-0.43954 -0.293027,-0.11721 -0.566519,-0.23442 -0.263725,-0.12698 -0.459076,-0.29303 -0.195351,-0.16605 -0.312562,-0.40047 -0.117211,-0.23442 -0.117211,-0.57629 0,-0.67396 0.498146,-1.06466 0.498146,-0.40047 1.357692,-0.40047 0.214886,0 0.429773,0.0293 0.214886,0.0195 0.40047,0.0586 0.185584,0.0293 0.32233,0.0684 0.146514,0.0391 0.224654,0.0684 l -0.166049,0.78141 q -0.146513,-0.0781 -0.459075,-0.15628 -0.312562,-0.0879 -0.752103,-0.0879 -0.380935,0 -0.664195,0.15628 -0.283259,0.14651 -0.283259,0.46884 0,0.16605 0.05861,0.29303 0.06837,0.12698 0.195352,0.23442 0.136746,0.0977 0.332097,0.18559 0.195351,0.0879 0.468843,0.18558 0.3614,0.13675 0.64466,0.27349 0.283259,0.12698 0.478611,0.3028 0.205118,0.17581 0.312562,0.42977 0.107443,0.24419 0.107443,0.60559 0,0.70326 -0.527449,1.06466 -0.517681,0.3614 -1.48467,0.3614 -0.673962,0 -1.054897,-0.11721 -0.380935,-0.10744 -0.517681,-0.16605 l 0.166048,-0.7814 q 0.156281,0.0586 0.498146,0.17581 0.341865,0.11721 0.908384,0.11721 z" /> | ||
519 | 92 | <path | ||
520 | 93 | inkscape:connector-curvature="0" | ||
521 | 94 | id="path3499" | ||
522 | 95 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
523 | 96 | d="m 27.705085,277.21736 q 0,-0.88885 -0.43954,-1.36746 -0.439541,-0.47861 -1.172109,-0.47861 -0.410237,0 -0.644659,0.0293 -0.224654,0.0293 -0.3614,0.0684 v 3.20376 q 0.166049,0.13675 0.478611,0.26372 0.312562,0.12698 0.68373,0.12698 0.390702,0 0.664194,-0.13674 0.28326,-0.14652 0.459076,-0.39071 0.175816,-0.25395 0.253957,-0.58605 0.07814,-0.34187 0.07814,-0.73257 z m 0.947454,0 q 0,0.57629 -0.156281,1.06467 -0.146513,0.48838 -0.43954,0.84001 -0.293027,0.35163 -0.7228,0.54698 -0.420006,0.19535 -0.96699,0.19535 -0.43954,0 -0.781405,-0.11721 -0.332097,-0.11721 -0.498146,-0.22465 v 2.03165 h -0.908384 v -6.72985 q 0.32233,-0.0781 0.800941,-0.16605 0.488378,-0.0977 1.12327,-0.0977 0.586054,0 1.054897,0.18559 0.468844,0.18558 0.800941,0.52745 0.332097,0.34186 0.507913,0.84001 0.185584,0.48838 0.185584,1.10373 z" /> | ||
524 | 97 | <path | ||
525 | 98 | inkscape:connector-curvature="0" | ||
526 | 99 | id="path3501" | ||
527 | 100 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
528 | 101 | d="m 31.659424,279.09273 q 0.32233,0 0.566519,-0.01 0.253957,-0.0195 0.420006,-0.0586 v -1.51397 q -0.09768,-0.0488 -0.32233,-0.0781 -0.214887,-0.0391 -0.527449,-0.0391 -0.205119,0 -0.43954,0.0293 -0.224654,0.0293 -0.420006,0.12698 -0.185584,0.0879 -0.312562,0.25396 -0.126978,0.15628 -0.126978,0.42 0,0.48838 0.312562,0.68373 0.312562,0.18558 0.849778,0.18558 z m -0.07814,-4.55168 q 0.546984,0 0.918151,0.14651 0.380935,0.13675 0.605589,0.40047 0.234422,0.25396 0.332098,0.61536 0.09767,0.35163 0.09767,0.7814 v 3.17446 q -0.117211,0.0195 -0.332097,0.0586 -0.205119,0.0293 -0.468843,0.0586 -0.263725,0.0293 -0.576287,0.0488 -0.302794,0.0293 -0.605589,0.0293 -0.429773,0 -0.791173,-0.0879 -0.3614,-0.0879 -0.625124,-0.27349 -0.263725,-0.19536 -0.410238,-0.50792 -0.146514,-0.31256 -0.146514,-0.7521 0,-0.42001 0.166049,-0.7228 0.175816,-0.3028 0.468843,-0.48838 0.293027,-0.18558 0.68373,-0.27349 0.390703,-0.0879 0.820476,-0.0879 0.136746,0 0.283259,0.0195 0.146514,0.01 0.273492,0.0391 0.136746,0.0195 0.234422,0.0391 0.09768,0.0195 0.136746,0.0293 v -0.25396 q 0,-0.22465 -0.04884,-0.43954 -0.04884,-0.22465 -0.175816,-0.3907 -0.126979,-0.17582 -0.351633,-0.27349 -0.214886,-0.10745 -0.566519,-0.10745 -0.449308,0 -0.791173,0.0684 -0.332097,0.0586 -0.498146,0.12698 l -0.107443,-0.75211 q 0.175816,-0.0781 0.586054,-0.14651 0.410238,-0.0781 0.888849,-0.0781 z" /> | ||
529 | 102 | <path | ||
530 | 103 | inkscape:connector-curvature="0" | ||
531 | 104 | id="path3503" | ||
532 | 105 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
533 | 106 | d="m 35.883744,274.66803 h 1.924211 v 0.76187 h -1.924211 v 2.34421 q 0,0.38094 0.05861,0.6349 0.05861,0.24418 0.175816,0.3907 0.117211,0.13674 0.293027,0.19535 0.175816,0.0586 0.410238,0.0586 0.410238,0 0.654427,-0.0879 0.253957,-0.0977 0.351632,-0.13675 l 0.175817,0.7521 q -0.136746,0.0684 -0.478611,0.16605 -0.341865,0.10745 -0.781406,0.10745 -0.517681,0 -0.859546,-0.12698 -0.332097,-0.13675 -0.537216,-0.40047 -0.205119,-0.26373 -0.293027,-0.64466 -0.07814,-0.39071 -0.07814,-0.89862 v -4.53215 l 0.908383,-0.15628 z" /> | ||
534 | 107 | <path | ||
535 | 108 | inkscape:connector-curvature="0" | ||
536 | 109 | id="path3505" | ||
537 | 110 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
538 | 111 | d="m 41.037815,279.86437 q -0.615356,0 -1.0842,-0.19535 -0.459075,-0.19535 -0.781405,-0.54698 -0.312562,-0.35163 -0.468843,-0.83025 -0.156281,-0.48837 -0.156281,-1.07443 0,-0.58605 0.166048,-1.07443 0.175817,-0.48838 0.488379,-0.84001 0.312562,-0.3614 0.76187,-0.55675 0.459076,-0.20512 1.015827,-0.20512 0.341865,0 0.68373,0.0586 0.341865,0.0586 0.654427,0.18559 l -0.205119,0.77164 q -0.205119,-0.0977 -0.478611,-0.15629 -0.263724,-0.0586 -0.566519,-0.0586 -0.76187,0 -1.172108,0.47861 -0.40047,0.47861 -0.40047,1.39676 0,0.41024 0.08791,0.7521 0.09768,0.34187 0.293027,0.58606 0.205119,0.24419 0.517681,0.38093 0.312562,0.12698 0.76187,0.12698 0.3614,0 0.654427,-0.0684 0.293027,-0.0684 0.459076,-0.14651 l 0.126978,0.76187 q -0.07814,0.0488 -0.224654,0.0977 -0.146513,0.0391 -0.332097,0.0684 -0.185584,0.0391 -0.40047,0.0586 -0.205119,0.0293 -0.400471,0.0293 z" /> | ||
539 | 112 | <path | ||
540 | 113 | inkscape:connector-curvature="0" | ||
541 | 114 | id="path3507" | ||
542 | 115 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
543 | 116 | d="m 43.370739,279.74716 v -7.42335 l 0.908384,-0.15628 v 2.59817 q 0.253956,-0.0977 0.537216,-0.14651 0.293027,-0.0586 0.576286,-0.0586 0.60559,0 1.00606,0.17582 0.40047,0.16605 0.634892,0.47861 0.244189,0.3028 0.341865,0.73257 0.09768,0.42977 0.09768,0.94745 v 2.85213 h -0.908383 v -2.65678 q 0,-0.46884 -0.06837,-0.80094 -0.05861,-0.33209 -0.205119,-0.53721 -0.146514,-0.20512 -0.390703,-0.29303 -0.244189,-0.0977 -0.605589,-0.0977 -0.146514,0 -0.302795,0.0195 -0.156281,0.0195 -0.302794,0.0488 -0.136746,0.0195 -0.253957,0.0488 -0.107443,0.0293 -0.156281,0.0488 v 4.21959 z" /> | ||
544 | 117 | <path | ||
545 | 118 | inkscape:connector-curvature="0" | ||
546 | 119 | id="path3509" | ||
547 | 120 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
548 | 121 | d="m 48.658044,277.21736 q 0,-0.67396 0.195351,-1.17211 0.195351,-0.50791 0.517681,-0.84001 0.32233,-0.33209 0.742335,-0.49814 0.420006,-0.16605 0.859546,-0.16605 1.025595,0 1.572579,0.64466 0.546983,0.63489 0.546983,1.94374 0,0.0586 0,0.15628 0,0.0879 -0.0098,0.16605 h -3.477254 q 0.05861,0.79118 0.459075,1.20141 0.400471,0.41024 1.250249,0.41024 0.478611,0 0.800941,-0.0781 0.332097,-0.0879 0.498146,-0.16605 l 0.126978,0.76187 q -0.166049,0.0879 -0.586054,0.18559 -0.410238,0.0977 -0.937687,0.0977 -0.664194,0 -1.152573,-0.19535 -0.47861,-0.20512 -0.791172,-0.55675 -0.312563,-0.35163 -0.468844,-0.83024 -0.146513,-0.48838 -0.146513,-1.06467 z m 3.487021,-0.49814 q 0.0098,-0.61536 -0.312562,-1.00606 -0.312562,-0.40047 -0.869313,-0.40047 -0.312562,0 -0.556752,0.12697 -0.234421,0.11722 -0.40047,0.31257 -0.166049,0.19535 -0.263724,0.4493 -0.08791,0.25396 -0.117211,0.51769 z" /> | ||
549 | 122 | <path | ||
550 | 123 | inkscape:connector-curvature="0" | ||
551 | 124 | id="path3511" | ||
552 | 125 | style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:6.10472965px;font-family:Ubuntu;-inkscape-font-specification:Ubuntu;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.24418919px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" | ||
553 | 126 | d="m 56.27278,274.56058 q 0.117211,0 0.263725,0.0195 0.156281,0.01 0.302794,0.0391 0.146514,0.0195 0.263725,0.0488 0.126978,0.0195 0.185584,0.0391 l -0.156282,0.79117 q -0.107443,-0.0391 -0.3614,-0.0879 -0.244189,-0.0586 -0.634891,-0.0586 -0.253957,0 -0.507914,0.0586 -0.244189,0.0488 -0.32233,0.0684 v 4.26843 h -0.908384 v -4.86425 q 0.32233,-0.11721 0.800941,-0.21488 0.478611,-0.10745 1.074432,-0.10745 z" /> | ||
554 | 127 | </g> | ||
555 | 128 | </g> | ||
556 | 129 | </svg> | ||
557 | 0 | 130 | ||
558 | === added directory 'po' | |||
559 | === added file 'po/CMakeLists.txt' | |||
560 | --- po/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
561 | +++ po/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
562 | @@ -0,0 +1,39 @@ | |||
563 | 1 | include(FindGettext) | ||
564 | 2 | find_program(GETTEXT_XGETTEXT_EXECUTABLE xgettext) | ||
565 | 3 | find_program(INTLTOOL_UPDATE intltool-update) | ||
566 | 4 | |||
567 | 5 | set(GETTEXT_PACKAGE ${PROJECT_NAME}) | ||
568 | 6 | set(POT_FILE ${GETTEXT_PACKAGE}.pot) | ||
569 | 7 | file(GLOB POFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.po) | ||
570 | 8 | |||
571 | 9 | # Creates POTFILES | ||
572 | 10 | add_custom_target(POTFILES ALL | ||
573 | 11 | COMMENT "Generating POTFILES" | ||
574 | 12 | COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/genpotfiles.sh ${CMAKE_SOURCE_DIR} | ||
575 | 13 | ) | ||
576 | 14 | |||
577 | 15 | # Creates the .pot file containing the translations template | ||
578 | 16 | set(INTLTOOL_ENV | ||
579 | 17 | XGETTEXT="${GETTEXT_XGETTEXT_EXECUTABLE}" | ||
580 | 18 | XGETTEXT_ARGS="--keyword=Gettext;--keyword=NGettext:1,2;--keyword=tr;--keyword=tr:1,2;--keyword=N_" | ||
581 | 19 | srcdir="${CMAKE_CURRENT_SOURCE_DIR}" | ||
582 | 20 | ) | ||
583 | 21 | add_custom_target(${POT_FILE} | ||
584 | 22 | COMMENT "Generating translation template" | ||
585 | 23 | COMMAND ${INTLTOOL_ENV} ${INTLTOOL_UPDATE} --gettext-package ${GETTEXT_PACKAGE} --pot | ||
586 | 24 | COMMAND cp -f ${POT_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/ | ||
587 | 25 | DEPENDS POTFILES | ||
588 | 26 | ) | ||
589 | 27 | |||
590 | 28 | # Builds the binary translations catalog for each language | ||
591 | 29 | # it finds source translations (*.po) for | ||
592 | 30 | foreach(POFILE ${POFILES}) | ||
593 | 31 | string(REPLACE ".po" "" LANG ${POFILE}) | ||
594 | 32 | list(APPEND PO_FILES "${POFILE}") | ||
595 | 33 | gettext_process_po_files(${LANG} ALL PO_FILES "${POFILE}") | ||
596 | 34 | set(INSTALL_DIR ${CMAKE_INSTALL_LOCALEDIR}/${LANG}/LC_MESSAGES) | ||
597 | 35 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${LANG}.gmo | ||
598 | 36 | DESTINATION ${INSTALL_DIR} | ||
599 | 37 | RENAME ${GETTEXT_PACKAGE}.mo | ||
600 | 38 | ) | ||
601 | 39 | endforeach(POFILE) | ||
602 | 0 | 40 | ||
603 | === added file 'po/POTFILES.in' | |||
604 | --- po/POTFILES.in 1970-01-01 00:00:00 +0000 | |||
605 | +++ po/POTFILES.in 2016-11-07 16:32:23 +0000 | |||
606 | @@ -0,0 +1,1 @@ | |||
607 | 1 | data/bad-url.qml | ||
608 | 0 | 2 | ||
609 | === added file 'po/genpotfiles.sh' | |||
610 | --- po/genpotfiles.sh 1970-01-01 00:00:00 +0000 | |||
611 | +++ po/genpotfiles.sh 2016-11-07 16:32:23 +0000 | |||
612 | @@ -0,0 +1,6 @@ | |||
613 | 1 | #!/bin/sh | ||
614 | 2 | |||
615 | 3 | sed '/^#/d | ||
616 | 4 | s/^[[].*] *// | ||
617 | 5 | /^[ ]*$/d' \ | ||
618 | 6 | "`dirname ${0}`/POTFILES.in" | sed '$!s/$/ \\/' > POTFILES | ||
619 | 0 | 7 | ||
620 | === modified file 'service/CMakeLists.txt' | |||
621 | --- service/CMakeLists.txt 2015-06-11 21:38:13 +0000 | |||
622 | +++ service/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
623 | @@ -47,15 +47,20 @@ | |||
624 | 47 | overlay-tracker.cpp | 47 | overlay-tracker.cpp |
625 | 48 | overlay-tracker-iface.h | 48 | overlay-tracker-iface.h |
626 | 49 | overlay-tracker-mir.h | 49 | overlay-tracker-mir.h |
628 | 50 | overlay-tracker-mir.cpp) | 50 | overlay-tracker-mir.cpp |
629 | 51 | scope-checker-facade.h | ||
630 | 52 | scope-checker.h | ||
631 | 53 | scope-checker.cpp) | ||
632 | 51 | 54 | ||
633 | 52 | target_link_libraries(dispatcher-lib | 55 | target_link_libraries(dispatcher-lib |
634 | 53 | url-db-lib | 56 | url-db-lib |
635 | 54 | service-generated | 57 | service-generated |
636 | 55 | -pthread | 58 | -pthread |
637 | 59 | ${APPARMOR_LIBRARIES} | ||
638 | 56 | ${GLIB2_LIBRARIES} | 60 | ${GLIB2_LIBRARIES} |
639 | 57 | ${GOBJECT2_LIBRARIES} | 61 | ${GOBJECT2_LIBRARIES} |
640 | 58 | ${GIO2_LIBRARIES} | 62 | ${GIO2_LIBRARIES} |
641 | 63 | ${SCOPES_LIBRARIES} | ||
642 | 59 | ${SQLITE_LIBRARIES} | 64 | ${SQLITE_LIBRARIES} |
643 | 60 | ${UBUNTU_APP_LAUNCH_LIBRARIES} | 65 | ${UBUNTU_APP_LAUNCH_LIBRARIES} |
644 | 61 | ) | 66 | ) |
645 | @@ -106,14 +111,6 @@ | |||
646 | 106 | target_link_libraries(update-directory ${GIO2_LIBRARIES} ${JSONGLIB_LIBRARIES} url-db-lib) | 111 | target_link_libraries(update-directory ${GIO2_LIBRARIES} ${JSONGLIB_LIBRARIES} url-db-lib) |
647 | 107 | 112 | ||
648 | 108 | ########################### | 113 | ########################### |
649 | 109 | # URL Overlay Exec Tool | ||
650 | 110 | ########################### | ||
651 | 111 | |||
652 | 112 | add_executable(url-overlay-exec-tool url-overlay.c recoverable-problem.c) | ||
653 | 113 | set_target_properties(url-overlay-exec-tool PROPERTIES OUTPUT_NAME "exec-tool") | ||
654 | 114 | target_link_libraries(url-overlay-exec-tool ${GIO2_LIBRARIES} ${UBUNTU_APP_LAUNCH_LIBRARIES} ${CLICK_LIBRARIES}) | ||
655 | 115 | |||
656 | 116 | ########################### | ||
657 | 117 | # Installation | 114 | # Installation |
658 | 118 | ########################### | 115 | ########################### |
659 | 119 | 116 | ||
660 | @@ -122,8 +119,9 @@ | |||
661 | 122 | RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/url-dispatcher" | 119 | RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/url-dispatcher" |
662 | 123 | ) | 120 | ) |
663 | 124 | 121 | ||
668 | 125 | install( | 122 | ########################### |
669 | 126 | TARGETS url-overlay-exec-tool | 123 | # Exec Tools |
670 | 127 | RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/ubuntu-app-launch/url-overlay" | 124 | ########################### |
667 | 128 | ) | ||
671 | 129 | 125 | ||
672 | 126 | add_subdirectory(url-overlay) | ||
673 | 127 | add_subdirectory(bad-url) | ||
674 | 130 | 128 | ||
675 | === added directory 'service/bad-url' | |||
676 | === added file 'service/bad-url/CMakeLists.txt' | |||
677 | --- service/bad-url/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
678 | +++ service/bad-url/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
679 | @@ -0,0 +1,14 @@ | |||
680 | 1 | ########################### | ||
681 | 2 | # Bad URL Exec Tool | ||
682 | 3 | ########################### | ||
683 | 4 | |||
684 | 5 | add_definitions( -DQML_BAD_URL="${CMAKE_INSTALL_FULL_DATADIR}/url-dispatcher/bad-url.qml" ) | ||
685 | 6 | add_executable(bad-url-exec-tool exec-tool.c) | ||
686 | 7 | set_target_properties(bad-url-exec-tool PROPERTIES OUTPUT_NAME "exec-tool") | ||
687 | 8 | target_link_libraries(bad-url-exec-tool ${GIO2_LIBRARIES} ${UBUNTU_APP_LAUNCH_LIBRARIES}) | ||
688 | 9 | |||
689 | 10 | install( | ||
690 | 11 | TARGETS bad-url-exec-tool | ||
691 | 12 | RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/ubuntu-app-launch/bad-url" | ||
692 | 13 | ) | ||
693 | 14 | |||
694 | 0 | 15 | ||
695 | === added file 'service/bad-url/exec-tool.c' | |||
696 | --- service/bad-url/exec-tool.c 1970-01-01 00:00:00 +0000 | |||
697 | +++ service/bad-url/exec-tool.c 2016-11-07 16:32:23 +0000 | |||
698 | @@ -0,0 +1,42 @@ | |||
699 | 1 | /* | ||
700 | 2 | * Copyright © 2015 Canonical Ltd. | ||
701 | 3 | * | ||
702 | 4 | * This program is free software: you can redistribute it and/or modify it | ||
703 | 5 | * under the terms of the GNU General Public License version 3, as published | ||
704 | 6 | * by the Free Software Foundation. | ||
705 | 7 | * | ||
706 | 8 | * This program is distributed in the hope that it will be useful, but | ||
707 | 9 | * WITHOUT ANY WARRANTY; without even the implied warranties of | ||
708 | 10 | * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR | ||
709 | 11 | * PURPOSE. See the GNU General Public License for more details. | ||
710 | 12 | * | ||
711 | 13 | * You should have received a copy of the GNU General Public License along | ||
712 | 14 | * with this program. If not, see <http://www.gnu.org/licenses/>. | ||
713 | 15 | * | ||
714 | 16 | * Authors: | ||
715 | 17 | * Ted Gould <ted.gould@canonical.com> | ||
716 | 18 | */ | ||
717 | 19 | |||
718 | 20 | #include <gio/gio.h> | ||
719 | 21 | #include <ubuntu-app-launch.h> | ||
720 | 22 | |||
721 | 23 | int | ||
722 | 24 | main (int argc, char * argv[]) | ||
723 | 25 | { | ||
724 | 26 | GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); | ||
725 | 27 | g_return_val_if_fail(bus != NULL, -1); | ||
726 | 28 | |||
727 | 29 | gchar * exec = g_strdup_printf("qmlscene %s %s", QML_BAD_URL, g_getenv("APP_URIS")); | ||
728 | 30 | |||
729 | 31 | gboolean sended = ubuntu_app_launch_helper_set_exec(exec, NULL); | ||
730 | 32 | g_free(exec); | ||
731 | 33 | |||
732 | 34 | /* Ensuring the messages get on the bus before we quit */ | ||
733 | 35 | g_dbus_connection_flush_sync(bus, NULL, NULL); | ||
734 | 36 | g_clear_object(&bus); | ||
735 | 37 | |||
736 | 38 | if (sended) | ||
737 | 39 | return 0; | ||
738 | 40 | else | ||
739 | 41 | return -1; | ||
740 | 42 | } | ||
741 | 0 | 43 | ||
742 | === modified file 'service/dispatcher.c' | |||
743 | --- service/dispatcher.c 2015-09-03 21:50:06 +0000 | |||
744 | +++ service/dispatcher.c 2016-11-07 16:32:23 +0000 | |||
745 | @@ -23,10 +23,12 @@ | |||
746 | 23 | #include "dispatcher.h" | 23 | #include "dispatcher.h" |
747 | 24 | #include "service-iface.h" | 24 | #include "service-iface.h" |
748 | 25 | #include "recoverable-problem.h" | 25 | #include "recoverable-problem.h" |
749 | 26 | #include "scope-checker.h" | ||
750 | 26 | #include "url-db.h" | 27 | #include "url-db.h" |
751 | 27 | 28 | ||
752 | 28 | /* Globals */ | 29 | /* Globals */ |
753 | 29 | static OverlayTracker * tracker = NULL; | 30 | static OverlayTracker * tracker = NULL; |
754 | 31 | static ScopeChecker * checker = NULL; | ||
755 | 30 | static GCancellable * cancellable = NULL; | 32 | static GCancellable * cancellable = NULL; |
756 | 31 | static ServiceIfaceComCanonicalURLDispatcher * skel = NULL; | 33 | static ServiceIfaceComCanonicalURLDispatcher * skel = NULL; |
757 | 32 | static GRegex * applicationre = NULL; | 34 | static GRegex * applicationre = NULL; |
758 | @@ -73,6 +75,10 @@ | |||
759 | 73 | g_variant_get(pid_tuple, "(u)", &pid); | 75 | g_variant_get(pid_tuple, "(u)", &pid); |
760 | 74 | g_variant_unref(pid_tuple); | 76 | g_variant_unref(pid_tuple); |
761 | 75 | 77 | ||
762 | 78 | /* Popup the bad url dialog */ | ||
763 | 79 | overlay_tracker_badurl(tracker, pid, badurl); | ||
764 | 80 | |||
765 | 81 | /* Report recoverable error */ | ||
766 | 76 | const gchar * additional[3] = { | 82 | const gchar * additional[3] = { |
767 | 77 | "BadURL", | 83 | "BadURL", |
768 | 78 | badurl, | 84 | badurl, |
769 | @@ -151,6 +157,11 @@ | |||
770 | 151 | gboolean | 157 | gboolean |
771 | 152 | send_to_dash (const gchar * url) | 158 | send_to_dash (const gchar * url) |
772 | 153 | { | 159 | { |
773 | 160 | if (url == NULL) { | ||
774 | 161 | g_warning("Can not send nothing to the dash"); | ||
775 | 162 | return FALSE; | ||
776 | 163 | } | ||
777 | 164 | |||
778 | 154 | GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); | 165 | GDBusConnection * bus = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); |
779 | 155 | g_return_val_if_fail(bus != NULL, FALSE); | 166 | g_return_val_if_fail(bus != NULL, FALSE); |
780 | 156 | 167 | ||
781 | @@ -210,13 +221,109 @@ | |||
782 | 210 | return TRUE; | 221 | return TRUE; |
783 | 211 | } | 222 | } |
784 | 212 | 223 | ||
785 | 224 | /* Queries Upstart for the PID of a given upstart job */ | ||
786 | 225 | pid_t | ||
787 | 226 | pid_for_upstart_job (GDBusConnection * conn, const gchar* jobname) | ||
788 | 227 | { | ||
789 | 228 | GError* error = NULL; | ||
790 | 229 | |||
791 | 230 | if (jobname == NULL) { | ||
792 | 231 | return 0; | ||
793 | 232 | } | ||
794 | 233 | |||
795 | 234 | GVariant* retval = g_dbus_connection_call_sync( | ||
796 | 235 | conn, | ||
797 | 236 | "com.ubuntu.Upstart", | ||
798 | 237 | "/com/ubuntu/Upstart", | ||
799 | 238 | "com.ubuntu.Upstart0_6", | ||
800 | 239 | "GetJobByName", | ||
801 | 240 | g_variant_new("(s)", jobname), | ||
802 | 241 | G_VARIANT_TYPE("(o)"), | ||
803 | 242 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
804 | 243 | -1, /* timeout */ | ||
805 | 244 | NULL, /* cancel */ | ||
806 | 245 | &error); | ||
807 | 246 | |||
808 | 247 | if (error != NULL) { | ||
809 | 248 | g_warning("Unable to get path for job '%s': %s", jobname, error->message); | ||
810 | 249 | g_error_free(error); | ||
811 | 250 | return 0; | ||
812 | 251 | } | ||
813 | 252 | |||
814 | 253 | gchar* path = NULL; | ||
815 | 254 | g_variant_get(retval, "(o)", &path); | ||
816 | 255 | g_variant_unref(retval); | ||
817 | 256 | |||
818 | 257 | retval = g_dbus_connection_call_sync( | ||
819 | 258 | conn, | ||
820 | 259 | "com.ubuntu.Upstart", | ||
821 | 260 | path, | ||
822 | 261 | "com.ubuntu.Upstart0_6.Job", | ||
823 | 262 | "GetInstanceByName", | ||
824 | 263 | g_variant_new("(s)", ""), | ||
825 | 264 | G_VARIANT_TYPE("(o)"), | ||
826 | 265 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
827 | 266 | -1, /* timeout */ | ||
828 | 267 | NULL, /* cancel */ | ||
829 | 268 | &error); | ||
830 | 269 | |||
831 | 270 | g_free(path); | ||
832 | 271 | |||
833 | 272 | if (error != NULL) { | ||
834 | 273 | g_warning("Unable to get instance for job '%s': %s", jobname, error->message); | ||
835 | 274 | g_error_free(error); | ||
836 | 275 | return 0; | ||
837 | 276 | } | ||
838 | 277 | |||
839 | 278 | g_variant_get(retval, "(o)", &path); | ||
840 | 279 | g_variant_unref(retval); | ||
841 | 280 | |||
842 | 281 | retval = g_dbus_connection_call_sync( | ||
843 | 282 | conn, | ||
844 | 283 | "com.ubuntu.Upstart", | ||
845 | 284 | path, | ||
846 | 285 | "org.freedesktop.DBus.Properties", | ||
847 | 286 | "Get", | ||
848 | 287 | g_variant_new("(ss)", "com.ubuntu.Upstart0_6.Instance", "processes"), | ||
849 | 288 | G_VARIANT_TYPE("(v)"), | ||
850 | 289 | G_DBUS_CALL_FLAGS_NO_AUTO_START, | ||
851 | 290 | -1, /* timeout */ | ||
852 | 291 | NULL, /* cancel */ | ||
853 | 292 | &error); | ||
854 | 293 | |||
855 | 294 | g_free(path); | ||
856 | 295 | |||
857 | 296 | if (error != NULL) { | ||
858 | 297 | g_warning("Unable to get processes for job '%s': %s", jobname, error->message); | ||
859 | 298 | g_error_free(error); | ||
860 | 299 | return 0; | ||
861 | 300 | } | ||
862 | 301 | |||
863 | 302 | GPid pid = 0; | ||
864 | 303 | GVariant* variant = g_variant_get_child_value(retval, 0); | ||
865 | 304 | GVariant* array = g_variant_get_variant(variant); | ||
866 | 305 | if (g_variant_n_children(array) > 0) { | ||
867 | 306 | /* (si) */ | ||
868 | 307 | GVariant* firstitem = g_variant_get_child_value(array, 0); | ||
869 | 308 | GVariant* vpid = g_variant_get_child_value(firstitem, 1); | ||
870 | 309 | pid = g_variant_get_int32(vpid); | ||
871 | 310 | g_variant_unref(vpid); | ||
872 | 311 | g_variant_unref(firstitem); | ||
873 | 312 | } | ||
874 | 313 | g_variant_unref(variant); | ||
875 | 314 | g_variant_unref(array); | ||
876 | 315 | g_variant_unref(retval); | ||
877 | 316 | |||
878 | 317 | return pid; | ||
879 | 318 | } | ||
880 | 319 | |||
881 | 320 | |||
882 | 213 | /* Handles setting up the overlay with the URL */ | 321 | /* Handles setting up the overlay with the URL */ |
883 | 214 | gboolean | 322 | gboolean |
884 | 215 | dispatcher_send_to_overlay (const gchar * app_id, const gchar * url, GDBusConnection * conn, const gchar * sender) | 323 | dispatcher_send_to_overlay (const gchar * app_id, const gchar * url, GDBusConnection * conn, const gchar * sender) |
885 | 216 | { | 324 | { |
886 | 217 | GError * error = NULL; | 325 | GError * error = NULL; |
887 | 218 | 326 | ||
888 | 219 | /* TODO: Detect if a scope is what we need to overlay on */ | ||
889 | 220 | GVariant * callret = g_dbus_connection_call_sync(conn, | 327 | GVariant * callret = g_dbus_connection_call_sync(conn, |
890 | 221 | "org.freedesktop.DBus", | 328 | "org.freedesktop.DBus", |
891 | 222 | "/", | 329 | "/", |
892 | @@ -239,6 +346,12 @@ | |||
893 | 239 | g_variant_get_child(callret, 0, "u", &pid); | 346 | g_variant_get_child(callret, 0, "u", &pid); |
894 | 240 | g_variant_unref(callret); | 347 | g_variant_unref(callret); |
895 | 241 | 348 | ||
896 | 349 | /* If it is from a scope we need to overlay onto the | ||
897 | 350 | dash instead */ | ||
898 | 351 | if (scope_checker_is_scope_pid(checker, pid)) { | ||
899 | 352 | pid = pid_for_upstart_job(conn, "unity8-dash"); | ||
900 | 353 | } | ||
901 | 354 | |||
902 | 242 | return overlay_tracker_add(tracker, app_id, pid, url); | 355 | return overlay_tracker_add(tracker, app_id, pid, url); |
903 | 243 | } | 356 | } |
904 | 244 | 357 | ||
905 | @@ -437,7 +550,17 @@ | |||
906 | 437 | 550 | ||
907 | 438 | *out_appid = ubuntu_app_launch_triplet_to_app_id(package, app, version); | 551 | *out_appid = ubuntu_app_launch_triplet_to_app_id(package, app, version); |
908 | 439 | if (*out_appid != NULL) { | 552 | if (*out_appid != NULL) { |
910 | 440 | retval = TRUE; | 553 | /* Look at the current version of the app and ensure |
911 | 554 | we're not asking for an older version */ | ||
912 | 555 | gchar * testappid = ubuntu_app_launch_triplet_to_app_id(package, app, NULL); | ||
913 | 556 | if (g_strcmp0(*out_appid, testappid) != 0) { | ||
914 | 557 | retval = FALSE; | ||
915 | 558 | g_clear_pointer(out_appid, g_free); | ||
916 | 559 | } else { | ||
917 | 560 | retval = TRUE; | ||
918 | 561 | } | ||
919 | 562 | |||
920 | 563 | g_free(testappid); | ||
921 | 441 | } | 564 | } |
922 | 442 | 565 | ||
923 | 443 | g_free(package); | 566 | g_free(package); |
924 | @@ -483,6 +606,17 @@ | |||
925 | 483 | } | 606 | } |
926 | 484 | } | 607 | } |
927 | 485 | 608 | ||
928 | 609 | if (g_strcmp0(protocol, "scope") == 0) { | ||
929 | 610 | /* Add a check for the scope if we can do that, since it is | ||
930 | 611 | a system URL that we can do more checking on */ | ||
931 | 612 | if (!scope_checker_is_scope(checker, domain)) { | ||
932 | 613 | found = FALSE; | ||
933 | 614 | g_clear_pointer(out_appid, g_free); | ||
934 | 615 | if (out_url != NULL) | ||
935 | 616 | g_clear_pointer(out_url, g_free); | ||
936 | 617 | } | ||
937 | 618 | } | ||
938 | 619 | |||
939 | 486 | g_free(protocol); | 620 | g_free(protocol); |
940 | 487 | g_free(domain); | 621 | g_free(domain); |
941 | 488 | 622 | ||
942 | @@ -517,7 +651,7 @@ | |||
943 | 517 | 651 | ||
944 | 518 | if (error != NULL) { | 652 | if (error != NULL) { |
945 | 519 | if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { | 653 | if (!g_error_matches(error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { |
947 | 520 | g_error("Unable to connect to D-Bus: %s", error->message); | 654 | g_error("Unable to connect to D-Bus"); |
948 | 521 | g_main_loop_quit(mainloop); | 655 | g_main_loop_quit(mainloop); |
949 | 522 | } | 656 | } |
950 | 523 | g_error_free(error); | 657 | g_error_free(error); |
951 | @@ -547,17 +681,18 @@ | |||
952 | 547 | 681 | ||
953 | 548 | /* Initialize all the globals */ | 682 | /* Initialize all the globals */ |
954 | 549 | gboolean | 683 | gboolean |
956 | 550 | dispatcher_init (GMainLoop * mainloop, OverlayTracker * intracker) | 684 | dispatcher_init (GMainLoop * mainloop, OverlayTracker * intracker, ScopeChecker * inchecker) |
957 | 551 | { | 685 | { |
958 | 552 | tracker = intracker; | 686 | tracker = intracker; |
959 | 687 | checker = inchecker; | ||
960 | 553 | cancellable = g_cancellable_new(); | 688 | cancellable = g_cancellable_new(); |
961 | 554 | 689 | ||
962 | 555 | urldb = url_db_create_database(); | 690 | urldb = url_db_create_database(); |
963 | 556 | g_return_val_if_fail(urldb != NULL, FALSE); | 691 | g_return_val_if_fail(urldb != NULL, FALSE); |
964 | 557 | 692 | ||
965 | 558 | applicationre = g_regex_new("^application:///([a-zA-Z0-9_\\.-]*)\\.desktop$", 0, 0, NULL); | 693 | applicationre = g_regex_new("^application:///([a-zA-Z0-9_\\.-]*)\\.desktop$", 0, 0, NULL); |
968 | 559 | appidre = g_regex_new("^appid://([a-z0-9\\.-]*)/([a-zA-Z0-9-]*)/([a-zA-Z0-9\\.-]*)$", 0, 0, NULL); | 694 | appidre = g_regex_new("^appid://([a-z0-9\\.-]*)/([a-zA-Z0-9-\\.]*)/([a-zA-Z0-9\\.-]*)$", 0, 0, NULL); |
969 | 560 | genericre = g_regex_new("^([a-z][a-z0-9]*):(?://(?:.*@)?([a-zA-Z0-9\\.-]*)(?::[0-9]*)?/?)?(.*)?$", 0, 0, NULL); | 695 | genericre = g_regex_new("^([a-z][a-z0-9]*):(?://(?:.*@)?([a-zA-Z0-9\\.-_]*)(?::[0-9]*)?/?)?(.*)?$", 0, 0, NULL); |
970 | 561 | intentre = g_regex_new("^intent://.*package=([a-zA-Z0-9\\.]*);.*$", 0, 0, NULL); | 696 | intentre = g_regex_new("^intent://.*package=([a-zA-Z0-9\\.]*);.*$", 0, 0, NULL); |
971 | 562 | 697 | ||
972 | 563 | g_bus_get(G_BUS_TYPE_SESSION, cancellable, bus_got, mainloop); | 698 | g_bus_get(G_BUS_TYPE_SESSION, cancellable, bus_got, mainloop); |
973 | 564 | 699 | ||
974 | === modified file 'service/dispatcher.h' | |||
975 | --- service/dispatcher.h 2015-06-11 21:47:17 +0000 | |||
976 | +++ service/dispatcher.h 2016-11-07 16:32:23 +0000 | |||
977 | @@ -22,10 +22,11 @@ | |||
978 | 22 | 22 | ||
979 | 23 | #include <gio/gio.h> | 23 | #include <gio/gio.h> |
980 | 24 | #include "overlay-tracker.h" | 24 | #include "overlay-tracker.h" |
981 | 25 | #include "scope-checker.h" | ||
982 | 25 | 26 | ||
983 | 26 | G_BEGIN_DECLS | 27 | G_BEGIN_DECLS |
984 | 27 | 28 | ||
986 | 28 | gboolean dispatcher_init (GMainLoop * mainloop, OverlayTracker * tracker); | 29 | gboolean dispatcher_init (GMainLoop * mainloop, OverlayTracker * tracker, ScopeChecker * checker); |
987 | 29 | gboolean dispatcher_shutdown (); | 30 | gboolean dispatcher_shutdown (); |
988 | 30 | gboolean dispatcher_url_to_appid (const gchar * url, gchar ** out_appid, const gchar ** out_url); | 31 | gboolean dispatcher_url_to_appid (const gchar * url, gchar ** out_appid, const gchar ** out_url); |
989 | 31 | gboolean dispatcher_appid_restrict (const gchar * appid, const gchar * package); | 32 | gboolean dispatcher_appid_restrict (const gchar * appid, const gchar * package); |
990 | 32 | 33 | ||
991 | === modified file 'service/overlay-tracker-iface.h' | |||
992 | --- service/overlay-tracker-iface.h 2015-05-19 20:24:47 +0000 | |||
993 | +++ service/overlay-tracker-iface.h 2016-11-07 16:32:23 +0000 | |||
994 | @@ -23,4 +23,5 @@ | |||
995 | 23 | public: | 23 | public: |
996 | 24 | virtual ~OverlayTrackerIface() = default; | 24 | virtual ~OverlayTrackerIface() = default; |
997 | 25 | virtual bool addOverlay (const char * appid, unsigned long pid, const char * url) = 0; | 25 | virtual bool addOverlay (const char * appid, unsigned long pid, const char * url) = 0; |
998 | 26 | virtual bool badUrl (unsigned long pid, const char * url) = 0; | ||
999 | 26 | }; | 27 | }; |
1000 | 27 | 28 | ||
1001 | === modified file 'service/overlay-tracker-mir.cpp' | |||
1002 | --- service/overlay-tracker-mir.cpp 2015-06-11 21:47:17 +0000 | |||
1003 | +++ service/overlay-tracker-mir.cpp 2016-11-07 16:32:23 +0000 | |||
1004 | @@ -20,16 +20,20 @@ | |||
1005 | 20 | #include "overlay-tracker-mir.h" | 20 | #include "overlay-tracker-mir.h" |
1006 | 21 | #include <ubuntu-app-launch.h> | 21 | #include <ubuntu-app-launch.h> |
1007 | 22 | 22 | ||
1009 | 23 | static const char * HELPER_TYPE = "url-overlay"; | 23 | static const char * OVERLAY_HELPER_TYPE = "url-overlay"; |
1010 | 24 | static const char * BAD_URL_HELPER_TYPE = "bad-url"; | ||
1011 | 25 | static const char * BAD_URL_APP_ID = "url-dispatcher-bad-url-helper"; | ||
1012 | 24 | 26 | ||
1013 | 25 | OverlayTrackerMir::OverlayTrackerMir () | 27 | OverlayTrackerMir::OverlayTrackerMir () |
1014 | 26 | : thread([this] { | 28 | : thread([this] { |
1015 | 27 | /* Setup Helper Observer */ | 29 | /* Setup Helper Observer */ |
1017 | 28 | ubuntu_app_launch_observer_add_helper_stop(untrustedHelperStoppedStatic, HELPER_TYPE, this); | 30 | ubuntu_app_launch_observer_add_helper_stop(overlayHelperStoppedStatic, OVERLAY_HELPER_TYPE, this); |
1018 | 31 | ubuntu_app_launch_observer_add_helper_stop(overlayHelperStoppedStatic, BAD_URL_HELPER_TYPE, this); | ||
1019 | 29 | }, | 32 | }, |
1020 | 30 | [this] { | 33 | [this] { |
1021 | 31 | /* Remove Helper Observer */ | 34 | /* Remove Helper Observer */ |
1023 | 32 | ubuntu_app_launch_observer_delete_helper_stop(untrustedHelperStoppedStatic, HELPER_TYPE, this); | 35 | ubuntu_app_launch_observer_delete_helper_stop(overlayHelperStoppedStatic, OVERLAY_HELPER_TYPE, this); |
1024 | 36 | ubuntu_app_launch_observer_delete_helper_stop(overlayHelperStoppedStatic, BAD_URL_HELPER_TYPE, this); | ||
1025 | 33 | }) | 37 | }) |
1026 | 34 | { | 38 | { |
1027 | 35 | mir = std::shared_ptr<MirConnection>([] { | 39 | mir = std::shared_ptr<MirConnection>([] { |
1028 | @@ -52,8 +56,10 @@ | |||
1029 | 52 | OverlayTrackerMir::~OverlayTrackerMir () | 56 | OverlayTrackerMir::~OverlayTrackerMir () |
1030 | 53 | { | 57 | { |
1031 | 54 | thread.executeOnThread<bool>([this] { | 58 | thread.executeOnThread<bool>([this] { |
1034 | 55 | while (!ongoingSessions.empty()) { | 59 | for (auto& sessionType : ongoingSessions) { |
1035 | 56 | removeSession(std::get<2>(*ongoingSessions.begin()).get()); | 60 | while (!sessionType.second.empty()) { |
1036 | 61 | removeSession(sessionType.first, sessionType.second.begin()->session.get()); | ||
1037 | 62 | } | ||
1038 | 57 | } | 63 | } |
1039 | 58 | 64 | ||
1040 | 59 | return true; | 65 | return true; |
1041 | @@ -65,53 +71,76 @@ | |||
1042 | 65 | bool | 71 | bool |
1043 | 66 | OverlayTrackerMir::addOverlay (const char * appid, unsigned long pid, const char * url) | 72 | OverlayTrackerMir::addOverlay (const char * appid, unsigned long pid, const char * url) |
1044 | 67 | { | 73 | { |
1046 | 68 | std::string sappid(appid); | 74 | return addOverlayCore(OVERLAY_HELPER_TYPE, appid, pid, url, overlaySessionStateChangedStatic); |
1047 | 75 | } | ||
1048 | 76 | |||
1049 | 77 | bool | ||
1050 | 78 | OverlayTrackerMir::addOverlayCore (const char * helper_id, const char * appid, unsigned long pid, const char * url, void (*stateChangedFunction) (MirPromptSession*, MirPromptSessionState, void *)) | ||
1051 | 79 | { | ||
1052 | 80 | OverlayData data; | ||
1053 | 81 | data.appid = appid; | ||
1054 | 69 | std::string surl(url); | 82 | std::string surl(url); |
1055 | 70 | 83 | ||
1058 | 71 | return thread.executeOnThread<bool>([this, sappid, pid, surl] { | 84 | return thread.executeOnThread<bool>([this, helper_id, &data, pid, surl, stateChangedFunction] { |
1059 | 72 | g_debug("Setting up over lay for PID %d with '%s'", pid, sappid.c_str()); | 85 | g_debug("Setting up over lay for PID %d with '%s'", int(pid), data.appid.c_str()); |
1060 | 73 | 86 | ||
1063 | 74 | auto session = std::shared_ptr<MirPromptSession>( | 87 | data.session = std::shared_ptr<MirPromptSession>( |
1064 | 75 | mir_connection_create_prompt_session_sync(mir.get(), pid, sessionStateChangedStatic, this), | 88 | mir_connection_create_prompt_session_sync(mir.get(), pid, stateChangedFunction, this), |
1065 | 76 | [] (MirPromptSession * session) { if (session) mir_prompt_session_release_sync(session); }); | 89 | [] (MirPromptSession * session) { if (session) mir_prompt_session_release_sync(session); }); |
1068 | 77 | if (!session) { | 90 | if (!data.session) { |
1069 | 78 | g_critical("Unable to create trusted prompt session for %d with appid '%s'", pid, sappid.c_str()); | 91 | g_critical("Unable to create trusted prompt session for %d with appid '%s'", (int)pid, data.appid.c_str()); |
1070 | 79 | return false; | 92 | return false; |
1071 | 80 | } | 93 | } |
1073 | 81 | 94 | ||
1074 | 82 | std::array<const char *, 2> urls { surl.c_str(), nullptr }; | 95 | std::array<const char *, 2> urls { surl.c_str(), nullptr }; |
1076 | 83 | auto instance = ubuntu_app_launch_start_session_helper(HELPER_TYPE, session.get(), sappid.c_str(), urls.data()); | 96 | auto instance = ubuntu_app_launch_start_session_helper(helper_id, data.session.get(), data.appid.c_str(), urls.data()); |
1077 | 84 | if (instance == nullptr) { | 97 | if (instance == nullptr) { |
1079 | 85 | g_critical("Unable to start helper for %d with appid '%s'", pid, sappid.c_str()); | 98 | g_critical("Unable to start helper for %d with appid '%s'", int(pid), data.appid.c_str()); |
1080 | 86 | return false; | 99 | return false; |
1081 | 87 | } | 100 | } |
1082 | 101 | data.instanceid = instance; | ||
1083 | 88 | 102 | ||
1085 | 89 | ongoingSessions.emplace(std::make_tuple(sappid, std::string(instance), session)); | 103 | ongoingSessions[helper_id].push_back(data); |
1086 | 90 | g_free(instance); | 104 | g_free(instance); |
1087 | 91 | return true; | 105 | return true; |
1088 | 92 | }); | 106 | }); |
1089 | 93 | } | 107 | } |
1090 | 94 | 108 | ||
1104 | 95 | void | 109 | bool |
1105 | 96 | OverlayTrackerMir::sessionStateChangedStatic (MirPromptSession * session, MirPromptSessionState state, void * user_data) | 110 | OverlayTrackerMir::badUrl (unsigned long pid, const char * url) |
1106 | 97 | { | 111 | { |
1107 | 98 | reinterpret_cast<OverlayTrackerMir *>(user_data)->sessionStateChanged(session, state); | 112 | return addOverlayCore(BAD_URL_HELPER_TYPE, BAD_URL_APP_ID, pid, url, badUrlSessionStateChangedStatic); |
1108 | 99 | } | 113 | } |
1109 | 100 | 114 | ||
1110 | 101 | void | 115 | void |
1111 | 102 | OverlayTrackerMir::removeSession (MirPromptSession * session) | 116 | OverlayTrackerMir::overlaySessionStateChangedStatic (MirPromptSession * session, MirPromptSessionState state, void * user_data) |
1112 | 103 | { | 117 | { |
1113 | 104 | for (auto it = ongoingSessions.begin(); it != ongoingSessions.end(); it++) { | 118 | reinterpret_cast<OverlayTrackerMir *>(user_data)->sessionStateChanged(session, state, OVERLAY_HELPER_TYPE); |
1114 | 105 | if (std::get<2>(*it).get() == session) { | 119 | } |
1115 | 106 | ubuntu_app_launch_stop_multiple_helper(HELPER_TYPE, std::get<0>(*it).c_str(), std::get<1>(*it).c_str()); | 120 | |
1116 | 107 | ongoingSessions.erase(it); | 121 | void |
1117 | 122 | OverlayTrackerMir::badUrlSessionStateChangedStatic (MirPromptSession * session, MirPromptSessionState state, void * user_data) | ||
1118 | 123 | { | ||
1119 | 124 | reinterpret_cast<OverlayTrackerMir *>(user_data)->sessionStateChanged(session, state, BAD_URL_HELPER_TYPE); | ||
1120 | 125 | } | ||
1121 | 126 | |||
1122 | 127 | void | ||
1123 | 128 | OverlayTrackerMir::removeSession (const std::string &type, MirPromptSession * session) | ||
1124 | 129 | { | ||
1125 | 130 | g_debug("Removing session: %p", (void*)session); | ||
1126 | 131 | auto& sessions = ongoingSessions[type]; | ||
1127 | 132 | |||
1128 | 133 | for (auto it = sessions.begin(); it != sessions.end(); it++) { | ||
1129 | 134 | if (it->session.get() == session) { | ||
1130 | 135 | ubuntu_app_launch_stop_multiple_helper(type.c_str(), it->appid.c_str(), it->instanceid.c_str()); | ||
1131 | 136 | sessions.erase(it); | ||
1132 | 108 | break; | 137 | break; |
1133 | 109 | } | 138 | } |
1134 | 110 | } | 139 | } |
1135 | 111 | } | 140 | } |
1136 | 112 | 141 | ||
1137 | 113 | void | 142 | void |
1139 | 114 | OverlayTrackerMir::sessionStateChanged (MirPromptSession * session, MirPromptSessionState state) | 143 | OverlayTrackerMir::sessionStateChanged (MirPromptSession * session, MirPromptSessionState state, const std::string &type) |
1140 | 115 | { | 144 | { |
1141 | 116 | if (state != mir_prompt_session_state_stopped) { | 145 | if (state != mir_prompt_session_state_stopped) { |
1142 | 117 | /* We only care about the stopped state */ | 146 | /* We only care about the stopped state */ |
1143 | @@ -120,23 +149,24 @@ | |||
1144 | 120 | 149 | ||
1145 | 121 | /* Executing on the Mir thread, which is nice and all, but we | 150 | /* Executing on the Mir thread, which is nice and all, but we |
1146 | 122 | want to get back on our thread */ | 151 | want to get back on our thread */ |
1149 | 123 | thread.executeOnThread([this, session]() { | 152 | thread.executeOnThread([this, type, session]() { |
1150 | 124 | removeSession(session); | 153 | removeSession(type, session); |
1151 | 125 | }); | 154 | }); |
1152 | 126 | } | 155 | } |
1153 | 127 | 156 | ||
1154 | 128 | void | 157 | void |
1156 | 129 | OverlayTrackerMir::untrustedHelperStoppedStatic (const gchar * appid, const gchar * instanceid, const gchar * helpertype, gpointer user_data) | 158 | OverlayTrackerMir::overlayHelperStoppedStatic (const gchar * appid, const gchar * instanceid, const gchar * helpertype, gpointer user_data) |
1157 | 130 | { | 159 | { |
1159 | 131 | reinterpret_cast<OverlayTrackerMir *>(user_data)->untrustedHelperStopped(appid, instanceid, helpertype); | 160 | reinterpret_cast<OverlayTrackerMir *>(user_data)->overlayHelperStopped(appid, instanceid, helpertype); |
1160 | 132 | } | 161 | } |
1161 | 133 | 162 | ||
1162 | 134 | void | 163 | void |
1164 | 135 | OverlayTrackerMir::untrustedHelperStopped(const gchar * appid, const gchar * instanceid, const gchar * helpertype) | 164 | OverlayTrackerMir::overlayHelperStopped(const gchar * appid, const gchar * instanceid, const gchar * helpertype) |
1165 | 136 | { | 165 | { |
1166 | 137 | /* This callback will happen on our thread already, we don't need | 166 | /* This callback will happen on our thread already, we don't need |
1167 | 138 | to proxy it on */ | 167 | to proxy it on */ |
1169 | 139 | if (g_strcmp0(helpertype, HELPER_TYPE) != 0) { | 168 | if (g_strcmp0(helpertype, OVERLAY_HELPER_TYPE) != 0 |
1170 | 169 | && g_strcmp0(helpertype, BAD_URL_HELPER_TYPE) != 0) { | ||
1171 | 140 | return; | 170 | return; |
1172 | 141 | } | 171 | } |
1173 | 142 | 172 | ||
1174 | @@ -144,10 +174,11 @@ | |||
1175 | 144 | std::string sappid(appid); | 174 | std::string sappid(appid); |
1176 | 145 | std::string sinstanceid(instanceid); | 175 | std::string sinstanceid(instanceid); |
1177 | 146 | 176 | ||
1181 | 147 | for (auto it = ongoingSessions.begin(); it != ongoingSessions.end(); it++) { | 177 | for (auto it = ongoingSessions[helpertype].begin(); it != ongoingSessions[helpertype].end(); it++) { |
1182 | 148 | if (std::get<0>(*it) == sappid && std::get<1>(*it) == sinstanceid) { | 178 | if (it->appid == sappid && it->instanceid == sinstanceid) { |
1183 | 149 | ongoingSessions.erase(it); | 179 | ongoingSessions[helpertype].erase(it); |
1184 | 150 | break; | 180 | break; |
1185 | 151 | } | 181 | } |
1186 | 152 | } | 182 | } |
1187 | 153 | } | 183 | } |
1188 | 184 | |||
1189 | 154 | 185 | ||
1190 | === modified file 'service/overlay-tracker-mir.h' | |||
1191 | --- service/overlay-tracker-mir.h 2015-06-11 21:50:05 +0000 | |||
1192 | +++ service/overlay-tracker-mir.h 2016-11-07 16:32:23 +0000 | |||
1193 | @@ -19,7 +19,9 @@ | |||
1194 | 19 | 19 | ||
1195 | 20 | #pragma once | 20 | #pragma once |
1196 | 21 | 21 | ||
1197 | 22 | #include <map> | ||
1198 | 22 | #include <set> | 23 | #include <set> |
1199 | 24 | #include <vector> | ||
1200 | 23 | 25 | ||
1201 | 24 | #include <mir_toolkit/mir_connection.h> | 26 | #include <mir_toolkit/mir_connection.h> |
1202 | 25 | #include <mir_toolkit/mir_prompt_session.h> | 27 | #include <mir_toolkit/mir_prompt_session.h> |
1203 | @@ -29,21 +31,33 @@ | |||
1204 | 29 | 31 | ||
1205 | 30 | class OverlayTrackerMir : public OverlayTrackerIface { | 32 | class OverlayTrackerMir : public OverlayTrackerIface { |
1206 | 31 | private: | 33 | private: |
1207 | 34 | struct OverlayData { | ||
1208 | 35 | std::string appid; | ||
1209 | 36 | std::string instanceid; | ||
1210 | 37 | std::shared_ptr<MirPromptSession> session; | ||
1211 | 38 | }; | ||
1212 | 39 | |||
1213 | 32 | GLib::ContextThread thread; | 40 | GLib::ContextThread thread; |
1214 | 33 | std::shared_ptr<MirConnection> mir; | 41 | std::shared_ptr<MirConnection> mir; |
1216 | 34 | std::set<std::tuple<std::string, std::string, std::shared_ptr<MirPromptSession>>> ongoingSessions; | 42 | std::map<std::string, std::vector<OverlayData>> ongoingSessions; |
1217 | 35 | 43 | ||
1218 | 36 | public: | 44 | public: |
1219 | 37 | OverlayTrackerMir (); | 45 | OverlayTrackerMir (); |
1220 | 38 | ~OverlayTrackerMir (); | 46 | ~OverlayTrackerMir (); |
1221 | 39 | bool addOverlay (const char * appid, unsigned long pid, const char * url) override; | 47 | bool addOverlay (const char * appid, unsigned long pid, const char * url) override; |
1222 | 48 | bool badUrl (unsigned long pid, const char * url) override; | ||
1223 | 40 | 49 | ||
1224 | 41 | private: | 50 | private: |
1232 | 42 | void removeSession (MirPromptSession * session); | 51 | /* Overlay Functions */ |
1233 | 43 | 52 | void removeSession (const std::string &type, MirPromptSession * session); | |
1234 | 44 | static void sessionStateChangedStatic (MirPromptSession * session, MirPromptSessionState state, void * user_data); | 53 | |
1235 | 45 | void sessionStateChanged (MirPromptSession * session, MirPromptSessionState state); | 54 | static void badUrlSessionStateChangedStatic (MirPromptSession * session, MirPromptSessionState state, void * user_data); |
1236 | 46 | 55 | static void overlaySessionStateChangedStatic (MirPromptSession * session, MirPromptSessionState state, void * user_data); | |
1237 | 47 | static void untrustedHelperStoppedStatic (const gchar * appid, const gchar * instanceid, const gchar * helpertype, gpointer user_data); | 56 | void sessionStateChanged (MirPromptSession * session, MirPromptSessionState state, const std::string &type); |
1238 | 48 | void untrustedHelperStopped(const gchar * appid, const gchar * instanceid, const gchar * helpertype); | 57 | |
1239 | 58 | static void overlayHelperStoppedStatic (const gchar * appid, const gchar * instanceid, const gchar * helpertype, gpointer user_data); | ||
1240 | 59 | void overlayHelperStopped(const gchar * appid, const gchar * instanceid, const gchar * helpertype); | ||
1241 | 60 | |||
1242 | 61 | bool addOverlayCore (const gchar * helperid, const gchar * appid, unsigned long pid, const gchar * url, void (*stateChangedFunction) (MirPromptSession*, MirPromptSessionState, void *)); | ||
1243 | 62 | |||
1244 | 49 | }; | 63 | }; |
1245 | 50 | 64 | ||
1246 | === modified file 'service/overlay-tracker.cpp' | |||
1247 | --- service/overlay-tracker.cpp 2015-06-11 21:47:17 +0000 | |||
1248 | +++ service/overlay-tracker.cpp 2016-11-07 16:32:23 +0000 | |||
1249 | @@ -52,3 +52,12 @@ | |||
1250 | 52 | 52 | ||
1251 | 53 | return reinterpret_cast<OverlayTrackerIface *>(tracker)->addOverlay(appid, pid, url) ? TRUE : FALSE; | 53 | return reinterpret_cast<OverlayTrackerIface *>(tracker)->addOverlay(appid, pid, url) ? TRUE : FALSE; |
1252 | 54 | } | 54 | } |
1253 | 55 | |||
1254 | 56 | gboolean | ||
1255 | 57 | overlay_tracker_badurl (OverlayTracker * tracker, unsigned long pid, const gchar * url) { | ||
1256 | 58 | g_return_val_if_fail(tracker != nullptr, FALSE); | ||
1257 | 59 | g_return_val_if_fail(pid != 0, FALSE); | ||
1258 | 60 | g_return_val_if_fail(url != nullptr, FALSE); | ||
1259 | 61 | |||
1260 | 62 | return reinterpret_cast<OverlayTrackerIface *>(tracker)->badUrl(pid, url) ? TRUE : FALSE; | ||
1261 | 63 | } | ||
1262 | 55 | 64 | ||
1263 | === modified file 'service/overlay-tracker.h' | |||
1264 | --- service/overlay-tracker.h 2015-06-11 21:47:17 +0000 | |||
1265 | +++ service/overlay-tracker.h 2016-11-07 16:32:23 +0000 | |||
1266 | @@ -25,4 +25,5 @@ | |||
1267 | 25 | OverlayTracker * overlay_tracker_new (); | 25 | OverlayTracker * overlay_tracker_new (); |
1268 | 26 | void overlay_tracker_delete (OverlayTracker * tracker); | 26 | void overlay_tracker_delete (OverlayTracker * tracker); |
1269 | 27 | gboolean overlay_tracker_add (OverlayTracker * tracker, const char * appid, unsigned long pid, const char * url); | 27 | gboolean overlay_tracker_add (OverlayTracker * tracker, const char * appid, unsigned long pid, const char * url); |
1270 | 28 | gboolean overlay_tracker_badurl (OverlayTracker * tracker, unsigned long pid, const char * url); | ||
1271 | 28 | 29 | ||
1272 | 29 | 30 | ||
1273 | === added file 'service/scope-checker-facade.h' | |||
1274 | --- service/scope-checker-facade.h 1970-01-01 00:00:00 +0000 | |||
1275 | +++ service/scope-checker-facade.h 2016-11-07 16:32:23 +0000 | |||
1276 | @@ -0,0 +1,27 @@ | |||
1277 | 1 | /** | ||
1278 | 2 | * Copyright © 2016 Canonical, Ltd. | ||
1279 | 3 | * | ||
1280 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1281 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
1282 | 6 | * the Free Software Foundation. | ||
1283 | 7 | * | ||
1284 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
1285 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
1286 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1287 | 11 | * Lesser General Public License for more details. | ||
1288 | 12 | * | ||
1289 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1290 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1291 | 15 | * | ||
1292 | 16 | */ | ||
1293 | 17 | |||
1294 | 18 | #pragma once | ||
1295 | 19 | |||
1296 | 20 | #include <unity-scopes.h> | ||
1297 | 21 | |||
1298 | 22 | class RuntimeFacade { | ||
1299 | 23 | public: | ||
1300 | 24 | RuntimeFacade () = default; | ||
1301 | 25 | virtual ~RuntimeFacade () = default; | ||
1302 | 26 | virtual unity::scopes::RegistryProxy registry () = 0; | ||
1303 | 27 | }; | ||
1304 | 0 | 28 | ||
1305 | === added file 'service/scope-checker.cpp' | |||
1306 | --- service/scope-checker.cpp 1970-01-01 00:00:00 +0000 | |||
1307 | +++ service/scope-checker.cpp 2016-11-07 16:32:23 +0000 | |||
1308 | @@ -0,0 +1,114 @@ | |||
1309 | 1 | /** | ||
1310 | 2 | * Copyright © 2016 Canonical, Ltd. | ||
1311 | 3 | * | ||
1312 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1313 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
1314 | 6 | * the Free Software Foundation. | ||
1315 | 7 | * | ||
1316 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
1317 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
1318 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1319 | 11 | * Lesser General Public License for more details. | ||
1320 | 12 | * | ||
1321 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1322 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1323 | 15 | * | ||
1324 | 16 | */ | ||
1325 | 17 | |||
1326 | 18 | extern "C" { | ||
1327 | 19 | #include "scope-checker.h" | ||
1328 | 20 | #include <sys/apparmor.h> | ||
1329 | 21 | #include <ubuntu-app-launch.h> | ||
1330 | 22 | } | ||
1331 | 23 | |||
1332 | 24 | #include <unity-scopes.h> | ||
1333 | 25 | #include "scope-checker-facade.h" | ||
1334 | 26 | |||
1335 | 27 | class RuntimeReal : public RuntimeFacade { | ||
1336 | 28 | public: | ||
1337 | 29 | unity::scopes::Runtime::UPtr runtime; | ||
1338 | 30 | RuntimeReal () { | ||
1339 | 31 | runtime = unity::scopes::Runtime::create(); | ||
1340 | 32 | } | ||
1341 | 33 | |||
1342 | 34 | unity::scopes::RegistryProxy registry () override { | ||
1343 | 35 | return runtime->registry(); | ||
1344 | 36 | } | ||
1345 | 37 | }; | ||
1346 | 38 | |||
1347 | 39 | ScopeChecker * | ||
1348 | 40 | scope_checker_new () | ||
1349 | 41 | { | ||
1350 | 42 | auto fu_runtime = new RuntimeReal(); | ||
1351 | 43 | return reinterpret_cast<ScopeChecker *>(fu_runtime); | ||
1352 | 44 | } | ||
1353 | 45 | |||
1354 | 46 | void | ||
1355 | 47 | scope_checker_delete (ScopeChecker * checker) | ||
1356 | 48 | { | ||
1357 | 49 | auto runtime = reinterpret_cast<RuntimeFacade *>(checker); | ||
1358 | 50 | delete runtime; | ||
1359 | 51 | } | ||
1360 | 52 | |||
1361 | 53 | bool | ||
1362 | 54 | scope_checker_is_scope (ScopeChecker * checker, const char * appid) | ||
1363 | 55 | { | ||
1364 | 56 | if (checker == nullptr) { | ||
1365 | 57 | g_warning("%s:%d: Checker is '(null)'", __FILE__, __LINE__); | ||
1366 | 58 | return false; | ||
1367 | 59 | } | ||
1368 | 60 | if (appid == nullptr) { | ||
1369 | 61 | g_warning("%s:%d: appid is '(null)'", __FILE__, __LINE__); | ||
1370 | 62 | return false; | ||
1371 | 63 | } | ||
1372 | 64 | |||
1373 | 65 | auto runtime = reinterpret_cast<RuntimeFacade *>(checker); | ||
1374 | 66 | |||
1375 | 67 | try { | ||
1376 | 68 | auto registry = runtime->registry(); | ||
1377 | 69 | registry->get_metadata(appid); | ||
1378 | 70 | return true; | ||
1379 | 71 | } catch (unity::scopes::NotFoundException e) { | ||
1380 | 72 | return false; | ||
1381 | 73 | } catch (...) { | ||
1382 | 74 | g_warning("Unable to read the Unity Scopes Registry"); | ||
1383 | 75 | return false; | ||
1384 | 76 | } | ||
1385 | 77 | } | ||
1386 | 78 | |||
1387 | 79 | bool | ||
1388 | 80 | scope_checker_is_scope_pid (ScopeChecker * checker, pid_t pid) | ||
1389 | 81 | { | ||
1390 | 82 | if (pid == 0) | ||
1391 | 83 | return false; | ||
1392 | 84 | |||
1393 | 85 | char * aa = nullptr; | ||
1394 | 86 | if (aa_gettaskcon(pid, &aa, nullptr) != 0) { | ||
1395 | 87 | return false; | ||
1396 | 88 | } | ||
1397 | 89 | |||
1398 | 90 | if (aa == nullptr) | ||
1399 | 91 | return false; | ||
1400 | 92 | |||
1401 | 93 | std::string appid(aa); | ||
1402 | 94 | free(aa); | ||
1403 | 95 | |||
1404 | 96 | if (appid == "unconfined") { | ||
1405 | 97 | /* We're not going to support unconfined scopes, too hard */ | ||
1406 | 98 | return false; | ||
1407 | 99 | } | ||
1408 | 100 | |||
1409 | 101 | gchar * pkg = nullptr; | ||
1410 | 102 | gchar * app = nullptr; | ||
1411 | 103 | if (ubuntu_app_launch_app_id_parse(appid.c_str(), &pkg, &app, nullptr)) { | ||
1412 | 104 | appid= pkg; | ||
1413 | 105 | appid += "_"; | ||
1414 | 106 | appid += app; | ||
1415 | 107 | |||
1416 | 108 | g_free(pkg); | ||
1417 | 109 | g_free(app); | ||
1418 | 110 | } | ||
1419 | 111 | |||
1420 | 112 | g_debug("PID %d is short App ID %s", pid, appid.c_str()); | ||
1421 | 113 | return scope_checker_is_scope(checker, appid.c_str()); | ||
1422 | 114 | } | ||
1423 | 0 | 115 | ||
1424 | === added file 'service/scope-checker.h' | |||
1425 | --- service/scope-checker.h 1970-01-01 00:00:00 +0000 | |||
1426 | +++ service/scope-checker.h 2016-11-07 16:32:23 +0000 | |||
1427 | @@ -0,0 +1,29 @@ | |||
1428 | 1 | /** | ||
1429 | 2 | * Copyright © 2016 Canonical, Ltd. | ||
1430 | 3 | * | ||
1431 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1432 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
1433 | 6 | * the Free Software Foundation. | ||
1434 | 7 | * | ||
1435 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
1436 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
1437 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1438 | 11 | * Lesser General Public License for more details. | ||
1439 | 12 | * | ||
1440 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1441 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1442 | 15 | * | ||
1443 | 16 | */ | ||
1444 | 17 | |||
1445 | 18 | #pragma once | ||
1446 | 19 | |||
1447 | 20 | #include <sys/types.h> | ||
1448 | 21 | #include <stdbool.h> | ||
1449 | 22 | |||
1450 | 23 | typedef struct _ScopeChecker ScopeChecker; | ||
1451 | 24 | |||
1452 | 25 | ScopeChecker * scope_checker_new (); | ||
1453 | 26 | void scope_checker_delete (ScopeChecker * checker); | ||
1454 | 27 | bool scope_checker_is_scope (ScopeChecker * checker, const char * appid); | ||
1455 | 28 | bool scope_checker_is_scope_pid (ScopeChecker * checker, pid_t pid); | ||
1456 | 29 | |||
1457 | 0 | 30 | ||
1458 | === modified file 'service/service.c' | |||
1459 | --- service/service.c 2015-09-03 21:50:06 +0000 | |||
1460 | +++ service/service.c 2016-11-07 16:32:23 +0000 | |||
1461 | @@ -40,7 +40,14 @@ | |||
1462 | 40 | guint term_source = g_unix_signal_add(SIGTERM, sig_term, mainloop); | 40 | guint term_source = g_unix_signal_add(SIGTERM, sig_term, mainloop); |
1463 | 41 | 41 | ||
1464 | 42 | OverlayTracker * tracker = overlay_tracker_new(); | 42 | OverlayTracker * tracker = overlay_tracker_new(); |
1466 | 43 | if (!dispatcher_init(mainloop, tracker)) { | 43 | |
1467 | 44 | ScopeChecker * checker = NULL; | ||
1468 | 45 | /* Allow disabing for testing */ | ||
1469 | 46 | if (g_getenv("URL_DISPATCHER_DISABLE_SCOPE_CHECKING") == NULL) | ||
1470 | 47 | checker = scope_checker_new(); | ||
1471 | 48 | |||
1472 | 49 | /* Initialize Dispatcher */ | ||
1473 | 50 | if (!dispatcher_init(mainloop, tracker, checker)) { | ||
1474 | 44 | return -1; | 51 | return -1; |
1475 | 45 | } | 52 | } |
1476 | 46 | 53 | ||
1477 | @@ -50,6 +57,7 @@ | |||
1478 | 50 | /* Clean up globals */ | 57 | /* Clean up globals */ |
1479 | 51 | dispatcher_shutdown(); | 58 | dispatcher_shutdown(); |
1480 | 52 | overlay_tracker_delete(tracker); | 59 | overlay_tracker_delete(tracker); |
1481 | 60 | scope_checker_delete(checker); | ||
1482 | 53 | g_source_remove(term_source); | 61 | g_source_remove(term_source); |
1483 | 54 | g_main_loop_unref(mainloop); | 62 | g_main_loop_unref(mainloop); |
1484 | 55 | 63 | ||
1485 | 56 | 64 | ||
1486 | === added directory 'service/url-overlay' | |||
1487 | === added file 'service/url-overlay/CMakeLists.txt' | |||
1488 | --- service/url-overlay/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
1489 | +++ service/url-overlay/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
1490 | @@ -0,0 +1,14 @@ | |||
1491 | 1 | |||
1492 | 2 | ########################### | ||
1493 | 3 | # URL Overlay Exec Tool | ||
1494 | 4 | ########################### | ||
1495 | 5 | |||
1496 | 6 | add_executable(url-overlay-exec-tool exec-tool.c ../recoverable-problem.c) | ||
1497 | 7 | set_target_properties(url-overlay-exec-tool PROPERTIES OUTPUT_NAME "exec-tool") | ||
1498 | 8 | target_link_libraries(url-overlay-exec-tool ${GIO2_LIBRARIES} ${UBUNTU_APP_LAUNCH_LIBRARIES} ${CLICK_LIBRARIES}) | ||
1499 | 9 | |||
1500 | 10 | install( | ||
1501 | 11 | TARGETS url-overlay-exec-tool | ||
1502 | 12 | RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/ubuntu-app-launch/url-overlay" | ||
1503 | 13 | ) | ||
1504 | 14 | |||
1505 | 0 | 15 | ||
1506 | === renamed file 'service/url-overlay.c' => 'service/url-overlay/exec-tool.c' | |||
1507 | === modified file 'tests/CMakeLists.txt' | |||
1508 | --- tests/CMakeLists.txt 2015-06-11 21:38:13 +0000 | |||
1509 | +++ tests/CMakeLists.txt 2016-11-07 16:32:23 +0000 | |||
1510 | @@ -25,6 +25,8 @@ | |||
1511 | 25 | ########################### | 25 | ########################### |
1512 | 26 | 26 | ||
1513 | 27 | add_library(mock-lib STATIC | 27 | add_library(mock-lib STATIC |
1514 | 28 | apparmor-mock.h | ||
1515 | 29 | apparmor-mock.c | ||
1516 | 28 | recoverable-problem-mock.c | 30 | recoverable-problem-mock.c |
1517 | 29 | ubuntu-app-launch-mock.h | 31 | ubuntu-app-launch-mock.h |
1518 | 30 | ubuntu-app-launch-mock.c) | 32 | ubuntu-app-launch-mock.c) |
1519 | @@ -62,6 +64,7 @@ | |||
1520 | 62 | mock-lib | 64 | mock-lib |
1521 | 63 | gtest | 65 | gtest |
1522 | 64 | ${UBUNTU_APP_LAUNCH_LIBRARIES} | 66 | ${UBUNTU_APP_LAUNCH_LIBRARIES} |
1523 | 67 | ${DBUSTEST_LIBRARIES} | ||
1524 | 65 | ${GTEST_LIBS}) | 68 | ${GTEST_LIBS}) |
1525 | 66 | 69 | ||
1526 | 67 | add_test (dispatcher-test dispatcher-test) | 70 | add_test (dispatcher-test dispatcher-test) |
1527 | 68 | 71 | ||
1528 | === modified file 'tests/app-id-test.cc' | |||
1529 | --- tests/app-id-test.cc 2015-05-15 21:24:15 +0000 | |||
1530 | +++ tests/app-id-test.cc 2016-11-07 16:32:23 +0000 | |||
1531 | @@ -23,6 +23,8 @@ | |||
1532 | 23 | #include "ubuntu-app-launch-mock.h" | 23 | #include "ubuntu-app-launch-mock.h" |
1533 | 24 | #include "overlay-tracker-mock.h" | 24 | #include "overlay-tracker-mock.h" |
1534 | 25 | 25 | ||
1535 | 26 | #include "ubuntu-app-launch/registry.h" | ||
1536 | 27 | |||
1537 | 26 | class AppIdTest : public ::testing::Test | 28 | class AppIdTest : public ::testing::Test |
1538 | 27 | { | 29 | { |
1539 | 28 | private: | 30 | private: |
1540 | @@ -33,9 +35,20 @@ | |||
1541 | 33 | 35 | ||
1542 | 34 | protected: | 36 | protected: |
1543 | 35 | virtual void SetUp() { | 37 | virtual void SetUp() { |
1544 | 38 | /* Click DB Config */ | ||
1545 | 36 | g_setenv("TEST_CLICK_DB", "click-db", TRUE); | 39 | g_setenv("TEST_CLICK_DB", "click-db", TRUE); |
1546 | 37 | g_setenv("TEST_CLICK_USER", "test-user", TRUE); | 40 | g_setenv("TEST_CLICK_USER", "test-user", TRUE); |
1547 | 38 | 41 | ||
1548 | 42 | /* Make sure we don't use the local snapd */ | ||
1549 | 43 | g_setenv("UBUNTU_APP_LAUNCH_SNAPD_SOCKET", "/this/should/not/exist", TRUE); | ||
1550 | 44 | |||
1551 | 45 | /* UAL Desktop Hook check */ | ||
1552 | 46 | g_setenv("UBUNTU_APP_LAUNCH_LINK_FARM", CMAKE_SOURCE_DIR "/tests/ual-link-farm", TRUE); | ||
1553 | 47 | |||
1554 | 48 | /* XDG Data home for libertine */ | ||
1555 | 49 | g_setenv("XDG_DATA_HOME", CMAKE_SOURCE_DIR "/tests/xdg-data", TRUE); | ||
1556 | 50 | g_setenv("XDG_CACHE_HOME", CMAKE_SOURCE_DIR "/tests/xdg-cache", TRUE); | ||
1557 | 51 | |||
1558 | 39 | cachedir = g_build_filename(CMAKE_BINARY_DIR, "app-id-test-cache", nullptr); | 52 | cachedir = g_build_filename(CMAKE_BINARY_DIR, "app-id-test-cache", nullptr); |
1559 | 40 | g_setenv("URL_DISPATCHER_CACHE_DIR", cachedir, TRUE); | 53 | g_setenv("URL_DISPATCHER_CACHE_DIR", cachedir, TRUE); |
1560 | 41 | 54 | ||
1561 | @@ -43,13 +56,14 @@ | |||
1562 | 43 | g_test_dbus_up(testbus); | 56 | g_test_dbus_up(testbus); |
1563 | 44 | 57 | ||
1564 | 45 | mainloop = g_main_loop_new(nullptr, FALSE); | 58 | mainloop = g_main_loop_new(nullptr, FALSE); |
1566 | 46 | dispatcher_init(mainloop, reinterpret_cast<OverlayTracker *>(&tracker)); | 59 | dispatcher_init(mainloop, reinterpret_cast<OverlayTracker *>(&tracker), nullptr); |
1567 | 47 | 60 | ||
1568 | 48 | return; | 61 | return; |
1569 | 49 | } | 62 | } |
1570 | 50 | 63 | ||
1571 | 51 | virtual void TearDown() { | 64 | virtual void TearDown() { |
1572 | 52 | dispatcher_shutdown(); | 65 | dispatcher_shutdown(); |
1573 | 66 | ubuntu::app_launch::Registry::clearDefault(); | ||
1574 | 53 | 67 | ||
1575 | 54 | /* Clean up queued events */ | 68 | /* Clean up queued events */ |
1576 | 55 | while (g_main_pending()) { | 69 | while (g_main_pending()) { |
1577 | @@ -88,6 +102,18 @@ | |||
1578 | 88 | g_clear_pointer(&out_appid, g_free); | 102 | g_clear_pointer(&out_appid, g_free); |
1579 | 89 | out_url = nullptr; | 103 | out_url = nullptr; |
1580 | 90 | 104 | ||
1581 | 105 | /* App ID with periods */ | ||
1582 | 106 | dispatcher_url_to_appid("appid://container-id/org.canonical.app1/0.0", &out_appid, &out_url); | ||
1583 | 107 | ASSERT_STREQ("container-id_org.canonical.app1_0.0", out_appid); | ||
1584 | 108 | EXPECT_EQ(nullptr, out_url); | ||
1585 | 109 | |||
1586 | 110 | dispatcher_send_to_app(out_appid, out_url); | ||
1587 | 111 | EXPECT_STREQ("container-id_org.canonical.app1_0.0", ubuntu_app_launch_mock_get_last_app_id()); | ||
1588 | 112 | |||
1589 | 113 | ubuntu_app_launch_mock_clear_last_app_id(); | ||
1590 | 114 | g_clear_pointer(&out_appid, g_free); | ||
1591 | 115 | out_url = nullptr; | ||
1592 | 116 | |||
1593 | 91 | /* No version at all */ | 117 | /* No version at all */ |
1594 | 92 | dispatcher_url_to_appid("appid://com.test.good/app1", &out_appid, &out_url); | 118 | dispatcher_url_to_appid("appid://com.test.good/app1", &out_appid, &out_url); |
1595 | 93 | 119 | ||
1596 | @@ -199,31 +225,3 @@ | |||
1597 | 199 | 225 | ||
1598 | 200 | return; | 226 | return; |
1599 | 201 | } | 227 | } |
1600 | 202 | |||
1601 | 203 | TEST_F(AppIdTest, BadDirectory) | ||
1602 | 204 | { | ||
1603 | 205 | gchar * out_appid = nullptr; | ||
1604 | 206 | const gchar * out_url = nullptr; | ||
1605 | 207 | |||
1606 | 208 | g_setenv("TEST_CLICK_DB", "not-click-db", TRUE); | ||
1607 | 209 | |||
1608 | 210 | dispatcher_url_to_appid("appid://com.test.good/app1/current-user-version", &out_appid, &out_url); | ||
1609 | 211 | |||
1610 | 212 | EXPECT_EQ(nullptr, out_appid); | ||
1611 | 213 | EXPECT_EQ(nullptr, out_url); | ||
1612 | 214 | |||
1613 | 215 | return; | ||
1614 | 216 | } | ||
1615 | 217 | |||
1616 | 218 | TEST_F(AppIdTest, BadUser) | ||
1617 | 219 | { | ||
1618 | 220 | gchar * out_appid = nullptr; | ||
1619 | 221 | const gchar * out_url = nullptr; | ||
1620 | 222 | |||
1621 | 223 | g_setenv("TEST_CLICK_USER", "not-test-user", TRUE); | ||
1622 | 224 | |||
1623 | 225 | dispatcher_url_to_appid("appid://com.test.good/app1/current-user-version", &out_appid, &out_url); | ||
1624 | 226 | |||
1625 | 227 | EXPECT_EQ(nullptr, out_appid); | ||
1626 | 228 | EXPECT_EQ(nullptr, out_url); | ||
1627 | 229 | } | ||
1628 | 230 | 228 | ||
1629 | === added file 'tests/apparmor-mock.c' | |||
1630 | --- tests/apparmor-mock.c 1970-01-01 00:00:00 +0000 | |||
1631 | +++ tests/apparmor-mock.c 2016-11-07 16:32:23 +0000 | |||
1632 | @@ -0,0 +1,36 @@ | |||
1633 | 1 | /** | ||
1634 | 2 | * Copyright © 2015 Canonical, Ltd. | ||
1635 | 3 | * | ||
1636 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1637 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
1638 | 6 | * the Free Software Foundation. | ||
1639 | 7 | * | ||
1640 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
1641 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
1642 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1643 | 11 | * Lesser General Public License for more details. | ||
1644 | 12 | * | ||
1645 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1646 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1647 | 15 | * | ||
1648 | 16 | */ | ||
1649 | 17 | |||
1650 | 18 | #include <glib.h> | ||
1651 | 19 | #include <sys/apparmor.h> | ||
1652 | 20 | |||
1653 | 21 | const char * aa_mock_gettask_profile = NULL; | ||
1654 | 22 | |||
1655 | 23 | int aa_gettaskcon (pid_t pid, char ** profile, char ** mode) | ||
1656 | 24 | { | ||
1657 | 25 | g_debug("Gettask Con '%s'", aa_mock_gettask_profile); | ||
1658 | 26 | |||
1659 | 27 | if (aa_mock_gettask_profile == NULL) { | ||
1660 | 28 | return 1; | ||
1661 | 29 | } | ||
1662 | 30 | |||
1663 | 31 | if (profile != NULL) { | ||
1664 | 32 | *profile = g_strdup(aa_mock_gettask_profile); | ||
1665 | 33 | } | ||
1666 | 34 | |||
1667 | 35 | return 0; | ||
1668 | 36 | } | ||
1669 | 0 | 37 | ||
1670 | === added file 'tests/apparmor-mock.h' | |||
1671 | --- tests/apparmor-mock.h 1970-01-01 00:00:00 +0000 | |||
1672 | +++ tests/apparmor-mock.h 2016-11-07 16:32:23 +0000 | |||
1673 | @@ -0,0 +1,20 @@ | |||
1674 | 1 | /** | ||
1675 | 2 | * Copyright © 2015 Canonical, Ltd. | ||
1676 | 3 | * | ||
1677 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1678 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
1679 | 6 | * the Free Software Foundation. | ||
1680 | 7 | * | ||
1681 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
1682 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
1683 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1684 | 11 | * Lesser General Public License for more details. | ||
1685 | 12 | * | ||
1686 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1687 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1688 | 15 | * | ||
1689 | 16 | */ | ||
1690 | 17 | |||
1691 | 18 | #pragma once | ||
1692 | 19 | |||
1693 | 20 | extern const char * aa_mock_gettask_profile; | ||
1694 | 0 | 21 | ||
1695 | === modified file 'tests/click-data/manifests/com.test.good.manifest' | |||
1696 | --- tests/click-data/manifests/com.test.good.manifest 2013-09-18 04:16:51 +0000 | |||
1697 | +++ tests/click-data/manifests/com.test.good.manifest 2016-11-07 16:32:23 +0000 | |||
1698 | @@ -3,7 +3,7 @@ | |||
1699 | 3 | "name": "com.test.good", | 3 | "name": "com.test.good", |
1700 | 4 | "hooks": { | 4 | "hooks": { |
1701 | 5 | "app1": { | 5 | "app1": { |
1703 | 6 | "test": "test" | 6 | "desktop": "app1.desktop" |
1704 | 7 | } | 7 | } |
1705 | 8 | } | 8 | } |
1706 | 9 | } | 9 | } |
1707 | 10 | 10 | ||
1708 | === modified file 'tests/click-data/manifests/com.test.multiple.manifest' | |||
1709 | --- tests/click-data/manifests/com.test.multiple.manifest 2013-09-26 20:30:45 +0000 | |||
1710 | +++ tests/click-data/manifests/com.test.multiple.manifest 2016-11-07 16:32:23 +0000 | |||
1711 | @@ -3,13 +3,13 @@ | |||
1712 | 3 | "name": "com.test.good", | 3 | "name": "com.test.good", |
1713 | 4 | "hooks": { | 4 | "hooks": { |
1714 | 5 | "app-first": { | 5 | "app-first": { |
1716 | 6 | "test": "test" | 6 | "desktop": "app-first.desktop" |
1717 | 7 | }, | 7 | }, |
1718 | 8 | "app-middle": { | 8 | "app-middle": { |
1720 | 9 | "test": "test" | 9 | "desktop": "app-middle.desktop" |
1721 | 10 | }, | 10 | }, |
1722 | 11 | "app-last": { | 11 | "app-last": { |
1724 | 12 | "test": "test" | 12 | "desktop": "app-last.desktop" |
1725 | 13 | } | 13 | } |
1726 | 14 | } | 14 | } |
1727 | 15 | } | 15 | } |
1728 | 16 | 16 | ||
1729 | === modified file 'tests/dispatcher-test.cc' | |||
1730 | --- tests/dispatcher-test.cc 2015-06-08 17:13:44 +0000 | |||
1731 | +++ tests/dispatcher-test.cc 2016-11-07 16:32:23 +0000 | |||
1732 | @@ -19,10 +19,13 @@ | |||
1733 | 19 | 19 | ||
1734 | 20 | #include <gio/gio.h> | 20 | #include <gio/gio.h> |
1735 | 21 | #include <gtest/gtest.h> | 21 | #include <gtest/gtest.h> |
1736 | 22 | #include <libdbustest/dbus-test.h> | ||
1737 | 22 | #include "dispatcher.h" | 23 | #include "dispatcher.h" |
1738 | 23 | #include "ubuntu-app-launch-mock.h" | 24 | #include "ubuntu-app-launch-mock.h" |
1739 | 24 | #include "overlay-tracker-mock.h" | 25 | #include "overlay-tracker-mock.h" |
1740 | 25 | #include "url-db.h" | 26 | #include "url-db.h" |
1741 | 27 | #include "scope-mock.h" | ||
1742 | 28 | #include "apparmor-mock.h" | ||
1743 | 26 | 29 | ||
1744 | 27 | class DispatcherTest : public ::testing::Test | 30 | class DispatcherTest : public ::testing::Test |
1745 | 28 | { | 31 | { |
1746 | @@ -33,6 +36,7 @@ | |||
1747 | 33 | 36 | ||
1748 | 34 | protected: | 37 | protected: |
1749 | 35 | OverlayTrackerMock tracker; | 38 | OverlayTrackerMock tracker; |
1750 | 39 | RuntimeMock scope_runtime; | ||
1751 | 36 | GDBusConnection * session = nullptr; | 40 | GDBusConnection * session = nullptr; |
1752 | 37 | 41 | ||
1753 | 38 | virtual void SetUp() { | 42 | virtual void SetUp() { |
1754 | @@ -66,6 +70,9 @@ | |||
1755 | 66 | url_db_set_file_motification_time(db, "/testdir/intenter.url-dispatcher", ×tamp); | 70 | url_db_set_file_motification_time(db, "/testdir/intenter.url-dispatcher", ×tamp); |
1756 | 67 | url_db_insert_url(db, "/testdir/intenter.url-dispatcher", "intent", "my.android.package"); | 71 | url_db_insert_url(db, "/testdir/intenter.url-dispatcher", "intent", "my.android.package"); |
1757 | 68 | 72 | ||
1758 | 73 | url_db_set_file_motification_time(db, "/testdir/scoper.url-dispatcher", ×tamp); | ||
1759 | 74 | url_db_insert_url(db, "/testdir/scoper.url-dispatcher", "scope", nullptr); | ||
1760 | 75 | |||
1761 | 69 | sqlite3_close(db); | 76 | sqlite3_close(db); |
1762 | 70 | 77 | ||
1763 | 71 | testbus = g_test_dbus_new(G_TEST_DBUS_NONE); | 78 | testbus = g_test_dbus_new(G_TEST_DBUS_NONE); |
1764 | @@ -74,7 +81,7 @@ | |||
1765 | 74 | session = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); | 81 | session = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, NULL); |
1766 | 75 | 82 | ||
1767 | 76 | mainloop = g_main_loop_new(nullptr, FALSE); | 83 | mainloop = g_main_loop_new(nullptr, FALSE); |
1769 | 77 | dispatcher_init(mainloop, reinterpret_cast<OverlayTracker *>(&tracker)); | 84 | dispatcher_init(mainloop, reinterpret_cast<OverlayTracker *>(&tracker), reinterpret_cast<ScopeChecker *>(&scope_runtime)); |
1770 | 78 | 85 | ||
1771 | 79 | return; | 86 | return; |
1772 | 80 | } | 87 | } |
1773 | @@ -90,6 +97,7 @@ | |||
1774 | 90 | g_main_loop_unref(mainloop); | 97 | g_main_loop_unref(mainloop); |
1775 | 91 | 98 | ||
1776 | 92 | ubuntu_app_launch_mock_clear_last_app_id(); | 99 | ubuntu_app_launch_mock_clear_last_app_id(); |
1777 | 100 | scope_runtime.clearExceptions(); | ||
1778 | 93 | 101 | ||
1779 | 94 | /* let other threads settle */ | 102 | /* let other threads settle */ |
1780 | 95 | g_usleep(500000); | 103 | g_usleep(500000); |
1781 | @@ -260,6 +268,42 @@ | |||
1782 | 260 | return; | 268 | return; |
1783 | 261 | } | 269 | } |
1784 | 262 | 270 | ||
1785 | 271 | DbusTestDbusMock * | ||
1786 | 272 | setupUpstartMock () | ||
1787 | 273 | { | ||
1788 | 274 | auto mock = dbus_test_dbus_mock_new("com.ubuntu.Upstart"); | ||
1789 | 275 | auto obj = dbus_test_dbus_mock_get_object(mock, "/com/ubuntu/Upstart", "com.ubuntu.Upstart0_6", nullptr); | ||
1790 | 276 | |||
1791 | 277 | dbus_test_dbus_mock_object_add_method(mock, obj, | ||
1792 | 278 | "GetJobByName", | ||
1793 | 279 | G_VARIANT_TYPE_STRING, | ||
1794 | 280 | G_VARIANT_TYPE_OBJECT_PATH, /* out */ | ||
1795 | 281 | "ret = dbus.ObjectPath('/job')", /* python */ | ||
1796 | 282 | nullptr); /* error */ | ||
1797 | 283 | |||
1798 | 284 | auto jobobj = dbus_test_dbus_mock_get_object(mock, "/job", "com.ubuntu.Upstart0_6.Job", nullptr); | ||
1799 | 285 | |||
1800 | 286 | dbus_test_dbus_mock_object_add_method(mock, jobobj, | ||
1801 | 287 | "GetInstanceByName", | ||
1802 | 288 | G_VARIANT_TYPE_STRING, | ||
1803 | 289 | G_VARIANT_TYPE_OBJECT_PATH, /* out */ | ||
1804 | 290 | "ret = dbus.ObjectPath('/instance')", /* python */ | ||
1805 | 291 | NULL); /* error */ | ||
1806 | 292 | |||
1807 | 293 | auto instobj = dbus_test_dbus_mock_get_object(mock, "/instance", "com.ubuntu.Upstart0_6.Instance", NULL); | ||
1808 | 294 | |||
1809 | 295 | dbus_test_dbus_mock_object_add_property(mock, instobj, | ||
1810 | 296 | "processes", | ||
1811 | 297 | G_VARIANT_TYPE("a(si)"), | ||
1812 | 298 | g_variant_new_parsed("[('main', 1234)]"), | ||
1813 | 299 | NULL); | ||
1814 | 300 | |||
1815 | 301 | dbus_test_task_set_name(DBUS_TEST_TASK(mock), "Upstart"); | ||
1816 | 302 | dbus_test_task_run(DBUS_TEST_TASK(mock)); | ||
1817 | 303 | |||
1818 | 304 | return mock; | ||
1819 | 305 | } | ||
1820 | 306 | |||
1821 | 263 | TEST_F(DispatcherTest, OverlayTest) | 307 | TEST_F(DispatcherTest, OverlayTest) |
1822 | 264 | { | 308 | { |
1823 | 265 | EXPECT_TRUE(dispatcher_is_overlay("com.test.good_application_1.2.3")); | 309 | EXPECT_TRUE(dispatcher_is_overlay("com.test.good_application_1.2.3")); |
1824 | @@ -272,5 +316,44 @@ | |||
1825 | 272 | EXPECT_EQ(getpid(), std::get<1>(tracker.addedOverlays[0])); | 316 | EXPECT_EQ(getpid(), std::get<1>(tracker.addedOverlays[0])); |
1826 | 273 | EXPECT_EQ("overlay://ubuntu.com", std::get<2>(tracker.addedOverlays[0])); | 317 | EXPECT_EQ("overlay://ubuntu.com", std::get<2>(tracker.addedOverlays[0])); |
1827 | 274 | 318 | ||
1828 | 319 | tracker.addedOverlays.clear(); | ||
1829 | 320 | aa_mock_gettask_profile = "simplescope.scopemaster_simplescope_1.2.3"; | ||
1830 | 321 | |||
1831 | 322 | auto upstartMock = setupUpstartMock(); | ||
1832 | 323 | |||
1833 | 324 | EXPECT_TRUE(dispatcher_send_to_overlay ("com.test.good_application_1.2.3", "overlay://ubuntu.com", session, g_dbus_connection_get_unique_name(session))); | ||
1834 | 325 | |||
1835 | 326 | ASSERT_EQ(1, tracker.addedOverlays.size()); | ||
1836 | 327 | EXPECT_EQ("com.test.good_application_1.2.3", std::get<0>(tracker.addedOverlays[0])); | ||
1837 | 328 | EXPECT_EQ(1234, std::get<1>(tracker.addedOverlays[0])); | ||
1838 | 329 | EXPECT_EQ("overlay://ubuntu.com", std::get<2>(tracker.addedOverlays[0])); | ||
1839 | 330 | |||
1840 | 331 | g_object_unref(upstartMock); | ||
1841 | 332 | |||
1842 | 275 | return; | 333 | return; |
1843 | 276 | } | 334 | } |
1844 | 335 | |||
1845 | 336 | TEST_F(DispatcherTest, ScopeTest) | ||
1846 | 337 | { | ||
1847 | 338 | gchar * out_appid = nullptr; | ||
1848 | 339 | |||
1849 | 340 | unity::scopes::NotFoundException scopeException("test", "badscope"); | ||
1850 | 341 | scope_runtime.addException("badscope.scopemaster_badscope", scopeException); | ||
1851 | 342 | std::invalid_argument invalidException("confused"); | ||
1852 | 343 | scope_runtime.addException("confusedscope.scopemaster_confusedscope", invalidException); | ||
1853 | 344 | |||
1854 | 345 | /* Good sanity check */ | ||
1855 | 346 | dispatcher_url_to_appid("scope://simplescope.scopemaster_simplescope", &out_appid, nullptr); | ||
1856 | 347 | EXPECT_STREQ("scoper", out_appid); | ||
1857 | 348 | g_free(out_appid); | ||
1858 | 349 | |||
1859 | 350 | /* Bad scope */ | ||
1860 | 351 | dispatcher_url_to_appid("scope://badscope.scopemaster_badscope", &out_appid, nullptr); | ||
1861 | 352 | EXPECT_STRNE("scoper", out_appid); | ||
1862 | 353 | g_free(out_appid); | ||
1863 | 354 | |||
1864 | 355 | /* Confused scope */ | ||
1865 | 356 | dispatcher_url_to_appid("scope://confusedscope.scopemaster_confusedscope", &out_appid, nullptr); | ||
1866 | 357 | EXPECT_STRNE("scoper", out_appid); | ||
1867 | 358 | g_free(out_appid); | ||
1868 | 359 | } | ||
1869 | 277 | 360 | ||
1870 | === modified file 'tests/overlay-tracker-mock.h' | |||
1871 | --- tests/overlay-tracker-mock.h 2015-05-19 20:24:47 +0000 | |||
1872 | +++ tests/overlay-tracker-mock.h 2016-11-07 16:32:23 +0000 | |||
1873 | @@ -22,9 +22,15 @@ | |||
1874 | 22 | { | 22 | { |
1875 | 23 | public: | 23 | public: |
1876 | 24 | std::vector<std::tuple<std::string, unsigned long, std::string>> addedOverlays; | 24 | std::vector<std::tuple<std::string, unsigned long, std::string>> addedOverlays; |
1877 | 25 | std::vector<std::pair<unsigned long, std::string>> addedBadUrl; | ||
1878 | 25 | 26 | ||
1879 | 26 | bool addOverlay (const char * appid, unsigned long pid, const char * url) { | 27 | bool addOverlay (const char * appid, unsigned long pid, const char * url) { |
1880 | 27 | addedOverlays.push_back(std::make_tuple(std::string(appid), pid, std::string(url))); | 28 | addedOverlays.push_back(std::make_tuple(std::string(appid), pid, std::string(url))); |
1881 | 28 | return true; | 29 | return true; |
1882 | 29 | } | 30 | } |
1883 | 31 | |||
1884 | 32 | bool badUrl (unsigned long pid, const char * url) { | ||
1885 | 33 | addedBadUrl.push_back(std::make_pair(pid, std::string(url))); | ||
1886 | 34 | return true; | ||
1887 | 35 | } | ||
1888 | 30 | }; | 36 | }; |
1889 | 31 | 37 | ||
1890 | === modified file 'tests/overlay-tracker-test.cpp' | |||
1891 | --- tests/overlay-tracker-test.cpp 2015-05-19 20:24:47 +0000 | |||
1892 | +++ tests/overlay-tracker-test.cpp 2016-11-07 16:32:23 +0000 | |||
1893 | @@ -95,23 +95,43 @@ | |||
1894 | 95 | } | 95 | } |
1895 | 96 | } | 96 | } |
1896 | 97 | 97 | ||
1899 | 98 | TEST_F(OverlayTrackerTest, UALSignalStop) { | 98 | void |
1900 | 99 | OverlayTrackerMir tracker; | 99 | ualStop (const char * helper_type, std::function<bool(OverlayTrackerMir *)> addFunc) |
1901 | 100 | { | ||
1902 | 101 | auto tracker = new OverlayTrackerMir(); | ||
1903 | 100 | 102 | ||
1904 | 101 | /* Call with the overlay before it is set */ | 103 | /* Call with the overlay before it is set */ |
1906 | 102 | ubuntu_app_launch_mock_observer_helper_stop_func("app-id", "instance", "url-overlay", ubuntu_app_launch_mock_observer_helper_stop_user_data); | 104 | ubuntu_app_launch_mock_observer_helper_stop_func("app-id", "instance", helper_type, ubuntu_app_launch_mock_observer_helper_stop_user_data); |
1907 | 103 | 105 | ||
1909 | 104 | EXPECT_TRUE(tracker.addOverlay("app-id", 5, "http://no-name-yet.com")); | 106 | EXPECT_TRUE(addFunc(tracker)); |
1910 | 105 | 107 | ||
1911 | 106 | mir_mock_last_released_session = nullptr; | 108 | mir_mock_last_released_session = nullptr; |
1913 | 107 | ubuntu_app_launch_mock_observer_helper_stop_func("app-id", "instance", "url-overlay", ubuntu_app_launch_mock_observer_helper_stop_user_data); | 109 | ubuntu_app_launch_mock_observer_helper_stop_func("app-id", "instance", helper_type, ubuntu_app_launch_mock_observer_helper_stop_user_data); |
1914 | 110 | |||
1915 | 111 | delete tracker; | ||
1916 | 112 | |||
1917 | 108 | EXPECT_NE(nullptr, mir_mock_last_released_session); | 113 | EXPECT_NE(nullptr, mir_mock_last_released_session); |
1918 | 109 | } | 114 | } |
1919 | 110 | 115 | ||
1924 | 111 | TEST_F(OverlayTrackerTest, MirSignalStop) { | 116 | TEST_F(OverlayTrackerTest, UALSignalStop) { |
1925 | 112 | OverlayTrackerMir tracker; | 117 | ualStop("url-overlay", [](OverlayTrackerMir * tracker) { |
1926 | 113 | 118 | return tracker->addOverlay("app-id", 5, "http://no-name-yet.com"); | |
1927 | 114 | EXPECT_TRUE(tracker.addOverlay("app-id", 5, "http://no-name-yet.com")); | 119 | }); |
1928 | 120 | ualStop("bad-url", [](OverlayTrackerMir * tracker) { | ||
1929 | 121 | return tracker->badUrl(5, "http://no-name-yet.com"); | ||
1930 | 122 | }); | ||
1931 | 123 | } | ||
1932 | 124 | |||
1933 | 125 | void | ||
1934 | 126 | mirStop (const char * helper_type, const char * appid, std::function<bool(OverlayTrackerMir *)> addFunc) | ||
1935 | 127 | { | ||
1936 | 128 | g_clear_pointer(&ubuntu_app_launch_mock_last_stop_helper, g_free); | ||
1937 | 129 | g_clear_pointer(&ubuntu_app_launch_mock_last_stop_appid, g_free); | ||
1938 | 130 | g_clear_pointer(&ubuntu_app_launch_mock_last_stop_instance, g_free); | ||
1939 | 131 | |||
1940 | 132 | auto tracker = new OverlayTrackerMir(); | ||
1941 | 133 | |||
1942 | 134 | EXPECT_TRUE(addFunc(tracker)); | ||
1943 | 115 | 135 | ||
1944 | 116 | /* Try a badie */ | 136 | /* Try a badie */ |
1945 | 117 | mir_mock_last_trust_func((MirPromptSession *)1337, mir_prompt_session_state_stopped, mir_mock_last_trust_data); | 137 | mir_mock_last_trust_func((MirPromptSession *)1337, mir_prompt_session_state_stopped, mir_mock_last_trust_data); |
1946 | @@ -119,9 +139,18 @@ | |||
1947 | 119 | EXPECT_NE(nullptr, mir_mock_last_trust_func); | 139 | EXPECT_NE(nullptr, mir_mock_last_trust_func); |
1948 | 120 | mir_mock_last_trust_func(mir_mock_valid_trust_session, mir_prompt_session_state_stopped, mir_mock_last_trust_data); | 140 | mir_mock_last_trust_func(mir_mock_valid_trust_session, mir_prompt_session_state_stopped, mir_mock_last_trust_data); |
1949 | 121 | 141 | ||
1951 | 122 | pause(100); | 142 | delete tracker; |
1952 | 123 | 143 | ||
1955 | 124 | EXPECT_STREQ("url-overlay", ubuntu_app_launch_mock_last_stop_helper); | 144 | EXPECT_STREQ(helper_type, ubuntu_app_launch_mock_last_stop_helper); |
1956 | 125 | EXPECT_STREQ("app-id", ubuntu_app_launch_mock_last_stop_appid); | 145 | EXPECT_STREQ(appid, ubuntu_app_launch_mock_last_stop_appid); |
1957 | 126 | EXPECT_STREQ("instance", ubuntu_app_launch_mock_last_stop_instance); | 146 | EXPECT_STREQ("instance", ubuntu_app_launch_mock_last_stop_instance); |
1958 | 127 | } | 147 | } |
1959 | 148 | |||
1960 | 149 | TEST_F(OverlayTrackerTest, MirSignalStop) { | ||
1961 | 150 | mirStop("url-overlay", "app-id", [](OverlayTrackerMir * tracker) { | ||
1962 | 151 | return tracker->addOverlay("app-id", 5, "http://no-name-yet.com"); | ||
1963 | 152 | }); | ||
1964 | 153 | mirStop("bad-url", "url-dispatcher-bad-url-helper", [](OverlayTrackerMir * tracker) { | ||
1965 | 154 | return tracker->badUrl(5, "http://no-name-yet.com"); | ||
1966 | 155 | }); | ||
1967 | 156 | } | ||
1968 | 128 | 157 | ||
1969 | === added file 'tests/scope-mock.h' | |||
1970 | --- tests/scope-mock.h 1970-01-01 00:00:00 +0000 | |||
1971 | +++ tests/scope-mock.h 2016-11-07 16:32:23 +0000 | |||
1972 | @@ -0,0 +1,95 @@ | |||
1973 | 1 | /** | ||
1974 | 2 | * Copyright © 2015 Canonical, Ltd. | ||
1975 | 3 | * | ||
1976 | 4 | * This program is free software: you can redistribute it and/or modify it under | ||
1977 | 5 | * the terms of the GNU Lesser General Public License version 3, as published by | ||
1978 | 6 | * the Free Software Foundation. | ||
1979 | 7 | * | ||
1980 | 8 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
1981 | 9 | * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, | ||
1982 | 10 | * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
1983 | 11 | * Lesser General Public License for more details. | ||
1984 | 12 | * | ||
1985 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
1986 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
1987 | 15 | * | ||
1988 | 16 | */ | ||
1989 | 17 | |||
1990 | 18 | #include <unity-scopes.h> | ||
1991 | 19 | #include <unity/scopes/testing/ScopeMetadataBuilder.h> | ||
1992 | 20 | |||
1993 | 21 | #include "scope-checker-facade.h" | ||
1994 | 22 | |||
1995 | 23 | class unity::scopes::internal::ScopeMetadataImpl { | ||
1996 | 24 | public: | ||
1997 | 25 | ScopeMetadataImpl () { } | ||
1998 | 26 | virtual ~ScopeMetadataImpl () {} | ||
1999 | 27 | |||
2000 | 28 | }; | ||
2001 | 29 | |||
2002 | 30 | /******** | ||
2003 | 31 | TODO: Look at replacing this with: #include <unity/scopes/testing/MockRegistry.h> | ||
2004 | 32 | *******/ | ||
2005 | 33 | |||
2006 | 34 | class RegistryMock : public virtual unity::scopes::Registry | ||
2007 | 35 | { | ||
2008 | 36 | std::shared_ptr<std::map<std::string, std::exception>> scopeExceptions; | ||
2009 | 37 | |||
2010 | 38 | public: | ||
2011 | 39 | RegistryMock (std::shared_ptr<std::map<std::string, std::exception>> inexceptions) | ||
2012 | 40 | : scopeExceptions(inexceptions) | ||
2013 | 41 | { | ||
2014 | 42 | } | ||
2015 | 43 | |||
2016 | 44 | unity::scopes::ScopeMetadata get_metadata(std::string const& scope_id) override { | ||
2017 | 45 | std::cout << "Getting Metadata" << std::endl; | ||
2018 | 46 | try { | ||
2019 | 47 | auto exp = scopeExceptions->at(scope_id); | ||
2020 | 48 | throw exp; | ||
2021 | 49 | } catch (std::out_of_range e) { | ||
2022 | 50 | unity::scopes::testing::ScopeMetadataBuilder builder; | ||
2023 | 51 | builder.scope_id(scope_id); | ||
2024 | 52 | std::shared_ptr<unity::scopes::Scope> foo((unity::scopes::Scope *)5, [](unity::scopes::Scope *) { return; }); | ||
2025 | 53 | builder.proxy(foo); | ||
2026 | 54 | builder.display_name("foo"); | ||
2027 | 55 | builder.description("foo"); | ||
2028 | 56 | builder.author("foo"); | ||
2029 | 57 | return builder(); | ||
2030 | 58 | } | ||
2031 | 59 | } | ||
2032 | 60 | |||
2033 | 61 | /* I hate C++ so much right now */ | ||
2034 | 62 | std::string endpoint() override { throw new std::invalid_argument("Not implemented"); } | ||
2035 | 63 | std::string identity() override { throw new std::invalid_argument("Not implemented"); } | ||
2036 | 64 | std::string target_category() override { throw new std::invalid_argument("Not implemented"); } | ||
2037 | 65 | std::string to_string() override { throw new std::invalid_argument("Not implemented"); } | ||
2038 | 66 | int64_t timeout() override { throw new std::invalid_argument("Not implemented"); } | ||
2039 | 67 | unity::scopes::MetadataMap list() override { throw new std::invalid_argument("Not implemented"); } | ||
2040 | 68 | unity::scopes::MetadataMap list_if(std::function<bool(unity::scopes::ScopeMetadata const& item)>) override { throw new std::invalid_argument("Not implemented"); } | ||
2041 | 69 | bool is_scope_running(std::string const&) override { throw new std::invalid_argument("Not implemented"); } | ||
2042 | 70 | core::ScopedConnection set_scope_state_callback(std::string const&, std::function<void(bool is_running)>) override { throw new std::invalid_argument("Not implemented"); } | ||
2043 | 71 | core::ScopedConnection set_list_update_callback(std::function<void()>) override { throw new std::invalid_argument("Not implemented"); } | ||
2044 | 72 | }; | ||
2045 | 73 | |||
2046 | 74 | class RuntimeMock : public RuntimeFacade | ||
2047 | 75 | { | ||
2048 | 76 | std::shared_ptr<std::map<std::string, std::exception>> scopeExceptions; | ||
2049 | 77 | |||
2050 | 78 | public: | ||
2051 | 79 | RuntimeMock() { | ||
2052 | 80 | scopeExceptions = std::make_shared<std::map<std::string, std::exception>>(); | ||
2053 | 81 | } | ||
2054 | 82 | |||
2055 | 83 | unity::scopes::RegistryProxy registry () { | ||
2056 | 84 | return std::make_shared<RegistryMock>(scopeExceptions); | ||
2057 | 85 | } | ||
2058 | 86 | |||
2059 | 87 | void clearExceptions() { | ||
2060 | 88 | scopeExceptions->clear(); | ||
2061 | 89 | } | ||
2062 | 90 | |||
2063 | 91 | void addException (std::string scopeid, std::exception exp) { | ||
2064 | 92 | (*scopeExceptions)[scopeid] = exp; | ||
2065 | 93 | } | ||
2066 | 94 | }; | ||
2067 | 95 | |||
2068 | 0 | 96 | ||
2069 | === modified file 'tests/service-test.cc' | |||
2070 | --- tests/service-test.cc 2015-05-20 16:27:27 +0000 | |||
2071 | +++ tests/service-test.cc 2016-11-07 16:32:23 +0000 | |||
2072 | @@ -38,6 +38,7 @@ | |||
2073 | 38 | virtual void SetUp() { | 38 | virtual void SetUp() { |
2074 | 39 | g_setenv("UBUNTU_APP_LAUNCH_USE_SESSION", "1", TRUE); | 39 | g_setenv("UBUNTU_APP_LAUNCH_USE_SESSION", "1", TRUE); |
2075 | 40 | g_setenv("URL_DISPATCHER_DISABLE_RECOVERABLE_ERROR", "1", TRUE); | 40 | g_setenv("URL_DISPATCHER_DISABLE_RECOVERABLE_ERROR", "1", TRUE); |
2076 | 41 | g_setenv("URL_DISPATCHER_DISABLE_SCOPE_CHECKING", "1", TRUE); | ||
2077 | 41 | g_setenv("XDG_DATA_DIRS", XDG_DATA_DIRS, TRUE); | 42 | g_setenv("XDG_DATA_DIRS", XDG_DATA_DIRS, TRUE); |
2078 | 42 | g_setenv("LD_PRELOAD", MIR_MOCK_PATH, TRUE); | 43 | g_setenv("LD_PRELOAD", MIR_MOCK_PATH, TRUE); |
2079 | 43 | 44 | ||
2080 | @@ -95,6 +96,10 @@ | |||
2081 | 95 | } | 96 | } |
2082 | 96 | 97 | ||
2083 | 97 | virtual void TearDown() { | 98 | virtual void TearDown() { |
2084 | 99 | gchar * cmdline = g_strdup_printf("kill -TERM %d", dbus_test_process_get_pid(dispatcher)); | ||
2085 | 100 | g_spawn_command_line_sync(cmdline, nullptr, nullptr, nullptr, nullptr); | ||
2086 | 101 | g_free(cmdline); | ||
2087 | 102 | |||
2088 | 98 | g_clear_object(&dispatcher); | 103 | g_clear_object(&dispatcher); |
2089 | 99 | g_clear_object(&mock); | 104 | g_clear_object(&mock); |
2090 | 100 | g_clear_object(&dashmock); | 105 | g_clear_object(&dashmock); |
2091 | @@ -123,7 +128,7 @@ | |||
2092 | 123 | GTimeVal time = {0, 0}; | 128 | GTimeVal time = {0, 0}; |
2093 | 124 | time.tv_sec = 5; | 129 | time.tv_sec = 5; |
2094 | 125 | url_db_set_file_motification_time(db, "/unity8-dash.url-dispatcher", &time); | 130 | url_db_set_file_motification_time(db, "/unity8-dash.url-dispatcher", &time); |
2096 | 126 | url_db_insert_url(db, "/unity8-dash.url-dispatcher", "scope", nullptr); | 131 | url_db_insert_url(db, "/unity8-dash.url-dispatcher", "scopeish", nullptr); |
2097 | 127 | sqlite3_close(db); | 132 | sqlite3_close(db); |
2098 | 128 | } | 133 | } |
2099 | 129 | 134 | ||
2100 | @@ -271,7 +276,7 @@ | |||
2101 | 271 | GMainLoop * main = g_main_loop_new(nullptr, FALSE); | 276 | GMainLoop * main = g_main_loop_new(nullptr, FALSE); |
2102 | 272 | 277 | ||
2103 | 273 | /* Send an invalid URL */ | 278 | /* Send an invalid URL */ |
2105 | 274 | url_dispatch_send("scope://foo-bar", simple_cb, main); | 279 | url_dispatch_send("scopeish://foo-bar", simple_cb, main); |
2106 | 275 | 280 | ||
2107 | 276 | /* Give it some time to send and reply */ | 281 | /* Give it some time to send and reply */ |
2108 | 277 | g_main_loop_run(main); | 282 | g_main_loop_run(main); |
2109 | @@ -288,7 +293,7 @@ | |||
2110 | 288 | calls = dbus_test_dbus_mock_object_get_method_calls(dashmock, fdoobj, "Open", &callslen, nullptr); | 293 | calls = dbus_test_dbus_mock_object_get_method_calls(dashmock, fdoobj, "Open", &callslen, nullptr); |
2111 | 289 | 294 | ||
2112 | 290 | EXPECT_EQ(1, callslen); | 295 | EXPECT_EQ(1, callslen); |
2114 | 291 | EXPECT_TRUE(g_variant_equal(calls[0].params, g_variant_new_parsed("(['scope://foo-bar'], @a{sv} {})"))); | 296 | EXPECT_TRUE(g_variant_equal(calls[0].params, g_variant_new_parsed("(['scopeish://foo-bar'], @a{sv} {})"))); |
2115 | 292 | 297 | ||
2116 | 293 | EXPECT_EQ(1, focus_count); | 298 | EXPECT_EQ(1, focus_count); |
2117 | 294 | 299 | ||
2118 | 295 | 300 | ||
2119 | === modified file 'tests/test-config.h.in' | |||
2120 | --- tests/test-config.h.in 2015-06-08 16:39:15 +0000 | |||
2121 | +++ tests/test-config.h.in 2016-11-07 16:32:23 +0000 | |||
2122 | @@ -11,6 +11,6 @@ | |||
2123 | 11 | #define UPDATE_DIRECTORY_VARIED "@CMAKE_CURRENT_SOURCE_DIR@/test-urls-varied" | 11 | #define UPDATE_DIRECTORY_VARIED "@CMAKE_CURRENT_SOURCE_DIR@/test-urls-varied" |
2124 | 12 | #define UPDATE_DIRECTORY_INTENT "@CMAKE_CURRENT_SOURCE_DIR@/test-urls-intent" | 12 | #define UPDATE_DIRECTORY_INTENT "@CMAKE_CURRENT_SOURCE_DIR@/test-urls-intent" |
2125 | 13 | #define OVERLAY_TEST_DIR "@CMAKE_CURRENT_SOURCE_DIR@/overlay-dir" | 13 | #define OVERLAY_TEST_DIR "@CMAKE_CURRENT_SOURCE_DIR@/overlay-dir" |
2127 | 14 | #define EXEC_TOOL "@CMAKE_BINARY_DIR@/service/exec-tool" | 14 | #define EXEC_TOOL "@CMAKE_BINARY_DIR@/service/url-overlay/exec-tool" |
2128 | 15 | #define MIR_MOCK_PATH "@CMAKE_CURRENT_BINARY_DIR@/libmir-mock.so" | 15 | #define MIR_MOCK_PATH "@CMAKE_CURRENT_BINARY_DIR@/libmir-mock.so" |
2129 | 16 | #define CLICK_DATA_DIR "@CMAKE_CURRENT_SOURCE_DIR@/click-data" | 16 | #define CLICK_DATA_DIR "@CMAKE_CURRENT_SOURCE_DIR@/click-data" |
2130 | 17 | 17 | ||
2131 | === added directory 'tests/ual-link-farm' | |||
2132 | === added file 'tests/ual-link-farm/com.test.good_app1_1.2.3.desktop' | |||
2133 | --- tests/ual-link-farm/com.test.good_app1_1.2.3.desktop 1970-01-01 00:00:00 +0000 | |||
2134 | +++ tests/ual-link-farm/com.test.good_app1_1.2.3.desktop 2016-11-07 16:32:23 +0000 | |||
2135 | @@ -0,0 +1,1 @@ | |||
2136 | 1 | Needs to exist | ||
2137 | 0 | 2 | ||
2138 | === added file 'tests/ual-link-farm/com.test.multiple_app-first_1.2.3.desktop' | |||
2139 | --- tests/ual-link-farm/com.test.multiple_app-first_1.2.3.desktop 1970-01-01 00:00:00 +0000 | |||
2140 | +++ tests/ual-link-farm/com.test.multiple_app-first_1.2.3.desktop 2016-11-07 16:32:23 +0000 | |||
2141 | @@ -0,0 +1,1 @@ | |||
2142 | 1 | Needs to exist | ||
2143 | 0 | 2 | ||
2144 | === added directory 'tests/xdg-cache' | |||
2145 | === added directory 'tests/xdg-cache/libertine-container' | |||
2146 | === added directory 'tests/xdg-cache/libertine-container/container-id' | |||
2147 | === added directory 'tests/xdg-cache/libertine-container/container-id/rootfs' | |||
2148 | === added directory 'tests/xdg-cache/libertine-container/container-id/rootfs/usr' | |||
2149 | === added directory 'tests/xdg-cache/libertine-container/container-id/rootfs/usr/share' | |||
2150 | === added directory 'tests/xdg-cache/libertine-container/container-id/rootfs/usr/share/applications' | |||
2151 | === added file 'tests/xdg-cache/libertine-container/container-id/rootfs/usr/share/applications/org.canonical.app1.desktop' | |||
2152 | --- tests/xdg-cache/libertine-container/container-id/rootfs/usr/share/applications/org.canonical.app1.desktop 1970-01-01 00:00:00 +0000 | |||
2153 | +++ tests/xdg-cache/libertine-container/container-id/rootfs/usr/share/applications/org.canonical.app1.desktop 2016-11-07 16:32:23 +0000 | |||
2154 | @@ -0,0 +1,4 @@ | |||
2155 | 1 | [Desktop File] | ||
2156 | 2 | Name=App1 | ||
2157 | 3 | Exec=app1 | ||
2158 | 4 | Icon=app1.png | ||
2159 | 0 | 5 | ||
2160 | === modified file 'tests/xdg-data/applications/foo-bar.desktop' | |||
2161 | --- tests/xdg-data/applications/foo-bar.desktop 2014-09-17 22:12:21 +0000 | |||
2162 | +++ tests/xdg-data/applications/foo-bar.desktop 2016-11-07 16:32:23 +0000 | |||
2163 | @@ -2,3 +2,4 @@ | |||
2164 | 2 | Name=Foo Bar | 2 | Name=Foo Bar |
2165 | 3 | Exec=foo-bar | 3 | Exec=foo-bar |
2166 | 4 | Type=Application | 4 | Type=Application |
2167 | 5 | Icon=foo-bar.png | ||
2168 | 5 | 6 | ||
2169 | === added directory 'tests/xdg-data/libertine' | |||
2170 | === added file 'tests/xdg-data/libertine/ContainersConfig.json' | |||
2171 | --- tests/xdg-data/libertine/ContainersConfig.json 1970-01-01 00:00:00 +0000 | |||
2172 | +++ tests/xdg-data/libertine/ContainersConfig.json 2016-11-07 16:32:23 +0000 | |||
2173 | @@ -0,0 +1,14 @@ | |||
2174 | 1 | { | ||
2175 | 2 | "containerList": [ | ||
2176 | 3 | { | ||
2177 | 4 | "distro": "xenial", | ||
2178 | 5 | "id": "container-id", | ||
2179 | 6 | "installStatus": "ready", | ||
2180 | 7 | "installedApps": [], | ||
2181 | 8 | "multiarch": "disabled", | ||
2182 | 9 | "name": "Ubuntu 'Xenial Xerus'", | ||
2183 | 10 | "type": "lxc" | ||
2184 | 11 | } | ||
2185 | 12 | ], | ||
2186 | 13 | "defaultContainer": "container-id" | ||
2187 | 14 | } |
FAILED: Continuous integration, rev:104 /jenkins. canonical. com/unity- api-1/job/ lp-url- dispatcher- ci/19/ /jenkins. canonical. com/unity- api-1/job/ build/701/ console /jenkins. canonical. com/unity- api-1/job/ build-0- fetch/707/ console
https:/
Executed test runs:
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/unity- api-1/job/ lp-url- dispatcher- ci/19/rebuild
https:/