File Coverage

blib/lib/Duadua/Parser/Browser/MicrosoftInternetExplorer.pm
Criterion Covered Total %
statement 30 30 100.0
branch 17 22 77.2
condition 9 15 60.0
subroutine 4 4 100.0
pod 1 1 100.0
total 61 72 84.7


line stmt bran cond sub pod time code
1             package Duadua::Parser::Browser::MicrosoftInternetExplorer;
2 11     11   1278 use strict;
  11         23  
  11         439  
3 11     11   65 use warnings;
  11         21  
  11         517  
4 11     11   51 use Duadua::Util qw//;
  11         22  
  11         5717  
5              
6             sub try {
7 432     432 1 1085 my ($class, $d) = @_;
8              
9 432 100       1187 return if $d->_contain('http');
10 255 100       737 return if $d->_contain(' BingPreview');
11              
12 251 50 66     710 if ( $d->_contain('MSIE ') && $d->_contain_mozilla && $d->_contain('Windows ') ) {
      66        
13 16         67 my $h = {
14             name => 'Internet Explorer',
15             is_windows => 1,
16             };
17              
18 16 100       42 if ($d->opt_version) {
19 8         30 my ($version) = ($d->ua =~ m! MSIE ([\d.]+); !);
20 8 50       41 $h->{version} = $version if $version;
21             }
22              
23 16         69 return $h;
24             }
25              
26 235 50 66     600 if ( $d->_contain('Trident/') && $d->_contain(' rv:1') && $d->_contain_mozilla && $d->_contain('Windows ') ) {
      66        
      33        
27 14         65 my $h = {
28             name => 'Internet Explorer',
29             is_windows => 1,
30             };
31              
32 14 100       46 if ($d->opt_version) {
33 7         22 my ($version) = ($d->ua =~ m! rv:([\d.]+)!);
34 7 50       36 $h->{version} = $version if $version;
35             }
36              
37 14         59 return $h;
38             }
39              
40 221 100       580 if ( $d->_contain('Windows-RSS-Platform/') ) {
41 2         9 my $h = {
42             name => 'Windows RSS Platform',
43             };
44              
45 2 100       8 if ($d->opt_version) {
46 1         5 my ($version) = ($d->ua =~ m!^Windows-RSS-Platform/([\d.]+)!);
47 1 50       7 $h->{version} = $version if $version;
48             }
49              
50 2         12 return Duadua::Util->set_os($d, $h);
51             }
52             }
53              
54             1;
55              
56             __END__