Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLeo Ufimtsev2018-04-18 18:28:04 +0000
committerLeo Ufimtsev2018-04-19 17:38:42 +0000
commit1051e263ec1b8326a206ad1caa1bc5c80c682487 (patch)
tree43c7f0d5c573469be87242254002197dfffab6af /tests
parentb320b3a0933b22debc7a65f4acbabc4040ebf1d2 (diff)
downloadeclipse.platform.swt-1051e263ec1b8326a206ad1caa1bc5c80c682487.tar.gz
eclipse.platform.swt-1051e263ec1b8326a206ad1caa1bc5c80c682487.tar.xz
eclipse.platform.swt-1051e263ec1b8326a206ad1caa1bc5c80c682487.zip
Bug 525946 [Webkit2] Port download functionality (rewrite some logic)
G_TYPE_CHECK_INSTANCE_TYPE is not a reliable method to check if type is webview or webcontext at run time. On my & Roland's system it works, but on Andrey's system it miss-fires. This is a macro and by the looks is not reliable method because we use it with dynamically loaded libraries and via JNI. Solution: Rewrite the callback logic to determine types of callback based on user_data instead of relying on type checking macro. Also, created task to remove usage of the macro to prevent simmila issues: https://bugs.eclipse.org/bugs/show_bug.cgi?id=533833 Tests: - Environment: Webkit2 2.18, Gtk3.22, Fedora 27, wayland on host, x11 eclipse backend. - JUnit AllBrowserTests - ChildEclipse. - Bug Snippet attached to this patch. - Also tested with webkit1. - Andrey reports that this patch fixes his crash issue: https://bugs.eclipse.org/bugs/show_bug.cgi?id=533545#c34 Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=5259462 Change-Id: I485a54804285dbf114961422799ea34796413404 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java31
1 files changed, 16 insertions, 15 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java
index 695504071d..9079cf9e5b 100644
--- a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java
@@ -27,20 +27,21 @@ import org.eclipse.swt.widgets.Shell;
* Expected results: Download functionality now works on WebKit2.
* GTK version(s): GTK3.x
*/
-
public class Bug525946_DownloadFunction {
-public static void main(String[] args) {
-final Display display = new Display();
-final Shell shell = new Shell(display);
-shell.setBounds(10, 10, 400, 400);
-shell.setLayout(new FillLayout());
-final Browser browser = new Browser(shell, SWT.NONE);
-browser.setUrl("http://download.eclipse.org/tools/orbit/downloads/drops/R20170516192513/orbit-buildrepo-R20170516192513.zip");
-shell.open();
-while (!shell.isDisposed()) {
-if (!display.readAndDispatch()) display.sleep();
-}
-shell.dispose();
-display.dispose();
-}
+ public static void main(String[] args) {
+ final Display display = new Display();
+ final Shell shell = new Shell(display);
+ shell.setBounds(10, 10, 400, 400);
+ shell.setLayout(new FillLayout());
+ final Browser browser = new Browser(shell, SWT.NONE);
+// browser.setUrl("http://download.eclipse.org/eclipse/downloads/drops4/I20180416-2000/download.php?dropFile=eclipse-test-framework-I20180416-2000.zip"); // 2.3 mb
+ browser.setUrl("http://download.eclipse.org/tools/orbit/downloads/drops/R20170516192513/orbit-buildrepo-R20170516192513.zip"); // 400mb
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ shell.dispose();
+ display.dispose();
+ }
} \ No newline at end of file

Back to the top