Merge lp:~3v1n0/bamf/qmlapp-matching into lp:bamf
- qmlapp-matching
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Marco Trevisan (Treviño) |
Approved revision: | 623 |
Merged at revision: | 567 |
Proposed branch: | lp:~3v1n0/bamf/qmlapp-matching |
Merge into: | lp:bamf |
Diff against target: |
500 lines (+291/-72) 5 files modified
src/bamf-application.c (+0/-3) src/bamf-matcher.c (+69/-62) tests/bamfdaemon/test-application.c (+80/-0) tests/bamfdaemon/test-matcher.c (+134/-7) tests/data/bamf-qml-app.desktop (+8/-0) |
To merge this branch: | bzr merge lp:~3v1n0/bamf/qmlapp-matching |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Brandon Schaefer (community) | Approve | ||
Review via email: mp+176532@code.launchpad.net |
This proposal supersedes a proposal from 2013-07-23.
Commit message
BamfMatcher: correctly match QML applications launched with qmlscene or qmlviewer
Description of the change
Correctly parse the exec for qml applications launched with qmlscene or qmlviewer, use the qml file basename to match a proper .desktop file or to create a new application.
Slightly matching changes and optimizations, added new tests.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
- 622. By Marco Trevisan (Treviño)
-
Merging with trunk
- 623. By Marco Trevisan (Treviño)
-
BamfMatcher: indentation fixes
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:622
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:623
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Brandon Schaefer (brandontschaefer) wrote : | # |
Nice, LGTM
PS Jenkins bot (ps-jenkins) : | # |
Preview Diff
1 | === modified file 'src/bamf-application.c' |
2 | --- src/bamf-application.c 2013-07-16 16:17:38 +0000 |
3 | +++ src/bamf-application.c 2013-07-23 22:23:24 +0000 |
4 | @@ -475,9 +475,6 @@ |
5 | const char *window_class = bamf_legacy_window_get_class_name (window); |
6 | const char *instance_name = bamf_legacy_window_get_class_instance_name (window); |
7 | |
8 | - if (!window_class && !instance_name) |
9 | - return FALSE; |
10 | - |
11 | children = bamf_view_get_children (BAMF_VIEW (self)); |
12 | for (l = children; l; l = l->next) |
13 | { |
14 | |
15 | === modified file 'src/bamf-matcher.c' |
16 | --- src/bamf-matcher.c 2013-06-25 11:15:36 +0000 |
17 | +++ src/bamf-matcher.c 2013-07-23 22:23:24 +0000 |
18 | @@ -58,13 +58,16 @@ |
19 | // Prefixes to be ignored in exec strings |
20 | const gchar* EXEC_BAD_PREFIXES[] = |
21 | { |
22 | - "^gksu(do)?$", "^sudo$", "^su-to-root$", "^amdxdg-su$", "^java(ws)?$", |
23 | + "^gksu(do)?$", "^sudo$", "^su-to-root$", "^amdxdg-su$", "^java(ws)?$", "^cli$", |
24 | "^mono$", "^ruby$", "^padsp$", "^aoss$", "^python(\\d.\\d)?$", "^(ba)?sh$", |
25 | - "^perl$", "^env$", "^xdg-open$", |
26 | + "^perl$", "^env$", "^xdg-open$", "^qmlscene$", "^qmlviewer$", |
27 | /* javaws strings: */ "^net\\.sourceforge\\.jnlp\\.runtime\\.Boot$", "^rt\\.jar$", |
28 | "^com\\.sun\\.javaws\\.Main$", "^deploy\\.jar$" |
29 | }; |
30 | |
31 | +// Sufixes to be ignored in exec strings |
32 | +const gchar* EXEC_BAD_SUFIXES = "(\\.bin|\\.py|\\.pl|\\.qml)$"; |
33 | + |
34 | // Prefixes that must be considered starting point of exec strings |
35 | const gchar* EXEC_GOOD_PREFIXES[] = |
36 | { |
37 | @@ -394,7 +397,7 @@ |
38 | for (i = 0; i < parts_size; ++i) |
39 | { |
40 | part = parts[i]; |
41 | - if (*part == '%' || g_utf8_strrchr (part, -1, '=')) |
42 | + if (*part == '%' || *part == '$' || g_utf8_strrchr (part, -1, '=')) |
43 | continue; |
44 | |
45 | if (*part != '-' || good_prefix) |
46 | @@ -472,7 +475,7 @@ |
47 | { |
48 | tmp = result; |
49 | |
50 | - regex = g_regex_new ("(\\.bin|\\.py|\\.pl)$", 0, 0, NULL); |
51 | + regex = g_regex_new (EXEC_BAD_SUFIXES, 0, 0, NULL); |
52 | result = g_regex_replace_literal (regex, result, -1, 0, "", 0, NULL); |
53 | |
54 | g_free (tmp); |
55 | @@ -1547,18 +1550,18 @@ |
56 | filter_by_wmclass = bamf_matcher_has_instance_class_desktop_file (self, target_class); |
57 | |
58 | if (!filter_by_wmclass) |
59 | - { |
60 | - if (is_web_app_window (window)) |
61 | - { |
62 | - // This ensures that a new application is created even for unknown webapps |
63 | - filter_by_wmclass = TRUE; |
64 | - } |
65 | - else |
66 | - { |
67 | - target_class = class_name; |
68 | - filter_by_wmclass = bamf_matcher_has_instance_class_desktop_file (self, target_class); |
69 | - } |
70 | - } |
71 | + { |
72 | + if (is_web_app_window (window)) |
73 | + { |
74 | + // This ensures that a new application is created even for unknown webapps |
75 | + filter_by_wmclass = TRUE; |
76 | + } |
77 | + else |
78 | + { |
79 | + target_class = class_name; |
80 | + filter_by_wmclass = bamf_matcher_has_instance_class_desktop_file (self, target_class); |
81 | + } |
82 | + } |
83 | |
84 | if (desktop_file) |
85 | { |
86 | @@ -1790,60 +1793,64 @@ |
87 | |
88 | const gchar *app_desktop_class; |
89 | |
90 | - for (a = self->priv->views; a; a = a->next) |
91 | + const char *win_instance_name = bamf_legacy_window_get_class_instance_name (window); |
92 | + char *exec_string = bamf_legacy_window_get_exec_string (window); |
93 | + char *trimmed_exec = bamf_matcher_get_trimmed_exec (self, exec_string); |
94 | + g_free (exec_string); |
95 | + |
96 | + if (trimmed_exec || win_class_name || win_instance_name) |
97 | { |
98 | - view = a->data; |
99 | - |
100 | - if (!BAMF_IS_APPLICATION (view)) |
101 | - continue; |
102 | - |
103 | - app = BAMF_APPLICATION (view); |
104 | - |
105 | - if (bamf_application_contains_similar_to_window (app, bamf_window)) |
106 | + for (a = self->priv->views; a; a = a->next) |
107 | { |
108 | - char *exec_string = bamf_legacy_window_get_exec_string (window); |
109 | - char *trimmed_exec = bamf_matcher_get_trimmed_exec (self, exec_string); |
110 | - g_free (exec_string); |
111 | - |
112 | - GList *ll; |
113 | - gboolean found_exec = FALSE; |
114 | - for (ll = bamf_view_get_children (BAMF_VIEW (app)); ll && !found_exec; ll = ll->next) |
115 | + view = a->data; |
116 | + |
117 | + if (!BAMF_IS_APPLICATION (view)) |
118 | + continue; |
119 | + |
120 | + app = BAMF_APPLICATION (view); |
121 | + |
122 | + if (bamf_application_contains_similar_to_window (app, bamf_window)) |
123 | { |
124 | - if (!BAMF_IS_WINDOW (ll->data)) |
125 | + GList *ll; |
126 | + gboolean found_exec = FALSE; |
127 | + for (ll = bamf_view_get_children (BAMF_VIEW (app)); ll && !found_exec; ll = ll->next) |
128 | + { |
129 | + if (!BAMF_IS_WINDOW (ll->data)) |
130 | + continue; |
131 | + |
132 | + BamfLegacyWindow *w = bamf_window_get_window (BAMF_WINDOW (ll->data)); |
133 | + char *wexec = bamf_legacy_window_get_exec_string (w); |
134 | + char *wtrimmed = bamf_matcher_get_trimmed_exec (self, wexec); |
135 | + g_free (wexec); |
136 | + |
137 | + if (g_strcmp0 (trimmed_exec, wtrimmed) == 0) |
138 | + { |
139 | + best = BAMF_APPLICATION (view); |
140 | + found_exec = TRUE; |
141 | + } |
142 | + |
143 | + g_free (wtrimmed); |
144 | + } |
145 | + |
146 | + if (!found_exec) |
147 | continue; |
148 | |
149 | - BamfLegacyWindow *w = bamf_window_get_window (BAMF_WINDOW (ll->data)); |
150 | - char *wexec = bamf_legacy_window_get_exec_string (w); |
151 | - char *wtrimmed = bamf_matcher_get_trimmed_exec (self, wexec); |
152 | - g_free (wexec); |
153 | - |
154 | - if (g_strcmp0 (trimmed_exec, wtrimmed) == 0) |
155 | - { |
156 | - best = BAMF_APPLICATION (view); |
157 | - found_exec = TRUE; |
158 | - } |
159 | - |
160 | - g_free (wtrimmed); |
161 | - } |
162 | - |
163 | - g_free (trimmed_exec); |
164 | - |
165 | - if (!found_exec) |
166 | - continue; |
167 | - |
168 | - app_desktop_class = bamf_application_get_wmclass (app); |
169 | - |
170 | - if (target_class && g_strcmp0 (target_class, app_desktop_class) == 0) |
171 | - { |
172 | - best = app; |
173 | - break; |
174 | - } |
175 | - else if (!best) |
176 | - { |
177 | - best = app; |
178 | + app_desktop_class = bamf_application_get_wmclass (app); |
179 | + |
180 | + if (target_class && g_strcmp0 (target_class, app_desktop_class) == 0) |
181 | + { |
182 | + best = app; |
183 | + break; |
184 | + } |
185 | + else if (!best) |
186 | + { |
187 | + best = app; |
188 | + } |
189 | } |
190 | } |
191 | } |
192 | + |
193 | + g_free (trimmed_exec); |
194 | } |
195 | |
196 | if (!best) |
197 | |
198 | === modified file 'tests/bamfdaemon/test-application.c' |
199 | --- tests/bamfdaemon/test-application.c 2013-07-16 16:20:30 +0000 |
200 | +++ tests/bamfdaemon/test-application.c 2013-07-23 22:23:24 +0000 |
201 | @@ -1098,6 +1098,84 @@ |
202 | g_object_unref (application); |
203 | } |
204 | |
205 | +static void |
206 | +test_contain_similar_to_window (void) |
207 | +{ |
208 | + BamfApplication *application; |
209 | + BamfLegacyWindowTest *lwin; |
210 | + BamfWindow *win, *win1, *win2, *win3; |
211 | + |
212 | + application = bamf_application_new (); |
213 | + lwin = bamf_legacy_window_test_new (20, "window", NULL, "binary"); |
214 | + bamf_legacy_window_test_set_wmclass (lwin, "ClassName", "ClassInstance"); |
215 | + win = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
216 | + bamf_view_add_child (BAMF_VIEW (application), BAMF_VIEW (win)); |
217 | + g_object_unref (lwin); |
218 | + |
219 | + lwin = bamf_legacy_window_test_new (30, "window1", NULL, "binary1"); |
220 | + bamf_legacy_window_test_set_wmclass (lwin, "ClassName", "ClassInstance"); |
221 | + win1 = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
222 | + g_object_unref (lwin); |
223 | + g_assert (bamf_application_contains_similar_to_window (application, win1)); |
224 | + |
225 | + lwin = bamf_legacy_window_test_new (40, "window2", NULL, "binary2"); |
226 | + bamf_legacy_window_test_set_wmclass (lwin, "ClassName", "ClassInstance2"); |
227 | + win2 = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
228 | + g_object_unref (lwin); |
229 | + g_assert (!bamf_application_contains_similar_to_window (application, win2)); |
230 | + |
231 | + lwin = bamf_legacy_window_test_new (50, "window3", NULL, "binary3"); |
232 | + bamf_legacy_window_test_set_wmclass (lwin, "ClassName3", "ClassInstance"); |
233 | + win3 = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
234 | + g_object_unref (lwin); |
235 | + g_assert (!bamf_application_contains_similar_to_window (application, win3)); |
236 | + |
237 | + g_object_unref (win); |
238 | + g_object_unref (win1); |
239 | + g_object_unref (win2); |
240 | + g_object_unref (win3); |
241 | + g_object_unref (application); |
242 | +} |
243 | + |
244 | +static void |
245 | +test_contain_similar_to_window_null (void) |
246 | +{ |
247 | + BamfApplication *application; |
248 | + BamfLegacyWindowTest *lwin; |
249 | + BamfWindow *win, *win1, *win2, *win3; |
250 | + |
251 | + application = bamf_application_new (); |
252 | + lwin = bamf_legacy_window_test_new (20, "window", NULL, "binary"); |
253 | + bamf_legacy_window_test_set_wmclass (lwin, NULL, NULL); |
254 | + win = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
255 | + bamf_view_add_child (BAMF_VIEW (application), BAMF_VIEW (win)); |
256 | + g_object_unref (lwin); |
257 | + |
258 | + lwin = bamf_legacy_window_test_new (30, "window1", NULL, "binary1"); |
259 | + bamf_legacy_window_test_set_wmclass (lwin, NULL, NULL); |
260 | + win1 = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
261 | + g_object_unref (lwin); |
262 | + g_assert (bamf_application_contains_similar_to_window (application, win1)); |
263 | + |
264 | + lwin = bamf_legacy_window_test_new (40, "window2", NULL, "binary2"); |
265 | + bamf_legacy_window_test_set_wmclass (lwin, "ClassName", NULL); |
266 | + win2 = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
267 | + g_object_unref (lwin); |
268 | + g_assert (!bamf_application_contains_similar_to_window (application, win2)); |
269 | + |
270 | + lwin = bamf_legacy_window_test_new (50, "window3", NULL, "binary3"); |
271 | + bamf_legacy_window_test_set_wmclass (lwin, NULL, "ClassInstance"); |
272 | + win3 = bamf_window_new (BAMF_LEGACY_WINDOW (lwin)); |
273 | + g_object_unref (lwin); |
274 | + g_assert (!bamf_application_contains_similar_to_window (application, win3)); |
275 | + |
276 | + g_object_unref (win); |
277 | + g_object_unref (win1); |
278 | + g_object_unref (win2); |
279 | + g_object_unref (win3); |
280 | + g_object_unref (application); |
281 | +} |
282 | + |
283 | /* Initialize test suite */ |
284 | |
285 | void |
286 | @@ -1108,6 +1186,8 @@ |
287 | gdbus_connection = connection; |
288 | |
289 | g_test_add_func (DOMAIN"/Allocation", test_allocation); |
290 | + g_test_add_func (DOMAIN"/ContainsSimilarToWindow", test_contain_similar_to_window); |
291 | + g_test_add_func (DOMAIN"/ContainsSimilarToWindow/Null", test_contain_similar_to_window_null); |
292 | g_test_add_func (DOMAIN"/Type", test_type); |
293 | g_test_add_func (DOMAIN"/Type/Set", test_type_set); |
294 | g_test_add_func (DOMAIN"/Type/Set/Invalid", test_type_set_invalid); |
295 | |
296 | === modified file 'tests/bamfdaemon/test-matcher.c' |
297 | --- tests/bamfdaemon/test-matcher.c 2013-06-25 11:16:32 +0000 |
298 | +++ tests/bamfdaemon/test-matcher.c 2013-07-23 22:23:24 +0000 |
299 | @@ -784,6 +784,95 @@ |
300 | } |
301 | |
302 | static void |
303 | +test_match_qml_app_no_desktop (void) |
304 | +{ |
305 | + BamfMatcher *matcher; |
306 | + BamfLegacyScreen *screen; |
307 | + BamfLegacyWindowTest *test_win; |
308 | + BamfApplication *app1, *app2, *app3; |
309 | + |
310 | + screen = bamf_legacy_screen_get_default (); |
311 | + matcher = bamf_matcher_get_default (); |
312 | + cleanup_matcher_tables (matcher); |
313 | + export_matcher_on_bus (matcher); |
314 | + |
315 | + guint xid = g_random_int (); |
316 | + test_win = bamf_legacy_window_test_new (xid, "QmlApp1", NULL, "qmlscene qmlapp1.qml"); |
317 | + bamf_legacy_window_test_set_wmclass (test_win, NULL, NULL); |
318 | + _bamf_legacy_screen_open_test_window (screen, test_win); |
319 | + |
320 | + app1 = bamf_matcher_get_application_by_xid (matcher, xid); |
321 | + g_assert (BAMF_IS_APPLICATION (app1)); |
322 | + |
323 | + xid = g_random_int (); |
324 | + test_win = bamf_legacy_window_test_new (xid, "QmlApp2", NULL, "qmlscene qmlapp2.qml"); |
325 | + bamf_legacy_window_test_set_wmclass (test_win, NULL, NULL); |
326 | + _bamf_legacy_screen_open_test_window (screen, test_win); |
327 | + |
328 | + app2 = bamf_matcher_get_application_by_xid (matcher, xid); |
329 | + g_assert (BAMF_IS_APPLICATION (app2)); |
330 | + g_assert (app1 != app2); |
331 | + |
332 | + xid = g_random_int (); |
333 | + test_win = bamf_legacy_window_test_new (xid, "QmlApp2", NULL, "qmlscene qmlapp2.qml"); |
334 | + bamf_legacy_window_test_set_wmclass (test_win, NULL, NULL); |
335 | + _bamf_legacy_screen_open_test_window (screen, test_win); |
336 | + |
337 | + app3 = bamf_matcher_get_application_by_xid (matcher, xid); |
338 | + g_assert (BAMF_IS_APPLICATION (app3)); |
339 | + g_assert (app2 == app3); |
340 | + |
341 | + g_object_unref (matcher); |
342 | + g_object_unref (screen); |
343 | +} |
344 | + |
345 | +static void |
346 | +test_match_qml_app_desktop (void) |
347 | +{ |
348 | + BamfMatcher *matcher; |
349 | + BamfLegacyScreen *screen; |
350 | + BamfLegacyWindowTest *test_win; |
351 | + BamfApplication *app1, *app2, *app3; |
352 | + |
353 | + screen = bamf_legacy_screen_get_default (); |
354 | + matcher = bamf_matcher_get_default (); |
355 | + cleanup_matcher_tables (matcher); |
356 | + export_matcher_on_bus (matcher); |
357 | + |
358 | + bamf_matcher_load_desktop_file (matcher, DATA_DIR"/bamf-qml-app.desktop"); |
359 | + |
360 | + guint xid = g_random_int (); |
361 | + test_win = bamf_legacy_window_test_new (xid, "QmlAppWin1", NULL, "/path/qmlscene bamf_qml_app.qml"); |
362 | + bamf_legacy_window_test_set_wmclass (test_win, NULL, NULL); |
363 | + _bamf_legacy_screen_open_test_window (screen, test_win); |
364 | + |
365 | + app1 = bamf_matcher_get_application_by_xid (matcher, xid); |
366 | + g_assert (BAMF_IS_APPLICATION (app1)); |
367 | + g_assert_cmpstr (bamf_application_get_desktop_file (app1), ==, DATA_DIR"/bamf-qml-app.desktop"); |
368 | + |
369 | + xid = g_random_int (); |
370 | + test_win = bamf_legacy_window_test_new (xid, "QmlAppWin1", NULL, "qmlscene files/foo/bamf_qml_app.qml"); |
371 | + bamf_legacy_window_test_set_wmclass (test_win, NULL, NULL); |
372 | + _bamf_legacy_screen_open_test_window (screen, test_win); |
373 | + |
374 | + app2 = bamf_matcher_get_application_by_xid (matcher, xid); |
375 | + g_assert (BAMF_IS_APPLICATION (app2)); |
376 | + g_assert (app1 == app2); |
377 | + |
378 | + xid = g_random_int (); |
379 | + test_win = bamf_legacy_window_test_new (xid, "QmlApp2", NULL, "qmlscene qmlapp2.qml"); |
380 | + bamf_legacy_window_test_set_wmclass (test_win, NULL, NULL); |
381 | + _bamf_legacy_screen_open_test_window (screen, test_win); |
382 | + |
383 | + app3 = bamf_matcher_get_application_by_xid (matcher, xid); |
384 | + g_assert (BAMF_IS_APPLICATION (app3)); |
385 | + g_assert (app2 != app3); |
386 | + |
387 | + g_object_unref (matcher); |
388 | + g_object_unref (screen); |
389 | +} |
390 | + |
391 | +static void |
392 | test_match_transient_windows (void) |
393 | { |
394 | BamfMatcher *matcher; |
395 | @@ -843,6 +932,10 @@ |
396 | g_assert_cmpstr (trimmed, ==, "bad-prefix-bin"); |
397 | g_free (trimmed); |
398 | |
399 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "gksu python very-bad-prefix-script.py"); |
400 | + g_assert_cmpstr (trimmed, ==, "very-bad-prefix-script"); |
401 | + g_free (trimmed); |
402 | + |
403 | trimmed = bamf_matcher_get_trimmed_exec (matcher, "sudo --opt val=X /usr/bin/bad-prefix-bin"); |
404 | g_assert_cmpstr (trimmed, ==, "bad-prefix-bin"); |
405 | g_free (trimmed); |
406 | @@ -859,6 +952,22 @@ |
407 | g_assert_cmpstr (trimmed, ==, "python"); |
408 | g_free (trimmed); |
409 | |
410 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/mono /usr/share/bar/Foo.exe"); |
411 | + g_assert_cmpstr (trimmed, ==, "foo.exe"); |
412 | + g_free (trimmed); |
413 | + |
414 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/mono %u --option val=/path"); |
415 | + g_assert_cmpstr (trimmed, ==, "mono"); |
416 | + g_free (trimmed); |
417 | + |
418 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/cli /usr/share/foo/Bar.exe"); |
419 | + g_assert_cmpstr (trimmed, ==, "bar.exe"); |
420 | + g_free (trimmed); |
421 | + |
422 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/cli %u --option val=/path"); |
423 | + g_assert_cmpstr (trimmed, ==, "cli"); |
424 | + g_free (trimmed); |
425 | + |
426 | trimmed = bamf_matcher_get_trimmed_exec (matcher, "sh -c \"binary --option --value %U || exec binary\""); |
427 | g_assert_cmpstr (trimmed, ==, "binary"); |
428 | g_free (trimmed); |
429 | @@ -885,6 +994,22 @@ |
430 | g_assert_cmpstr (trimmed, ==, "myprog"); |
431 | g_free (trimmed); |
432 | |
433 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "/usr/bin/qmlscene my-app.qml"); |
434 | + g_assert_cmpstr (trimmed, ==, "my-app"); |
435 | + g_free (trimmed); |
436 | + |
437 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "qmlscene /home/user/new-app.qml"); |
438 | + g_assert_cmpstr (trimmed, ==, "new-app"); |
439 | + g_free (trimmed); |
440 | + |
441 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "qmlscene $var /home/user/var-new-app.qml"); |
442 | + g_assert_cmpstr (trimmed, ==, "var-new-app"); |
443 | + g_free (trimmed); |
444 | + |
445 | + trimmed = bamf_matcher_get_trimmed_exec (matcher, "qmlscene --option -foo /home/user/opt-app.qml"); |
446 | + g_assert_cmpstr (trimmed, ==, "opt-app"); |
447 | + g_free (trimmed); |
448 | + |
449 | const char *exec = "/usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java " \ |
450 | "-Xbootclasspath/a:/usr/share/icedtea-web/netx.jar " \ |
451 | "-Xms8m -Djava.security.manager " \ |
452 | @@ -951,14 +1076,13 @@ |
453 | gdbus_connection = connection; |
454 | |
455 | g_test_add_func (DOMAIN"/Allocation", test_allocation); |
456 | + g_test_add_func (DOMAIN"/AutostartDesktopFile/User", test_autostart_desktop_file_user); |
457 | + g_test_add_func (DOMAIN"/AutostartDesktopFile/System", test_autostart_desktop_file_system); |
458 | + g_test_add_func (DOMAIN"/ExecStringTrimming", test_trim_exec_string); |
459 | g_test_add_func (DOMAIN"/LoadDesktopFile", test_load_desktop_file); |
460 | g_test_add_func (DOMAIN"/LoadDesktopFile/Autostart", test_load_desktop_file_autostart); |
461 | g_test_add_func (DOMAIN"/LoadDesktopFile/NoDisplay/SameID", test_load_desktop_file_no_display_has_lower_prio_same_id); |
462 | g_test_add_func (DOMAIN"/LoadDesktopFile/NoDisplay/DifferentID", test_load_desktop_file_no_display_has_lower_prio_different_id); |
463 | - g_test_add_func (DOMAIN"/RegisterDesktopForPid", test_register_desktop_for_pid); |
464 | - g_test_add_func (DOMAIN"/RegisterDesktopForPid/BigNumber", test_register_desktop_for_pid_big_number); |
465 | - g_test_add_func (DOMAIN"/RegisterDesktopForPid/Autostart", test_register_desktop_for_pid_autostart); |
466 | - g_test_add_func (DOMAIN"/OpenWindows", test_open_windows); |
467 | g_test_add_func (DOMAIN"/Matching/Application/DesktopLess", test_match_desktopless_application); |
468 | g_test_add_func (DOMAIN"/Matching/Application/Desktop", test_match_desktop_application); |
469 | g_test_add_func (DOMAIN"/Matching/Application/LibreOffice", test_match_libreoffice_windows); |
470 | @@ -966,9 +1090,12 @@ |
471 | g_test_add_func (DOMAIN"/Matching/Application/JavaWebStart", test_match_javaws_windows); |
472 | g_test_add_func (DOMAIN"/Matching/Application/JavaWebStart/HintIngored", test_match_javaws_windows_hint_ignored); |
473 | g_test_add_func (DOMAIN"/Matching/Application/JavaWebStart/NoDesktopMatch", test_match_javaws_windows_no_desktop_match); |
474 | + g_test_add_func (DOMAIN"/Matching/Application/Qml/NoDesktopMatch", test_match_qml_app_no_desktop); |
475 | + g_test_add_func (DOMAIN"/Matching/Application/Qml/DesktopMatch", test_match_qml_app_desktop); |
476 | g_test_add_func (DOMAIN"/Matching/Windows/UnmatchedOnNewDesktop", test_new_desktop_matches_unmatched_windows); |
477 | g_test_add_func (DOMAIN"/Matching/Windows/Transient", test_match_transient_windows); |
478 | - g_test_add_func (DOMAIN"/ExecStringTrimming", test_trim_exec_string); |
479 | - g_test_add_func (DOMAIN"/AutostartDesktopFile/User", test_autostart_desktop_file_user); |
480 | - g_test_add_func (DOMAIN"/AutostartDesktopFile/System", test_autostart_desktop_file_system); |
481 | + g_test_add_func (DOMAIN"/OpenWindows", test_open_windows); |
482 | + g_test_add_func (DOMAIN"/RegisterDesktopForPid", test_register_desktop_for_pid); |
483 | + g_test_add_func (DOMAIN"/RegisterDesktopForPid/BigNumber", test_register_desktop_for_pid_big_number); |
484 | + g_test_add_func (DOMAIN"/RegisterDesktopForPid/Autostart", test_register_desktop_for_pid_autostart); |
485 | } |
486 | |
487 | === added file 'tests/data/bamf-qml-app.desktop' |
488 | --- tests/data/bamf-qml-app.desktop 1970-01-01 00:00:00 +0000 |
489 | +++ tests/data/bamf-qml-app.desktop 2013-07-23 22:23:24 +0000 |
490 | @@ -0,0 +1,8 @@ |
491 | +[Desktop Entry] |
492 | +Name=Bamf Qml APP |
493 | +Exec=qmlscene bamf_qml_app.qml |
494 | +Icon=bamf-qml-icon |
495 | +Terminal=false |
496 | +Type=Application |
497 | +StartupNotify=true |
498 | +OnlyShowIn=GNOME;Unity; |
499 | |
500 | === added file 'tests/data/bin/qmlscene' |
FAILED: Continuous integration, rev:621 jenkins. qa.ubuntu. com/job/ bamf-ci/ 74/ jenkins. qa.ubuntu. com/job/ bamf-saucy- amd64-ci/ 55/console jenkins. qa.ubuntu. com/job/ bamf-saucy- armhf-ci/ 56/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ bamf-ci/ 74/rebuild
http://