~ubuntu-branches/debian/sid/gscan2pdf/sid

« back to all changes in this revision

Viewing changes to t/283_to_png_with_error.t

  • Committer: Package Import Robot
  • Author(s): Jeffrey Ratcliffe
  • Date: 2015-08-01 14:23:51 UTC
  • mfrom: (1.3.21)
  • Revision ID: package-import@ubuntu.com-20150801142351-q7lb3p93amqcevhn
Tags: 1.3.3-1
* New upstream release
  New Depends: libdata-uuid-perl
  Removed depends: liblinux-distribution-perl
* Changed perlmagick dependency to libimage-magick-perl
  Closes: #789229 (gscan2pdf depends on transition package perlmagick)

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
my $dir = File::Temp->newdir;
25
25
$slist->set_dir($dir);
26
26
 
27
 
$slist->get_file_info(
28
 
    path              => $filename,
 
27
$slist->import_files(
 
28
    paths             => [$filename],
29
29
    finished_callback => sub {
30
 
        my ($info) = @_;
31
 
        $slist->import_file(
32
 
            info              => $info,
33
 
            first             => 1,
34
 
            last              => 1,
35
 
            finished_callback => sub {
36
 
 
37
 
                # inject error before to_png
38
 
                chmod 0500, $dir;    # no write access
 
30
 
 
31
        # inject error before to_png
 
32
        chmod 0500, $dir;    # no write access
 
33
 
 
34
        $slist->to_png(
 
35
            page           => $slist->{data}[0][2],
 
36
            error_callback => sub {
 
37
                ok( 1, 'caught error injected before to_png' );
 
38
                chmod 0700, $dir;    # allow write access
39
39
 
40
40
                $slist->to_png(
41
 
                    page           => $slist->{data}[0][2],
 
41
                    page            => $slist->{data}[0][2],
 
42
                    queued_callback => sub {
 
43
 
 
44
                        # inject error during to_png
 
45
                        chmod 0500, $dir;    # no write access
 
46
                    },
42
47
                    error_callback => sub {
43
 
                        ok( 1, 'caught error injected before to_png' );
 
48
                        ok( 1, 'to_png caught error injected in queue' );
44
49
                        chmod 0700, $dir;    # allow write access
45
 
 
46
 
                        $slist->to_png(
47
 
                            page            => $slist->{data}[0][2],
48
 
                            queued_callback => sub {
49
 
 
50
 
                                # inject error during to_png
51
 
                                chmod 0500, $dir;    # no write access
52
 
                            },
53
 
                            error_callback => sub {
54
 
                                ok( 1,
55
 
                                    'to_png caught error injected in queue' );
56
 
                                chmod 0700, $dir;    # allow write access
57
 
                                Gtk2->main_quit;
58
 
                            }
59
 
                        );
60
 
 
 
50
                        Gtk2->main_quit;
61
51
                    }
62
52
                );
 
53
 
63
54
            }
64
55
        );
65
56
    }