From db0c4625f1f39da790fab18e5f1734ab7e6d9b02 Mon Sep 17 00:00:00 2001 From: Jason Carty Date: Mon, 21 Sep 2020 16:28:49 +0200 Subject: [PATCH 1/2] Typo change, removing unused variables --- lib/WWW/WebKit2.pm | 13 ++++++++++--- lib/WWW/WebKit2/Inspector.pm | 6 +++--- lib/WWW/WebKit2/Locator.pm | 2 +- t/events.t | 1 - t/logging.t | 2 +- t/test/keyboard.html | 3 +-- 6 files changed, 16 insertions(+), 11 deletions(-) diff --git a/lib/WWW/WebKit2.pm b/lib/WWW/WebKit2.pm index 7b246d1..c6063b2 100644 --- a/lib/WWW/WebKit2.pm +++ b/lib/WWW/WebKit2.pm @@ -425,6 +425,13 @@ sub process_events { Gtk3::main_iteration_do(0) while Gtk3::events_pending; } +=head2 process_page_load + +No parameters needed. +Method attempts to ensure the page has finished loading. This handling is primailary based on checking if GTK3 has any events pending + +=cut + sub process_page_load { my ($self) = @_; @@ -557,11 +564,11 @@ sub DESTROY { =head1 SEE ALSO See L for API documentation. -See L for a replacement for L. -See L for a replacement for L. +See L for a replacement for L. +See L for a replacement for L. The current development version can be found in the git repository at: -https://github.com/jscarty/WWW-WebKit2 +https://github.com/sorryforthecommit/WWW-WebKit2 =head1 AUTHOR diff --git a/lib/WWW/WebKit2/Inspector.pm b/lib/WWW/WebKit2/Inspector.pm index d58ac13..ffb0cc3 100644 --- a/lib/WWW/WebKit2/Inspector.pm +++ b/lib/WWW/WebKit2/Inspector.pm @@ -15,7 +15,7 @@ sub run_javascript { my $js_result = ''; $self->view->run_javascript("(function () {$javascript_string})()", undef, sub { - my ($object, $result, $user_data) = @_; + my ($object, $result) = @_; $done = 1; $js_result = $self->get_javascript_result($result, $raw, $javascript_string); }, undef); @@ -63,7 +63,7 @@ sub resolve_locator { $locator =~ s/'/\\'/g; - if (my ($css) = $locator =~ /^css=(.*)/) { + if ($locator =~ /^css=(.*)/) { return WWW::WebKit2::LocatorCSS->new({ locator_string => $locator, inspector => $self, @@ -113,7 +113,7 @@ sub get_html_source { return '' unless $resource; $resource->get_data(undef, sub { - my ($resource, $result, $user_data) = @_; + my ($resource, $result) = @_; $html_source = $resource->get_data_finish($result); $done = 1; diff --git a/lib/WWW/WebKit2/Locator.pm b/lib/WWW/WebKit2/Locator.pm index 4d10a2c..25707c7 100644 --- a/lib/WWW/WebKit2/Locator.pm +++ b/lib/WWW/WebKit2/Locator.pm @@ -361,7 +361,7 @@ sub fire_event { =cut sub is_visible { - my ($self, $attribute) = @_; + my ($self) = @_; my $search = $self->prepare_element; diff --git a/t/events.t b/t/events.t index 92bea12..3da378a 100644 --- a/t/events.t +++ b/t/events.t @@ -69,7 +69,6 @@ $webkit->wait_for_alert("blurred", 100); my $httpd = Test::Fake::HTTPD->new; $httpd->run(sub { - my $req = shift; return [ 200, [ 'Content-Type', 'text/html' ], [ read_text("$Bin/test/events.html") ] ]; }); diff --git a/t/logging.t b/t/logging.t index 6b2efbe..86ccccf 100644 --- a/t/logging.t +++ b/t/logging.t @@ -47,7 +47,7 @@ $webkit = WWW::WebKit2->new( ); $file = $webkit->write_log('another test'); -ok(-d "$dir/logs", 'log folder creted'); +ok(-d "$dir/logs", 'log folder created'); is(read_text($file), 'another test', 'log file written'); $webkit->open("$Bin/test/load.html"); diff --git a/t/test/keyboard.html b/t/test/keyboard.html index d691e53..171b168 100644 --- a/t/test/keyboard.html +++ b/t/test/keyboard.html @@ -3,7 +3,6 @@ events