Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLeo Ufimtsev2018-01-30 16:58:12 -0500
committerLeo Ufimtsev2018-01-30 17:01:20 -0500
commit5ccd99b1763a271291710a2a3ed1df3894c149a6 (patch)
tree776ba16a8f8d31ff4882766c8787ed4744af356e /tests
parent9699273a0dd1d1b553030ea14d565c8fb142c1d0 (diff)
downloadeclipse.platform.swt-5ccd99b1763a271291710a2a3ed1df3894c149a6.tar.gz
eclipse.platform.swt-5ccd99b1763a271291710a2a3ed1df3894c149a6.tar.xz
eclipse.platform.swt-5ccd99b1763a271291710a2a3ed1df3894c149a6.zip
Bug 529870 – [webkit2]BrowserProblemI20180130-2000
Fixing a corner case that can generate a deadlock. - A) User calls evaluate(SCRIPT) - B) The SCRIPT calls a BrowserFunction, (java/swt) - C) The BrowserFunction calls evaluate() Now webkit_web_view_run_javascript() in C never starts because webkit is still executing A. But A never finishes because it's waiting for C to complete to get a return value for A's callback. Solution: Don't allow blocking evaluation in BrowserFunction() callbacks. This shouldn't affect folks mostly, because from what I gather people use 'evaluate' as a form of execute(). This has gone unnoticed on Win32/Cocoa because issue isn't explicitly raised and 'evaluate()' return value wasn't used. Verified with AllBrowser JUnits. Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=5298702 Change-Id: Iddc8c753051455f6706ea81db85e0c6610be11a9 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug518961_RTTest.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug518961_RTTest.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug518961_RTTest.java
new file mode 100644
index 0000000000..9cdbf670d6
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug518961_RTTest.java
@@ -0,0 +1,51 @@
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ *
+ To get this guy to work,
+ 1) Uncomment line with "UNCOMMENT THIS".
+ 2) Get hold of nebula rich text project. (found inside org.eclipse.nebula)
+ edit .classpath and add:
+ <classpathentry kind="src" path="/org.eclipse.nebula.widgets.richtext"/>
+ (This can be done via auto fix.
+
+ Before Fix: When running, error messages thrown into console.
+ After fix: Snippet runs as expected.
+ */
+public class Bug518961_RTTest extends org.eclipse.swt.widgets.Shell {
+
+ public Bug518961_RTTest(Display display) {
+ super(display, SWT.SHELL_TRIM);
+ createContents();
+ }
+
+ private void createContents() {
+// new RichTextEditor(this); /// UNCOMMENT THIS.
+ }
+
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Bug518961_RTTest(display);
+ shell.setSize(800, 800);
+ shell.setLayout(new FillLayout());
+
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+
+ @Override
+ protected void checkSubclass() {
+ }
+
+} \ No newline at end of file

Back to the top