diff options
author | Christian Dywan <christian@twotoasts.de> | 2015-04-19 14:01:00 +0000 |
---|---|---|
committer | RabbitBot <> | 2015-04-19 14:01:00 +0000 |
commit | 38f2f7ead604f5f19fb0949b8c6dd0d5b928dd8e (patch) | |
tree | 39d40c2c696f391f78ecefd200693d6d5f5ef05d /extensions | |
parent | 7ec1c4b8b533e9d75bb0fa3230cd9a4e7347ee22 (diff) | |
parent | 77e23eca5c8cc4f984799fc35ef07ba4d57586bd (diff) | |
download | midori-38f2f7ead604f5f19fb0949b8c6dd0d5b928dd8e.tar.gz |
Remove example app and .desktop before creating it in the unit test
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/apps.vala | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/extensions/apps.vala b/extensions/apps.vala index a21f85a8..16e2286d 100644 --- a/extensions/apps.vala +++ b/extensions/apps.vala @@ -527,10 +527,19 @@ public Midori.Extension extension_init () { class ExtensionsAppsDesktop : Midori.Test.Job { public static void test () { new ExtensionsAppsDesktop ().run_sync (); } public override async void run (Cancellable cancellable) throws GLib.Error { - var folder = yield Apps.Launcher.create_app ("http://example.com", "Example", null); + string uri = "http://example.com"; + string checksum = Checksum.compute_for_string (ChecksumType.MD5, uri, -1); + var apps = Apps.Launcher.get_app_folder ().get_child (checksum); + Midori.Paths.remove_path (apps.get_path ()); + + var data_dir = File.new_for_path (Midori.Paths.get_user_data_dir ()); + var desktop_dir = data_dir.get_child ("applications"); + Midori.Paths.remove_path (desktop_dir.get_child ("Example.desktop").get_path ()); + + var folder = yield Apps.Launcher.create_app (uri, "Example", null); var launcher = new Apps.Launcher (folder); launcher.init (); - Katze.assert_str_equal (folder.get_path (), launcher.uri, "http://example.com"); + Katze.assert_str_equal (folder.get_path (), launcher.uri, uri); yield Apps.Launcher.create_profile (null); } } |