Merge lp:~midori/midori/deleteExampleBeforeTest into lp:midori

Proposed by Cris Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6933
Merged at revision: 6937
Proposed branch: lp:~midori/midori/deleteExampleBeforeTest
Merge into: lp:midori
Diff against target: 25 lines (+11/-2)
1 file modified
extensions/apps.vala (+11/-2)
To merge this branch: bzr merge lp:~midori/midori/deleteExampleBeforeTest
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+256744@code.launchpad.net

Commit message

Remove example app and .desktop before creating it in the unit test

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'extensions/apps.vala'
2--- extensions/apps.vala 2015-03-16 15:43:33 +0000
3+++ extensions/apps.vala 2015-04-18 20:07:02 +0000
4@@ -527,10 +527,19 @@
5 class ExtensionsAppsDesktop : Midori.Test.Job {
6 public static void test () { new ExtensionsAppsDesktop ().run_sync (); }
7 public override async void run (Cancellable cancellable) throws GLib.Error {
8- var folder = yield Apps.Launcher.create_app ("http://example.com", "Example", null);
9+ string uri = "http://example.com";
10+ string checksum = Checksum.compute_for_string (ChecksumType.MD5, uri, -1);
11+ var apps = Apps.Launcher.get_app_folder ().get_child (checksum);
12+ Midori.Paths.remove_path (apps.get_path ());
13+
14+ var data_dir = File.new_for_path (Midori.Paths.get_user_data_dir ());
15+ var desktop_dir = data_dir.get_child ("applications");
16+ Midori.Paths.remove_path (desktop_dir.get_child ("Example.desktop").get_path ());
17+
18+ var folder = yield Apps.Launcher.create_app (uri, "Example", null);
19 var launcher = new Apps.Launcher (folder);
20 launcher.init ();
21- Katze.assert_str_equal (folder.get_path (), launcher.uri, "http://example.com");
22+ Katze.assert_str_equal (folder.get_path (), launcher.uri, uri);
23 yield Apps.Launcher.create_profile (null);
24 }
25 }

Subscribers

People subscribed via source and target branches

to all changes: