Skip to content

Commit

Permalink
Improving test coverage for certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
david-dick committed Sep 7, 2024
1 parent cb9109d commit 09ee498
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Firefox/Marionette.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4204,7 +4204,7 @@ _JS_
$self->_context($old);
my @certificates;
foreach my $certificate ( @{$certificates} ) {
push @certificates, Firefox::Marionette::Certificate->new($certificate);
push @certificates, Firefox::Marionette::Certificate->new(%{$certificate});
}
return @certificates;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Firefox/Marionette/Certificate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ our $VERSION = '1.60';
sub _NUMBER_OF_MICROSECOND_DIGITS { return -6 }

sub new {
my ( $class, $parameters ) = @_;
my ( $class, %parameters ) = @_;

my $self = bless { %{$parameters} }, $class;
my $self = bless { %parameters }, $class;
return $self;
}

Expand Down
2 changes: 2 additions & 0 deletions t/01-marionette.t
Original file line number Diff line number Diff line change
Expand Up @@ -4823,6 +4823,8 @@ SKIP: {
$firefox->script(qq[alert('$alert_text')]);
ok($firefox->accept_alert(), "\$firefox->accept_alert() accepts alert box");
}
my $certificate = Firefox::Marionette::Certificate->new();
ok(!$certificate->is_server_cert(), "Firefox::Marionette::Certificate->new() does not produce a server cert (test coverage)");
my @certificates;
eval { @certificates = $firefox->certificates(); };
SKIP: {
Expand Down

0 comments on commit 09ee498

Please sign in to comment.