webkit2-gtk 3.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ ruby_gnome2_base = File.join(File.dirname(__FILE__), "..", "..")
20
+ ruby_gnome2_base = File.expand_path(ruby_gnome2_base)
21
+
22
+ glib_base = File.join(ruby_gnome2_base, "glib2")
23
+ gio_base = File.join(ruby_gnome2_base, "gio2")
24
+ atk_base = File.join(ruby_gnome2_base, "atk")
25
+ pango_base = File.join(ruby_gnome2_base, "pango")
26
+ gdk_pixbuf_base = File.join(ruby_gnome2_base, "gdk_pixbuf2")
27
+ gdk3_base = File.join(ruby_gnome2_base, "gdk3")
28
+ gtk3_base = File.join(ruby_gnome2_base, "gtk3")
29
+ gobject_introspection_base = File.join(ruby_gnome2_base, "gobject-introspection")
30
+ cairo_gobject_base = File.join(ruby_gnome2_base, "cairo-gobject")
31
+ webkit2_gtk_base = File.join(ruby_gnome2_base, "webkit2-gtk")
32
+
33
+ modules = [
34
+ [glib_base, "glib2"],
35
+ [gio_base, "gio2"],
36
+ [atk_base, "atk"],
37
+ [pango_base, "pango"],
38
+ [gdk_pixbuf_base, "gdk_pixbuf2"],
39
+ [gdk3_base, "gdk3"],
40
+ [gtk3_base, "gtk3"],
41
+ [gobject_introspection_base, "gobject-introspection"],
42
+ [cairo_gobject_base, "cairo-gobject"],
43
+ [webkit2_gtk_base, "webkit2-gtk"],
44
+ ]
45
+ modules.each do |target, module_name|
46
+ if File.exist?("#{target}/Makefile") and system("which make > /dev/null")
47
+ `make -C #{target.dump} > /dev/null` or exit(false)
48
+ end
49
+ $LOAD_PATH.unshift(File.join(target, "ext", module_name))
50
+ $LOAD_PATH.unshift(File.join(target, "lib"))
51
+ end
52
+
53
+ $LOAD_PATH.unshift(File.join(glib_base, "test"))
54
+ require "glib-test-init"
55
+
56
+ $LOAD_PATH.unshift(File.join(gobject_introspection_base, "test"))
57
+ require "gobject-introspection-test-utils"
58
+
59
+ $LOAD_PATH.unshift(File.join(webkit2_gtk_base, "test"))
60
+ require "webkit2-gtk-test-utils"
61
+
62
+ require "webkit2-gtk"
63
+
64
+ repository = GObjectIntrospection::Repository.default
65
+ begin
66
+ repository.require(WebKit2Gtk::Loader::NAMESPACE)
67
+ rescue GObjectIntrospection::RepositoryError
68
+ puts("Omit because typelib file doesn't exist: #{$!.message}")
69
+ exit(true)
70
+ end
71
+
72
+ exit Test::Unit::AutoRunner.run(true, File.join(webkit2_gtk_base, "test"))
@@ -0,0 +1,41 @@
1
+ # Copyright (C) 2017 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestWebKit2GtkWebContext < Test::Unit::TestCase
18
+ include WebKit2GtkTestUtils
19
+
20
+ sub_test_case(".new") do
21
+ sub_test_case("Hash form") do
22
+ setup do
23
+ only_webkit2_gtk_version(2, 16)
24
+ end
25
+
26
+ test "ephemeral: true" do
27
+ context = WebKit2Gtk::WebContext.new(ephemeral: true)
28
+ assert do
29
+ context.ephemeral?
30
+ end
31
+ end
32
+
33
+ test "ephemeral: false" do
34
+ context = WebKit2Gtk::WebContext.new(ephemeral: false)
35
+ assert do
36
+ not context.ephemeral?
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,109 @@
1
+ # Copyright (C) 2015-2017 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ class TestWebKit2GtkWebView < Test::Unit::TestCase
18
+ include WebKit2GtkTestUtils
19
+
20
+ sub_test_case(".new") do
21
+ sub_test_case("Hash form") do
22
+ test "with context" do
23
+ only_webkit2_gtk_version(2, 8)
24
+ context = WebKit2Gtk::WebContext.new
25
+ webview = WebKit2Gtk::WebView.new(context: context)
26
+ assert_equal(context, webview.context)
27
+ end
28
+
29
+ test "with settings" do
30
+ settings = WebKit2Gtk::Settings.new
31
+ webview = WebKit2Gtk::WebView.new(settings: settings)
32
+ assert_equal(settings, webview.settings)
33
+ end
34
+
35
+ test "with user content manager" do
36
+ manager = WebKit2Gtk::UserContentManager.new
37
+ webview = WebKit2Gtk::WebView.new(user_content_manager: manager)
38
+ assert_equal(manager, webview.user_content_manager)
39
+ end
40
+
41
+ test "with related view" do
42
+ settings = WebKit2Gtk::Settings.new
43
+ related = WebKit2Gtk::WebView.new(settings: settings)
44
+ webview = WebKit2Gtk::WebView.new(related_view: related)
45
+ assert_equal(settings, webview.settings)
46
+ end
47
+
48
+ test "with unknown option" do
49
+ assert_raises do
50
+ WebKit2Gtk::WebView.new(foo: 'bar')
51
+ end
52
+ end
53
+ end
54
+
55
+ sub_test_case("legacy form") do
56
+ test "with unknown argument" do
57
+ assert_raises ArgumentError do
58
+ WebKit2Gtk::WebView.new('foo')
59
+ end
60
+ end
61
+ end
62
+ end
63
+
64
+ sub_test_case("#load_uri") do
65
+ def setup
66
+ @view = WebKit2Gtk::WebView.new
67
+ @http_server = WEBrick::HTTPServer.new(:Port => 0)
68
+ @http_server.mount_proc("/") do |request, response|
69
+ response.body = "Hello"
70
+ end
71
+ @http_server_thread = Thread.new do
72
+ @http_server.start
73
+ end
74
+ end
75
+
76
+ def teardown
77
+ @http_server.shutdown
78
+ @http_server_thread.join
79
+ end
80
+
81
+ def http_url
82
+ port = @http_server[:Port]
83
+ "http://127.0.0.1:#{port}/"
84
+ end
85
+
86
+ test "#load_uri" do
87
+ loaded = false
88
+
89
+ loop = GLib::MainLoop.new
90
+ timeout_id = GLib::Timeout.add(30000) do
91
+ timeout_id = nil
92
+ loop.quit
93
+ GLib::Source::REMOVE
94
+ end
95
+ @view.signal_connect("load-changed") do |view, event|
96
+ case event
97
+ when WebKit2Gtk::LoadEvent::FINISHED
98
+ GLib::Source.remove(timeout_id) if timeout_id
99
+ loaded = true
100
+ loop.quit
101
+ end
102
+ end
103
+ @view.load_uri(http_url)
104
+ loop.run
105
+
106
+ assert_true(loaded)
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,28 @@
1
+ # Copyright (C) 2015 Ruby-GNOME2 Project Team
2
+ #
3
+ # This library is free software; you can redistribute it and/or
4
+ # modify it under the terms of the GNU Lesser General Public
5
+ # License as published by the Free Software Foundation; either
6
+ # version 2.1 of the License, or (at your option) any later version.
7
+ #
8
+ # This library is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
+ # Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public
14
+ # License along with this library; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
+
17
+ require "test-unit"
18
+
19
+ require "webrick"
20
+
21
+ module WebKit2GtkTestUtils
22
+ def only_webkit2_gtk_version(major, minor, micro=nil)
23
+ micro ||= 0
24
+ unless WebKit2Gtk::Version.or_later?(major, minor, micro)
25
+ omit("Require WebKit2Gtk >= #{major}.#{minor}.#{micro}")
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,44 @@
1
+ # -*- ruby -*-
2
+ #
3
+ # Copyright (C) 2018 Ruby-GNOME2 Project Team
4
+ #
5
+ # This library is free software; you can redistribute it and/or
6
+ # modify it under the terms of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation; either
8
+ # version 2.1 of the License, or (at your option) any later version.
9
+ #
10
+ # This library is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Lesser General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Lesser General Public
16
+ # License along with this library; if not, write to the Free Software
17
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ require_relative "../glib2/version"
20
+
21
+ Gem::Specification.new do |s|
22
+ s.name = "webkit2-gtk"
23
+ s.summary = "Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+."
24
+ s.description = "Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+."
25
+ s.author = "The Ruby-GNOME2 Project Team"
26
+ s.email = "ruby-gnome2-devel-en@lists.sourceforge.net"
27
+ s.homepage = "https://ruby-gnome2.osdn.jp/"
28
+ s.licenses = ["LGPL-2.1+"]
29
+ s.version = ruby_glib2_version
30
+ s.extensions = ["dependency-check/Rakefile"]
31
+ s.require_paths = ["lib"]
32
+ s.files = [
33
+ "COPYING.LIB",
34
+ "README.md",
35
+ "Rakefile",
36
+ "#{s.name}.gemspec",
37
+ "dependency-check/Rakefile",
38
+ ]
39
+ s.files += Dir.glob("lib/**/*.rb")
40
+ s.files += Dir.glob("sample/**/*")
41
+ s.files += Dir.glob("test/**/*")
42
+
43
+ s.add_runtime_dependency("gtk3", "= #{s.version}")
44
+ end
metadata ADDED
@@ -0,0 +1,73 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: webkit2-gtk
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.3.3
5
+ platform: ruby
6
+ authors:
7
+ - The Ruby-GNOME2 Project Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-03-09 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: gtk3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 3.3.3
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 3.3.3
27
+ description: Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+.
28
+ email: ruby-gnome2-devel-en@lists.sourceforge.net
29
+ executables: []
30
+ extensions:
31
+ - dependency-check/Rakefile
32
+ extra_rdoc_files: []
33
+ files:
34
+ - COPYING.LIB
35
+ - README.md
36
+ - Rakefile
37
+ - dependency-check/Rakefile
38
+ - lib/webkit2-gtk.rb
39
+ - lib/webkit2-gtk/loader.rb
40
+ - lib/webkit2-gtk/version.rb
41
+ - lib/webkit2-gtk/web-context.rb
42
+ - lib/webkit2-gtk/web-view.rb
43
+ - sample/browser.rb
44
+ - sample/screenshot.rb
45
+ - test/run-test.rb
46
+ - test/test-webkit2-gtk-web-context.rb
47
+ - test/test-webkit2-gtk-web-view.rb
48
+ - test/webkit2-gtk-test-utils.rb
49
+ - webkit2-gtk.gemspec
50
+ homepage: https://ruby-gnome2.osdn.jp/
51
+ licenses:
52
+ - LGPL-2.1+
53
+ metadata: {}
54
+ post_install_message:
55
+ rdoc_options: []
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ requirements: []
69
+ rubygems_version: 3.1.0.pre1
70
+ signing_key:
71
+ specification_version: 4
72
+ summary: Ruby/WebKit2GTK is a Ruby binding of WebKit2GTK+.
73
+ test_files: []