Branch Coverage

blib/lib/WWW/Mechanize/Firefox.pm
Criterion Covered Total %
branch 3 404 0.7


line true false branch
185 60 0 unless (ref $args{'app'})
187 3 357 exists $args{$_} ? :
194 0 0 if (my $tabname = delete $args{'tab'})
195 0 0 if (not ref $tabname) { }
0 0 elsif ('MozRepl::RemoteObject::Instance' eq ref $tabname) { }
196 0 0 if ($tabname eq 'current') { }
208 0 0 if (not $args{'tab'}) { }
209 0 0 if (not delete $args{'create'}) { }
219 0 0 unless ($args{'tab'})
220 0 0 exists $args{'autoclose'} ? :
226 0 0 if (delete $args{'autoclose'})
229 0 0 unless (exists $args{'autodie'})
240 0 0 unless (exists $args{'frames'})
245 0 0 unless $args{'tab'}
247 0 0 if (delete $args{'activate'})
262 0 0 if (defined $agent)
272 0 0 if (my $app = delete $self->{'app'})
296 0 0 if (defined $name) { }
0 0 elsif ($name eq '') { }
311 0 0 if @_ == 2
327 0 0 if @_ > 1
344 0 0 if @_ > 1
417 0 0 if (my $opt_js = $WWW::Mechanize::Firefox::known_options{$opt}) { }
523 0 0 if (keys %$env)
678 0 0 if $_[0]->bridge
757 0 0 if $style->{'display'} eq 'none'
808 0 0 if ($options{'no_cache'})
811 0 0 unless (exists $options{'synchronize'})
814 0 0 unless (ref $options{'synchronize'})
816 0 0 $options{'synchronize'} ? :
821 0 0 if (my $target = delete $options{':content_file'}) { }
895 0 0 if ($options{'no_cache'})
898 0 0 unless (exists $options{'synchronize'})
901 0 0 unless (ref $options{'synchronize'})
903 0 0 $options{'synchronize'} ? :
908 0 0 unless ($options{'data'})
916 0 0 if ($options{'charset'})
1050 0 0 if ($self->{'custom_header_observer'} and @headers)
1191 0 0 if (@args <= 2 and ref $args[0] eq 'MozRepl::RemoteObject::Instance')
1196 0 0 unless ref $_->[1]
1251 0 0 if $i == 30
1253 0 0 if ((my $s = $element->{'busy'} || 0) < 1)
1354 0 0 if ($STATE_STOP == $flags or ($flags & ($STATE_STOP | $STATE_IS_DOCUMENT)) == ($STATE_STOP | $STATE_IS_DOCUMENT))
1356 0 0 if ($status == 0) { }
1382 0 0 if (ref $events and ref $events eq 'CODE')
1387 0 0 unless ref $events
1399 0 0 if (my $h = $self->{'on_event'})
1400 0 0 if (ref $h eq 'CODE') { }
1415 0 0 if ($need_response)
1445 0 0 if ($options{'headers'})
1464 0 0 unless (exists $options{'headers'})
1470 0 0 if (my $js_res = $self->{'response'})
1476 0 0 if ($ouri)
1480 0 0 if ($scheme and $scheme =~ /^https?/) { }
0 0 elsif ($scheme and $scheme =~ /^(file|data|about)\b/) { }
1496 0 0 if ($eff_url =~ /^about:neterror/)
1521 0 0 if $res
1556 0 0 if ($bypass_cache)
1569 0 0 if (@$events) { }
1589 0 0 unless (ref $synchronize)
1590 0 0 $synchronize ? :
1613 0 0 unless (ref $synchronize)
1614 0 0 $synchronize ? :
1710 0 0 if ($format eq 'html') { }
0 0 elsif ($format eq 'text') { }
1720 0 0 unless (utf8::is_utf8($content))
1831 0 0 unless (-f $localname)
1832 0 0 unless open my $fh, '>', $localname
1836 0 0 if ($resource_directory)
1840 0 0 unless (-d $resource_directory)
1841 0 0 unless mkdir $resource_directory
1922 0 0 unless (-f $localname)
1923 0 0 unless open my $fh, '>', $localname
1928 0 0 unless ($options{'progress'})
1934 0 0 if ($res->{'currentState'} == $STATE_FINISHED)
2029 0 0 if $options{'wait'}
2051 0 0 if $base
2129 0 0 unless (exists $WWW::Mechanize::Firefox::link_spec{$tag})
2134 0 0 if ($tag eq 'meta')
2136 0 0 if ($content =~ /^\d+\s*;\s*url\s*=\s*(\S+)/i) { }
2138 0 0 unless $url =~ s/^"(.+)"$/$1/
2145 0 0 if (defined $url) { }
2173 0 0 if ($self->{'autodie'}) { }
2183 0 0 if ($self->{'autodie'}) { }
2184 0 0 if (not $self->status =~ /^2/)
2280 0 0 unless (grep {exists $options->{$_};} 'single', 'one', 'maybe', 'all', 'any')
2288 0 0 unless $WWW::Mechanize::Firefox::xpath_quote{$1}
2308 0 0 if (exists $opts{$_})
2315 0 0 if ($single and exists $opts{'n'})
2319 0 0 if $n ne 'all'
2338 0 0 if length $op
2341 0 0 if (exists $opts{$key})
2348 0 0 if (my $p = delete $opts{'url'})
2352 0 0 if (my $p = delete $opts{'tag'})
2355 0 0 if (my $p = delete $opts{'tag_regex'})
2362 0 0 if (@full) { }
2372 0 0 if (keys %opts)
2383 0 0 if ($one)
2384 0 0 if (0 == @res)
2385 0 0 if ($single)
2386 0 0 if (1 < @res)
2395 0 0 if ($n eq 'all')
2419 0 0 if 'all' eq ($opts{'n'} || '')
2420 0 0 if (my $link = $self->find_link_dom('frames', 0, %opts)) { }
2449 0 0 if wantarray
2472 0 0 if wantarray
2493 0 0 if (@_ == 2) { }
2618 0 0 unless (exists $options{'all'} or $return_first_element)
2619 0 0 if defined wantarray and not wantarray
2637 0 0 $_->{'resultType'} == $self->{'XpathResultTypes'}{'ORDERED_NODE_SNAPSHOT_TYPE'} || $_->{'resultType'} == $self->{'XpathResultTypes'}{'UNORDERED_NODE_SNAPSHOT_TYPE'} || $_->{'resultType'} == $self->{'XpathResultTypes'}{'ORDERED_NODE_ITERATOR_TYPE'} || $_->{'resultType'} == $self->{'XpathResultTypes'}{'UNORDERED_NODE_ITERATOR_TYPE'} ? :
0 0 !defined($_->{'resultType'}) ? :
2645 0 0 if (not $zero_allowed and @res == 0)
2650 0 0 if (not $two_allowed and @res > 1)
2656 0 0 $return_first_element ? :
2711 0 0 if ('ARRAY' ne (ref $query || ''))
2715 0 0 if ($options{'node'}) { }
2730 0 0 unless (wantarray)
2736 0 0 unless (exists $options{'frames'})
2810 0 0 if (@res and $options{'return_first'} and grep {$_->{'resultSize'};} @res)
2815 0 0 if ($options{'frames'} and not $options{'node'})
2846 0 0 if ('ARRAY' ne (ref $query || ''))
2849 0 0 $options{'node'} ? :
2873 0 0 if ('ARRAY' ne (ref $query || ''))
2960 0 0 if (not defined $name) { }
0 0 elsif (ref $name and &blessed($name) and $name->can('__click')) { }
0 0 elsif (ref $name eq 'HASH') { }
2969 0 0 if (exists $options{'name'})
2974 0 0 if ($options{'name'} eq '')
2982 0 0 if (not exists $options{'synchronize'}) { }
0 0 elsif (not ref $options{'synchronize'}) { }
2986 0 0 $options{'synchronize'} ? :
2990 0 0 if ($options{'dom'}) { }
3002 0 0 if (defined wantarray)
3050 0 0 if (exists $options{'input'}) { }
0 0 elsif (exists $options{'name'}) { }
0 0 elsif (exists $options{'value'}) { }
0 0 elsif (exists $options{'id'}) { }
0 0 elsif (exists $options{'number'}) { }
3074 0 0 if ($node) { }
3197 0 0 if (ref $fields[0] eq 'HASH')
3232 0 0 wantarray ? :
3293 0 0 if (@_ == 3) { }
3326 0 0 if ($name =~ s/^\^//) { }
0 0 elsif ($name =~ s/^#//) { }
0 0 elsif ($name =~ s/^\.//) { }
3333 0 0 if (&blessed($name)) { }
3355 0 0 unless ref $pre
3357 0 0 unless ref $post
3360 0 0 if ($fields[0]) { }
3362 0 0 if ($set_value)
3367 0 0 if ('select' eq $tag) { }
3380 0 0 unless defined wantarray
3384 0 0 if ('SELECT' eq uc $tag) { }
3387 0 0 if (wantarray) { }
3430 0 0 unless ($field)
3440 0 0 if ('HASH' eq ref $value or '') { }
0 0 elsif ('ARRAY' eq ref $value or '') { }
3442 0 0 unless $_ eq 'n'
3447 0 0 ref $value->{'n'} ? :
3456 0 0 if ($deselect)
3462 0 0 if ($single)
3464 0 0 0 + @by_index ? :
3465 0 0 0 + @by_value ? :
3501 0 0 if @_ < 4
3506 0 0 if (not defined $name) { }
0 0 elsif (ref $name and &blessed($name) and $name->can('__click')) { }
0 0 elsif (ref $name eq 'HASH') { }
3516 0 0 if (exists $options{'name'})
3518 0 0 if ($name =~ s/^\^//) { }
0 0 elsif ($name =~ s/^#//) { }
0 0 elsif ($name =~ s/^\.//) { }
3526 0 0 if $value
3530 0 0 defined $value ? :
3534 0 0 defined $value ? :
3539 0 0 if ($options{'dom'}) { }
3547 0 0 if ($set xor $is_set)
3548 0 0 if ($set) { }
3587 0 0 if ($dom_form) { }
3649 0 0 unless ($form)
3650 0 0 if ($fields = delete $options{'with_fields'}) { }
3653 0 0 unless ($form)
3663 0 0 unless ($form)
3689 0 0 unless ($f)
3701 0 0 if (ref $v)
3703 0 0 unless $num == 1
3737 0 0 if ($form)
3748 0 0 if (@values > @visible_fields) { }
3796 0 0 if (2 == @_) { }
3802 0 0 unless ($options{'dom'})
3807 0 0 unless $options{'dom'}
3894 0 0 if (2 == @_) { }
3906 0 0 if ($timeout)
3913 0 0 unless ($node)
3917 0 0 unless $node
3921 0 0 if ($node and time >= $timeout_after)
3939 0 0 if (exists $options{$meth})
3945 0 0 unless $method
3982 0 0 ref $spec ? :
3985 0 0 if (not ref $spec || $spec =~ /\D/ and $spec == 1)
3992 0 0 if (not grep({ref $_;} @spec)) { }
4002 0 0 ref $_ ? :
4127 0 0 $scr ? :