Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoland Grunberg2017-10-12 16:31:17 -0400
committerLeo Ufimtsev2017-11-06 10:27:33 -0500
commitefc5563b7cb50fbcec6327f029f63a31292bde26 (patch)
tree12bdcf93cb0243bdcaee690d444e32e0b67730d7 /tests
parent5226b884e7ad613b411b5872742aec832d341e01 (diff)
downloadeclipse.platform.swt-efc5563b7cb50fbcec6327f029f63a31292bde26.tar.gz
eclipse.platform.swt-efc5563b7cb50fbcec6327f029f63a31292bde26.tar.xz
eclipse.platform.swt-efc5563b7cb50fbcec6327f029f63a31292bde26.zip
Bug 525946: [Webkit2] Port download functionality to WebKit2.
- On WEBKIT2, the file dialog logic is now done in same thread as the signal handler since it does not freeze the UI, as may have been the case on WEBKIT1 - Use the 'download-requested' signal on WEBKIT2 as an entrypoint for other signals necessary to successfully download a file - Handle 'decide-destination' signal on WEBKIT2, and place file dialog logic there so that file path may be changed while still having the suggested file name - Handle 'finished', and 'failed' to be aware of download termination as well as disposing of the progress dialog - On WEBKIT2, state of a WebKitDownload is only informed through signals so create a webkitDownloadStatus Map so that the download window may be aware of download state - Re-use status codes from WEBKIT1 in the WEBKIT2 code to keep logic as similar as possible Tested on WEBKIT1 and WEBKIT2 with 2 browser instances each downloading the same large file (different destination) while alternating between instances and downloading smaller files. Change-Id: Ib4d1e5552eedcb73a61ae671f14408ff00f9b9a4 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java
new file mode 100644
index 0000000000..95c2e1c0af
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug525946_DownloadFunction.java
@@ -0,0 +1,32 @@
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+/*
+ * Title: Bug 459462 - [WebKit] Implement Download functionality
+ * How to run: launch snippet
+ * Bug description: Download functionality doesn't work on WebKit2.
+ * 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();
+}
+} \ No newline at end of file

Back to the top