Merge lp:~robru/libfriends/deprecate into lp:libfriends
- deprecate
- Merge into trunk
Proposed by
Robert Bruce Park
Status: | Merged |
---|---|
Merged at revision: | 45 |
Proposed branch: | lp:~robru/libfriends/deprecate |
Merge into: | lp:libfriends |
Diff against target: |
452 lines (+89/-143) 5 files modified
gtk/account.vala (+18/-4) gtk/entry.vala (+20/-14) src/service.vala (+13/-53) src/utils.vala (+0/-1) tests/vala/test-service.vala (+38/-71) |
To merge this branch: | bzr merge lp:~robru/libfriends/deprecate |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ken VanDine | Pending | ||
Review via email:
|
Commit message
Description of the change
So, I identified and fixed a bunch of warnings, but this is really just the start: the testsuite has been determined to be effectively tautological, so that needs to get fixed, and also I likely broke a bunch of other stuff too. Watch out for the FIXMEs ;-)
To post a comment you must log in.
lp:~robru/libfriends/deprecate
updated
- 50. By Robert Bruce Park
-
Fix comments.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'gtk/account.vala' | |||
2 | --- gtk/account.vala 2013-01-11 17:25:44 +0000 | |||
3 | +++ gtk/account.vala 2013-01-12 02:18:21 +0000 | |||
4 | @@ -82,8 +82,15 @@ | |||
5 | 82 | } | 82 | } |
6 | 83 | set { | 83 | set { |
7 | 84 | GLib.Value t = value; | 84 | GLib.Value t = value; |
10 | 85 | _account.set_value("friends/color", t); | 85 | try |
11 | 86 | _account.store_blocking(); | 86 | { |
12 | 87 | _account.set_value("friends/color", t); | ||
13 | 88 | _account.store_blocking(); | ||
14 | 89 | } | ||
15 | 90 | catch (Ag.AccountsError e) | ||
16 | 91 | { | ||
17 | 92 | warning (e.message); | ||
18 | 93 | } | ||
19 | 87 | } | 94 | } |
20 | 88 | } | 95 | } |
21 | 89 | 96 | ||
22 | @@ -117,8 +124,15 @@ | |||
23 | 117 | GLib.Value t = false; | 124 | GLib.Value t = false; |
24 | 118 | if (value == "1") | 125 | if (value == "1") |
25 | 119 | t = true; | 126 | t = true; |
28 | 120 | _account.set_value("friends/send_enabled", t); | 127 | try |
29 | 121 | _account.store_blocking(); | 128 | { |
30 | 129 | _account.set_value("friends/send_enabled", t); | ||
31 | 130 | _account.store_blocking(); | ||
32 | 131 | } | ||
33 | 132 | catch (Ag.AccountsError e) | ||
34 | 133 | { | ||
35 | 134 | warning (e.message); | ||
36 | 135 | } | ||
37 | 122 | } | 136 | } |
38 | 123 | } | 137 | } |
39 | 124 | 138 | ||
40 | 125 | 139 | ||
41 | === modified file 'gtk/entry.vala' | |||
42 | --- gtk/entry.vala 2013-01-11 17:25:44 +0000 | |||
43 | +++ gtk/entry.vala 2013-01-12 02:18:21 +0000 | |||
44 | @@ -124,14 +124,14 @@ | |||
45 | 124 | private Friends.Service service; | 124 | private Friends.Service service; |
46 | 125 | 125 | ||
47 | 126 | /** | 126 | /** |
49 | 127 | * The {@link Gdk.Color} for the foreground | 127 | * The {@link Gdk.RGBA} for the foreground |
50 | 128 | */ | 128 | */ |
52 | 129 | public Gdk.Color fg_color; | 129 | public Gdk.RGBA fg_color; |
53 | 130 | 130 | ||
54 | 131 | /** | 131 | /** |
56 | 132 | * The {@link Gdk.Color} for the error state | 132 | * The {@link Gdk.RGBA} for the error state |
57 | 133 | */ | 133 | */ |
59 | 134 | public Gdk.Color error_color; | 134 | public Gdk.RGBA error_color; |
60 | 135 | 135 | ||
61 | 136 | bool last_was_shortened = false; | 136 | bool last_was_shortened = false; |
62 | 137 | private string _mid = null; | 137 | private string _mid = null; |
63 | @@ -159,9 +159,13 @@ | |||
64 | 159 | Gtk.BindingEntry.add_signal (binding_set, Gdk.keyval_from_name ("Return"), 0, "submit", 0); | 159 | Gtk.BindingEntry.add_signal (binding_set, Gdk.keyval_from_name ("Return"), 0, "submit", 0); |
65 | 160 | Gtk.BindingEntry.add_signal (binding_set, Gdk.keyval_from_name ("KP_Enter"), 0, "submit", 0); | 160 | Gtk.BindingEntry.add_signal (binding_set, Gdk.keyval_from_name ("KP_Enter"), 0, "submit", 0); |
66 | 161 | Gtk.BindingEntry.add_signal (binding_set, Gdk.keyval_from_name ("Escape"), 0, "clear", 0); | 161 | Gtk.BindingEntry.add_signal (binding_set, Gdk.keyval_from_name ("Escape"), 0, "clear", 0); |
70 | 162 | fg_color = get_style ().text[Gtk.StateType.NORMAL]; | 162 | |
71 | 163 | 163 | // FIXME: How do we tell this StyleContext to get the color from the right place? | |
72 | 164 | Gdk.Color.parse ("indianred", out error_color); | 164 | Gtk.StyleContext context = new Gtk.StyleContext (); |
73 | 165 | fg_color = context.get_color (Gtk.StateFlags.NORMAL); | ||
74 | 166 | |||
75 | 167 | error_color = Gdk.RGBA (); | ||
76 | 168 | error_color.parse("indianred"); | ||
77 | 165 | 169 | ||
78 | 166 | get_buffer ().changed.connect (on_text_changed); | 170 | get_buffer ().changed.connect (on_text_changed); |
79 | 167 | get_buffer ().insert_text.connect (on_text_inserted); | 171 | get_buffer ().insert_text.connect (on_text_inserted); |
80 | @@ -245,8 +249,10 @@ | |||
81 | 245 | private void on_text_changed () | 249 | private void on_text_changed () |
82 | 246 | { | 250 | { |
83 | 247 | var chars = get_buffer ().get_char_count (); | 251 | var chars = get_buffer ().get_char_count (); |
86 | 248 | modify_fg (Gtk.StateType.NORMAL, | 252 | override_color ( |
87 | 249 | chars > MAX_MESSAGE_LENGTH ? error_color : fg_color); | 253 | Gtk.StateFlags.NORMAL, |
88 | 254 | chars > MAX_MESSAGE_LENGTH ? error_color : fg_color | ||
89 | 255 | ); | ||
90 | 250 | } | 256 | } |
91 | 251 | 257 | ||
92 | 252 | private void on_text_inserted (ref Gtk.TextIter iter, string text, int len) | 258 | private void on_text_inserted (ref Gtk.TextIter iter, string text, int len) |
93 | @@ -300,9 +306,9 @@ | |||
94 | 300 | { | 306 | { |
95 | 301 | context.translate(-1, -1); | 307 | context.translate(-1, -1); |
96 | 302 | factor = 1.0; | 308 | factor = 1.0; |
98 | 303 | } else if (get_state () == 2) { | 309 | } else if (get_state_flags () == Gtk.StateFlags.PRELIGHT) { |
99 | 304 | factor = 0.3; | 310 | factor = 0.3; |
101 | 305 | } else if (get_state () == 1) { | 311 | } else if (get_state_flags () == Gtk.StateFlags.ACTIVE) { |
102 | 306 | factor = 0.5; | 312 | factor = 0.5; |
103 | 307 | } | 313 | } |
104 | 308 | 314 | ||
105 | @@ -354,10 +360,10 @@ | |||
106 | 354 | { | 360 | { |
107 | 355 | Object (spacing:0); | 361 | Object (spacing:0); |
108 | 356 | } | 362 | } |
110 | 357 | 363 | ||
111 | 358 | /* | 364 | /* |
112 | 359 | * The {@Ag.Account.id} of the account button to be displayed | 365 | * The {@Ag.Account.id} of the account button to be displayed |
114 | 360 | * This is used in the case of replies or private messages | 366 | * This is used in the case of replies or private messages |
115 | 361 | * where the post will only go to a single account | 367 | * where the post will only go to a single account |
116 | 362 | */ | 368 | */ |
117 | 363 | public uint? selected { | 369 | public uint? selected { |
118 | @@ -490,7 +496,7 @@ | |||
119 | 490 | return account_button; | 496 | return account_button; |
120 | 491 | } | 497 | } |
121 | 492 | 498 | ||
123 | 493 | /* | 499 | /* |
124 | 494 | * Set the number of remaining characters allowed to post | 500 | * Set the number of remaining characters allowed to post |
125 | 495 | * @param chars Number of characters remaining | 501 | * @param chars Number of characters remaining |
126 | 496 | */ | 502 | */ |
127 | 497 | 503 | ||
128 | === modified file 'src/service.vala' | |||
129 | --- src/service.vala 2013-01-11 18:53:44 +0000 | |||
130 | +++ src/service.vala 2013-01-12 02:18:21 +0000 | |||
131 | @@ -236,12 +236,7 @@ | |||
132 | 236 | */ | 236 | */ |
133 | 237 | public bool retweet(uint account_id, string message_id) | 237 | public bool retweet(uint account_id, string message_id) |
134 | 238 | { | 238 | { |
141 | 239 | try { | 239 | return do("retweet", account_id.to_string(), message_id); |
136 | 240 | return do("retweet", account_id.to_string(), message_id); | ||
137 | 241 | } catch (GLib.Error e) { | ||
138 | 242 | warning (e.message); | ||
139 | 243 | } | ||
140 | 244 | return false; | ||
142 | 245 | } | 240 | } |
143 | 246 | 241 | ||
144 | 247 | /** | 242 | /** |
145 | @@ -257,12 +252,7 @@ | |||
146 | 257 | */ | 252 | */ |
147 | 258 | public bool home(uint account_id) | 253 | public bool home(uint account_id) |
148 | 259 | { | 254 | { |
155 | 260 | try { | 255 | return do("home", account_id.to_string(), ""); |
150 | 261 | return do("home", account_id.to_string(), ""); | ||
151 | 262 | } catch (GLib.Error e) { | ||
152 | 263 | warning (e.message); | ||
153 | 264 | } | ||
154 | 265 | return false; | ||
156 | 266 | } | 256 | } |
157 | 267 | 257 | ||
158 | 268 | /** | 258 | /** |
159 | @@ -279,12 +269,7 @@ | |||
160 | 279 | */ | 269 | */ |
161 | 280 | public bool wall(uint account_id) | 270 | public bool wall(uint account_id) |
162 | 281 | { | 271 | { |
169 | 282 | try { | 272 | return do("wall", account_id.to_string(), ""); |
164 | 283 | return do("wall", account_id.to_string(), ""); | ||
165 | 284 | } catch (GLib.Error e) { | ||
166 | 285 | warning (e.message); | ||
167 | 286 | } | ||
168 | 287 | return false; | ||
170 | 288 | } | 273 | } |
171 | 289 | 274 | ||
172 | 290 | /** | 275 | /** |
173 | @@ -299,15 +284,10 @@ | |||
174 | 299 | */ | 284 | */ |
175 | 300 | public bool search(uint? account_id, string query) | 285 | public bool search(uint? account_id, string query) |
176 | 301 | { | 286 | { |
186 | 302 | try { | 287 | if (account_id != null) |
187 | 303 | if (account_id != null) | 288 | return do("search", account_id.to_string(), query); |
188 | 304 | return do("search", account_id.to_string(), query); | 289 | else |
189 | 305 | else | 290 | return do("search", "", query); |
181 | 306 | return do("search", "", query); | ||
182 | 307 | } catch (GLib.Error e) { | ||
183 | 308 | warning (e.message); | ||
184 | 309 | } | ||
185 | 310 | return false; | ||
190 | 311 | } | 291 | } |
191 | 312 | 292 | ||
192 | 313 | /** | 293 | /** |
193 | @@ -322,12 +302,7 @@ | |||
194 | 322 | */ | 302 | */ |
195 | 323 | public bool like(uint account_id, string message_id) | 303 | public bool like(uint account_id, string message_id) |
196 | 324 | { | 304 | { |
203 | 325 | try { | 305 | return do("like", account_id.to_string(), message_id); |
198 | 326 | return do("like", account_id.to_string(), message_id); | ||
199 | 327 | } catch (GLib.Error e) { | ||
200 | 328 | warning (e.message); | ||
201 | 329 | } | ||
202 | 330 | return false; | ||
204 | 331 | } | 306 | } |
205 | 332 | 307 | ||
206 | 333 | /** | 308 | /** |
207 | @@ -342,12 +317,7 @@ | |||
208 | 342 | */ | 317 | */ |
209 | 343 | public bool unlike(uint account_id, string message_id) | 318 | public bool unlike(uint account_id, string message_id) |
210 | 344 | { | 319 | { |
217 | 345 | try { | 320 | return do("unlike", account_id.to_string(), message_id); |
212 | 346 | return do("unlike", account_id.to_string(), message_id); | ||
213 | 347 | } catch (GLib.Error e) { | ||
214 | 348 | warning (e.message); | ||
215 | 349 | } | ||
216 | 350 | return false; | ||
218 | 351 | } | 321 | } |
219 | 352 | 322 | ||
220 | 353 | /** | 323 | /** |
221 | @@ -362,12 +332,7 @@ | |||
222 | 362 | */ | 332 | */ |
223 | 363 | public bool delete(uint account_id, string message_id) | 333 | public bool delete(uint account_id, string message_id) |
224 | 364 | { | 334 | { |
231 | 365 | try { | 335 | return do("delete", account_id.to_string(), message_id); |
226 | 366 | return do("delete", account_id.to_string(), message_id); | ||
227 | 367 | } catch (GLib.Error e) { | ||
228 | 368 | warning (e.message); | ||
229 | 369 | } | ||
230 | 370 | return false; | ||
232 | 371 | } | 336 | } |
233 | 372 | 337 | ||
234 | 373 | /** | 338 | /** |
235 | @@ -381,12 +346,7 @@ | |||
236 | 381 | */ | 346 | */ |
237 | 382 | public bool contacts(uint account_id) | 347 | public bool contacts(uint account_id) |
238 | 383 | { | 348 | { |
245 | 384 | try { | 349 | return do("contacts", account_id.to_string(), ""); |
240 | 385 | return do("contacts", account_id.to_string(), ""); | ||
241 | 386 | } catch (GLib.Error e) { | ||
242 | 387 | warning (e.message); | ||
243 | 388 | } | ||
244 | 389 | return false; | ||
246 | 390 | } | 350 | } |
247 | 391 | 351 | ||
248 | 392 | /** | 352 | /** |
249 | @@ -413,8 +373,8 @@ | |||
250 | 413 | /** | 373 | /** |
251 | 414 | * This method returns a list of all the possible actions | 374 | * This method returns a list of all the possible actions |
252 | 415 | * supported by a given protocol. This can be used to | 375 | * supported by a given protocol. This can be used to |
255 | 416 | * determine what actions are available for the requested | 376 | * determine what actions are available for the requested |
256 | 417 | * protocol. | 377 | * protocol. |
257 | 418 | * | 378 | * |
258 | 419 | * @param protocol One of ``facebook``, ``flickr``, | 379 | * @param protocol One of ``facebook``, ``flickr``, |
259 | 420 | * ``foursquare``, ``identica``, or ``twitter``. | 380 | * ``foursquare``, ``identica``, or ``twitter``. |
260 | 421 | 381 | ||
261 | === modified file 'src/utils.vala' | |||
262 | --- src/utils.vala 2013-01-09 18:50:08 +0000 | |||
263 | +++ src/utils.vala 2013-01-12 02:18:21 +0000 | |||
264 | @@ -54,7 +54,6 @@ | |||
265 | 54 | { | 54 | { |
266 | 55 | string _avatar_cache_image = Path.build_path (Path.DIR_SEPARATOR_S, Environment.get_user_cache_dir(), "friends/avatars", GLib.Checksum.compute_for_string (GLib.ChecksumType.SHA1, url)); | 55 | string _avatar_cache_image = Path.build_path (Path.DIR_SEPARATOR_S, Environment.get_user_cache_dir(), "friends/avatars", GLib.Checksum.compute_for_string (GLib.ChecksumType.SHA1, url)); |
267 | 56 | debug ("AVATAR PATH: %s", _avatar_cache_image); | 56 | debug ("AVATAR PATH: %s", _avatar_cache_image); |
268 | 57 | var file = File.new_for_path (_avatar_cache_image); | ||
269 | 58 | return _avatar_cache_image; | 57 | return _avatar_cache_image; |
270 | 59 | } | 58 | } |
271 | 60 | } | 59 | } |
272 | 61 | 60 | ||
273 | === modified file 'tests/vala/test-service.vala' | |||
274 | --- tests/vala/test-service.vala 2013-01-09 19:41:41 +0000 | |||
275 | +++ tests/vala/test-service.vala 2013-01-12 02:18:21 +0000 | |||
276 | @@ -63,50 +63,37 @@ | |||
277 | 63 | 63 | ||
278 | 64 | internal static void test_refresh () | 64 | internal static void test_refresh () |
279 | 65 | { | 65 | { |
280 | 66 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
281 | 67 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
282 | 68 | // call is present. | ||
283 | 66 | var service = new Friends.Service (); | 69 | var service = new Friends.Service (); |
284 | 67 | bool success = false; | 70 | bool success = false; |
294 | 68 | try | 71 | service.refresh (); |
295 | 69 | { | 72 | success = true; |
287 | 70 | service.refresh (); | ||
288 | 71 | success = true; | ||
289 | 72 | } | ||
290 | 73 | catch (GLib.IOError e) | ||
291 | 74 | { | ||
292 | 75 | warning ("Failed to refresh - %s", e.message); | ||
293 | 76 | } | ||
296 | 77 | assert (success == true); | 73 | assert (success == true); |
297 | 78 | |||
298 | 79 | } | 74 | } |
299 | 80 | 75 | ||
300 | 81 | internal static void test_quit () | 76 | internal static void test_quit () |
301 | 82 | { | 77 | { |
302 | 78 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
303 | 79 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
304 | 80 | // call is present. | ||
305 | 83 | var service = new Friends.Service (); | 81 | var service = new Friends.Service (); |
306 | 84 | bool success = false; | 82 | bool success = false; |
316 | 85 | try | 83 | service.quit (); |
317 | 86 | { | 84 | success = true; |
309 | 87 | service.quit (); | ||
310 | 88 | success = true; | ||
311 | 89 | } | ||
312 | 90 | catch (GLib.IOError e) | ||
313 | 91 | { | ||
314 | 92 | warning ("Failed to shutdown - %s", e.message); | ||
315 | 93 | } | ||
318 | 94 | assert (success == true); | 85 | assert (success == true); |
319 | 95 | 86 | ||
320 | 96 | } | 87 | } |
321 | 97 | 88 | ||
322 | 98 | internal static void test_features () | 89 | internal static void test_features () |
323 | 99 | { | 90 | { |
324 | 91 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
325 | 92 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
326 | 93 | // call is present. | ||
327 | 100 | var service = new Friends.Service (); | 94 | var service = new Friends.Service (); |
328 | 101 | string[] features; | 95 | string[] features; |
337 | 102 | try | 96 | features = service.features ("twitter"); |
330 | 103 | { | ||
331 | 104 | features = service.features ("twitter"); | ||
332 | 105 | } | ||
333 | 106 | catch (GLib.IOError e) | ||
334 | 107 | { | ||
335 | 108 | warning ("Failed to get features - %s", e.message); | ||
336 | 109 | } | ||
338 | 110 | assert ("send" in features); | 97 | assert ("send" in features); |
339 | 111 | } | 98 | } |
340 | 112 | 99 | ||
341 | @@ -129,87 +116,67 @@ | |||
342 | 129 | 116 | ||
343 | 130 | internal static void test_send_message () | 117 | internal static void test_send_message () |
344 | 131 | { | 118 | { |
345 | 119 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
346 | 120 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
347 | 121 | // call is present. | ||
348 | 132 | var service = new Friends.Service (); | 122 | var service = new Friends.Service (); |
349 | 133 | uint? acct = null; | 123 | uint? acct = null; |
350 | 134 | string msg = "A message"; | 124 | string msg = "A message"; |
351 | 135 | bool success = false; | 125 | bool success = false; |
361 | 136 | try | 126 | service.send_message (acct, msg); |
362 | 137 | { | 127 | success = true; |
354 | 138 | service.send_message (acct, msg); | ||
355 | 139 | success = true; | ||
356 | 140 | } | ||
357 | 141 | catch (GLib.IOError e) | ||
358 | 142 | { | ||
359 | 143 | warning ("Failed to SendMessage - %s", e.message); | ||
360 | 144 | } | ||
363 | 145 | assert (success == true); | 128 | assert (success == true); |
364 | 146 | } | 129 | } |
365 | 147 | 130 | ||
366 | 148 | internal static void test_send_message_with_account () | 131 | internal static void test_send_message_with_account () |
367 | 149 | { | 132 | { |
368 | 133 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
369 | 134 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
370 | 135 | // call is present. | ||
371 | 150 | var service = new Friends.Service (); | 136 | var service = new Friends.Service (); |
372 | 151 | uint acct = 1; | 137 | uint acct = 1; |
373 | 152 | string msg = "A message"; | 138 | string msg = "A message"; |
374 | 153 | bool success = false; | 139 | bool success = false; |
384 | 154 | try | 140 | service.send_message (acct, msg); |
385 | 155 | { | 141 | success = true; |
377 | 156 | service.send_message (acct, msg); | ||
378 | 157 | success = true; | ||
379 | 158 | } | ||
380 | 159 | catch (GLib.IOError e) | ||
381 | 160 | { | ||
382 | 161 | warning ("Failed to SendMessage - %s", e.message); | ||
383 | 162 | } | ||
386 | 163 | assert (success == true); | 142 | assert (success == true); |
387 | 164 | } | 143 | } |
388 | 165 | 144 | ||
389 | 166 | internal static void test_send_reply () | 145 | internal static void test_send_reply () |
390 | 167 | { | 146 | { |
391 | 147 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
392 | 148 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
393 | 149 | // call is present. | ||
394 | 168 | var service = new Friends.Service (); | 150 | var service = new Friends.Service (); |
395 | 169 | uint acct = 1; | 151 | uint acct = 1; |
396 | 170 | string msg = "A message"; | 152 | string msg = "A message"; |
397 | 171 | string msg_id = "100"; | 153 | string msg_id = "100"; |
398 | 172 | bool success = false; | 154 | bool success = false; |
408 | 173 | try | 155 | service.send_reply (acct, msg_id, msg); |
409 | 174 | { | 156 | success = true; |
401 | 175 | service.send_reply (acct, msg_id, msg); | ||
402 | 176 | success = true; | ||
403 | 177 | } | ||
404 | 178 | catch (GLib.IOError e) | ||
405 | 179 | { | ||
406 | 180 | warning ("Failed to SendReply - %s", e.message); | ||
407 | 181 | } | ||
410 | 182 | assert (success == true); | 157 | assert (success == true); |
411 | 183 | } | 158 | } |
412 | 184 | 159 | ||
413 | 185 | internal static void test_clear_indicators () | 160 | internal static void test_clear_indicators () |
414 | 186 | { | 161 | { |
415 | 162 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
416 | 163 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
417 | 164 | // call is present. | ||
418 | 187 | var service = new Friends.Service (); | 165 | var service = new Friends.Service (); |
419 | 188 | bool success = false; | 166 | bool success = false; |
429 | 189 | try | 167 | service.messaging_menu_clear (); |
430 | 190 | { | 168 | success = true; |
422 | 191 | service.messaging_menu_clear (); | ||
423 | 192 | success = true; | ||
424 | 193 | } | ||
425 | 194 | catch (GLib.IOError e) | ||
426 | 195 | { | ||
427 | 196 | warning ("Failed to clear indicators - %s", e.message); | ||
428 | 197 | } | ||
431 | 198 | assert (success == true); | 169 | assert (success == true); |
432 | 199 | } | 170 | } |
433 | 200 | 171 | ||
434 | 201 | internal static void test_url_shorten () | 172 | internal static void test_url_shorten () |
435 | 202 | { | 173 | { |
436 | 174 | // https://bugs.launchpad.net/libfriends/+bug/1098773 | ||
437 | 175 | // FIXME: Need to capture STDOUT and ensure correct DBus | ||
438 | 176 | // call is present. | ||
439 | 203 | var service = new Friends.Service (); | 177 | var service = new Friends.Service (); |
440 | 204 | string result = ""; | 178 | string result = ""; |
449 | 205 | try | 179 | result = service.shorten ("http://example.com/really/really/long"); |
442 | 206 | { | ||
443 | 207 | result = service.shorten ("http://example.com/really/really/long"); | ||
444 | 208 | } | ||
445 | 209 | catch (GLib.IOError e) | ||
446 | 210 | { | ||
447 | 211 | warning ("Failed to shorten URL - %s", e.message); | ||
448 | 212 | } | ||
450 | 213 | assert (result == "http://is.gd/short"); | 180 | assert (result == "http://is.gd/short"); |
451 | 214 | } | 181 | } |
452 | 215 | } | 182 | } |