File Coverage

blib/lib/HTML/WidgetValidator/Widget/GoogleAdSense.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package HTML::WidgetValidator::Widget::GoogleAdSense;
2 1     1   7 use base qw(HTML::WidgetValidator::Widget);
  1         2  
  1         85  
3 1     1   6 use warnings;
  1         3  
  1         26  
4 1     1   5 use strict;
  1         3  
  1         38  
5 1     1   6 use Carp;
  1         2  
  1         475  
6            
7             __PACKAGE__->name('Google AdSense');
8             __PACKAGE__->url('https://www.google.com/adsense/');
9             __PACKAGE__->models([
10             [ { type=>'start', name=>'script',
11             attr => { type => 'text/javascript', }, },
12             { type=>'text', text=> qr{\s*<\!\-\-\s+(?:google_ad_client\s*=\s*"pub\-[\d]+";\s*|google_alternate_ad_url\s*=\s*"[^"<>]+";\s*|google_alternate_color\s*=\s*"[0-9A-Fa-f]{6}";\s*|google_ad_width\s*=\s*\d+;\s*|google_ad_height\s*=\s*\d+;\s*|google_ad_format\s*=\s*"\d+x\d+_(?:as|0ads_al|0ads_al_s)";\s*|google_ad_type\s*=\s*"(?:text|image|text_image)";\s*|google_ad_channel\s*=\s*"[\w\-\_]*";\s*|google_color_border\s*=\s*"[0-9A-Fa-f]{6}";\s*|google_color_bg\s*=\s*"[0-9A-Fa-f]{6}";\s*|google_color_link\s*=\s*"[0-9A-Fa-f]{6}";\s*|google_color_text\s*=\s*"[0-9A-Fa-f]{6}";\s*|google_color_url\s*=\s*"[0-9A-Fa-f]{6}";\s*|google_ui_features\s*=\s*"rc:\d+";\s*|google_cpa_choice\s*=\s*"[0-9A-Za-z]+";\s*|\/\/\d\d\d\d-\d\d-\d\d:\s+\w+\s+)+\s*\/\/-->\s*} },
13             { type => 'end', name=>'script' } ],
14             [ { type => 'start', name=>'script',
15             attr => {
16             type => 'text/javascript',
17             src => 'http://pagead2.googlesyndication.com/pagead/show_ads.js',
18             }},
19             { type => 'end', name=>'script' } ],
20             ]);
21            
22             1;
23             __END__