~midori/midori/trunk

« back to all changes in this revision

Viewing changes to extensions/apps.vala

  • Committer: RabbitBot
  • Author(s): Christian Dywan
  • Date: 2015-04-19 14:01:00 UTC
  • mfrom: (6932.3.1 midori.trunks)
  • Revision ID: rabbitbot-20150419140100-s5k16qzwv63gm15g
Remove example app and .desktop before creating it in the unit test

Show diffs side-by-side

added added

removed removed

Lines of Context:
527
527
class ExtensionsAppsDesktop : Midori.Test.Job {
528
528
    public static void test () { new ExtensionsAppsDesktop ().run_sync (); }
529
529
    public override async void run (Cancellable cancellable) throws GLib.Error {
530
 
        var folder = yield Apps.Launcher.create_app ("http://example.com", "Example", null);
 
530
        string uri = "http://example.com";
 
531
        string checksum = Checksum.compute_for_string (ChecksumType.MD5, uri, -1);
 
532
        var apps = Apps.Launcher.get_app_folder ().get_child (checksum);
 
533
        Midori.Paths.remove_path (apps.get_path ());
 
534
 
 
535
        var data_dir = File.new_for_path (Midori.Paths.get_user_data_dir ());
 
536
        var desktop_dir = data_dir.get_child ("applications");
 
537
        Midori.Paths.remove_path (desktop_dir.get_child ("Example.desktop").get_path ());
 
538
 
 
539
        var folder = yield Apps.Launcher.create_app (uri, "Example", null);
531
540
        var launcher = new Apps.Launcher (folder);
532
541
        launcher.init ();
533
 
        Katze.assert_str_equal (folder.get_path (), launcher.uri, "http://example.com");
 
542
        Katze.assert_str_equal (folder.get_path (), launcher.uri, uri);
534
543
        yield Apps.Launcher.create_profile (null);
535
544
    }
536
545
}