/hg/icedtea-web: 3 new changesets

jvanek at icedtea.classpath.org jvanek at icedtea.classpath.org
Tue Nov 27 00:19:39 PST 2012


changeset ef0316334153 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=ef0316334153
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Nov 27 09:00:53 2012 +0100

	Fixed epiphany switch
	* tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: -new-tab fixed to --new-tab


changeset 5d313adc13a5 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=5d313adc13a5
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Nov 27 09:06:32 2012 +0100

	Added Jan Kmetko as current SplashScreen artwork author


changeset 054a17dd19f6 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=054a17dd19f6
author: Jiri Vanek <jvanek at redhat.com>
date: Tue Nov 27 09:20:50 2012 +0100

	Better error reporting from applets
	* netx/net/sourceforge/jnlp/NetxPanel.java: (init) ErrorSplash is shown
	if fatal exception is cough


diffstat:

 AUTHORS                                                                          |    1 +
 ChangeLog                                                                        |   21 +
 netx/net/sourceforge/jnlp/NetxPanel.java                                         |    2 +
 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java                         |    7 +-
 tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html          |   43 +
 tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java                    |  269 ++++++++++
 tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java |    2 +-
 7 files changed, 342 insertions(+), 3 deletions(-)

diffs (415 lines):

diff -r a1112e2c3bc6 -r 054a17dd19f6 AUTHORS
--- a/AUTHORS	Fri Nov 23 11:31:19 2012 +0100
+++ b/AUTHORS	Tue Nov 27 09:20:50 2012 +0100
@@ -13,6 +13,7 @@
 Matthias Klose <doko at ubuntu.com>
 Alexandr Kolouch <skolnag at gmail.com>
 Michał Górny < mgorny at gentoo.org >
+Jan Kmetko <jan.kmetko.ml at gmail.com>
 Francis Kung <fkung at redhat.com>
 Denis Lila <dlila at redhat.com>
 DJ Lucas <dj at lucasit.com>
diff -r a1112e2c3bc6 -r 054a17dd19f6 ChangeLog
--- a/ChangeLog	Fri Nov 23 11:31:19 2012 +0100
+++ b/ChangeLog	Tue Nov 27 09:20:50 2012 +0100
@@ -1,3 +1,24 @@
+2012-11-27  Jiri Vanek <jvanek at redhat.com>
+
+	Better error reporting from applets
+	* netx/net/sourceforge/jnlp/NetxPanel.java: (init) ErrorSplash is shown
+	if fatal exception is cough
+	* plugin/icedteanp/java/sun/applet/PluginAppletViewer.java: (replaceSpalsh)
+	is rather removing all then just its previous version
+	* tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java:
+	* tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html
+	Testcase for manual testing of various exceptions from applet 
+
+2012-11-27  Jiri Vanek <jvanek at redhat.com>
+
+	* AUTHORS: added Jan Kmetko as current SplashScreen artwork author
+
+2012-11-27  Jiri Vanek <jvanek at redhat.com>
+
+	Fixed epiphany switch
+	* tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java: 
+	-new-tab fixed to --new-tab
+
 2012-11-23  Jiri Vanek <jvanek at redhat.com>
 
 	Firefox session-backup and stubs for softkiller, multiple listeners,
diff -r a1112e2c3bc6 -r 054a17dd19f6 netx/net/sourceforge/jnlp/NetxPanel.java
--- a/netx/net/sourceforge/jnlp/NetxPanel.java	Fri Nov 23 11:31:19 2012 +0100
+++ b/netx/net/sourceforge/jnlp/NetxPanel.java	Tue Nov 27 09:20:50 2012 +0100
@@ -33,6 +33,7 @@
 import java.util.concurrent.ConcurrentMap;
 import net.sourceforge.jnlp.splashscreen.SplashController;
 import net.sourceforge.jnlp.splashscreen.SplashPanel;
+import net.sourceforge.jnlp.splashscreen.SplashUtils;
 
 import sun.applet.AppletViewerPanel;
 import sun.awt.SunToolkit;
@@ -178,6 +179,7 @@
         } catch (Exception e) {
             this.appletAlive = false;
             e.printStackTrace();
+            replaceSplash(SplashUtils.getErrorSplashScreen(getWidth(), getHeight(), e));
         }
     }
 
diff -r a1112e2c3bc6 -r 054a17dd19f6 plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Fri Nov 23 11:31:19 2012 +0100
+++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java	Tue Nov 27 09:20:50 2012 +0100
@@ -114,6 +114,7 @@
 import sun.misc.Ref;
 
 import com.sun.jndi.toolkit.url.UrlUtil;
+import java.awt.BorderLayout;
 import java.util.Hashtable;
 import java.util.Vector;
 import net.sourceforge.jnlp.splashscreen.SplashController;
@@ -453,9 +454,11 @@
                 public void run() {
                     splashPanel.getSplashComponent().setVisible(false);
                     splashPanel.stopAnimation();
-                    remove(splashPanel.getSplashComponent());
+                    removeAll();
+                    setLayout(new BorderLayout());
+                    //remove(splashPanel.getSplashComponent());
                     splashPanel = null;
-                    remove(panel);
+                    //remove(panel);
                     // Re-add the applet to notify container
                     add(panel);
                     panel.setVisible(true);
diff -r a1112e2c3bc6 -r 054a17dd19f6 tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/AppletTest/resources/errorAppletAutoTests.html	Tue Nov 27 09:20:50 2012 +0100
@@ -0,0 +1,43 @@
+<!--
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+IcedTea is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to the
+Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+
+ -->
+<html><head></head><body bgcolor="blue">
+<p><applet code="AppletErrorTest.class" archive="AppletTest.jar" codebase="." width="800" height="600">
+  <param name="levelOfDeath" value="BEHIND_GUI_THREAD">
+</applet></p>
+</body>
+</html>
diff -r a1112e2c3bc6 -r 054a17dd19f6 tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/reproducers/simple/AppletTest/srcs/AppletErrorTest.java	Tue Nov 27 09:20:50 2012 +0100
@@ -0,0 +1,269 @@
+/* AppletErrorTest.java
+Copyright (C) 2011 Red Hat, Inc.
+
+This file is part of IcedTea.
+
+IcedTea is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License as published by
+the Free Software Foundation, version 2.
+
+IcedTea is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with IcedTea; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library.  Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module.  An independent module is a module which is not derived from
+or based on this library.  If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so.  If you do not wish to do so, delete this
+exception statement from your version.
+ *
+ */
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.GridLayout;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Random;
+import javax.swing.JApplet;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+public class AppletErrorTest extends JApplet {
+
+    private class Killer extends Thread {
+
+        public int n = 20000;
+
+        @Override
+        public void run() {
+            try {
+                Thread.sleep(n);
+                System.out.println("Error Applet killing himself after " + n + " ms of life");
+                System.exit(0);
+            } catch (Exception ex) {
+            }
+        }
+    }
+    private volatile boolean waiting = true;
+    private boolean isApplet = true;
+    private Killer killer;
+    private final String IN_GUI_THREAD = "IN_GUI_THREAD";
+    private final String BEHIND_GUI_THREAD = "BEHIND_GUI_THREAD";
+    private final String IN_GUI = "IN_GUI";
+    private final String IN_INIT = "IN_INIT";
+    private final String IN_START = "IN_START";
+    private final String IN_STOP = "IN_STOP";
+    private final String IN_DESTROY = "IN_DESTROY";
+    private String levelOfDeath = BEHIND_GUI_THREAD;
+
+    @Override
+    public void init() {
+        if (isApplet) {
+            String s = getParameter("levelOfDeath");
+            if (s != null) {
+                levelOfDeath = s;
+            }
+        }
+        System.out.println("Error applet was initialised");
+        killer = new Killer();
+        if (levelOfDeath.equals(IN_INIT)) {
+            throw new RuntimeException("Intentional exception from init");
+        }
+    }
+
+    public static void main(String[] args) {
+        final JFrame f = new JFrame();
+        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
+        f.setSize(899, 600);
+        f.setLayout(new BorderLayout());
+        AppletErrorTest ae = new AppletErrorTest();
+        ae.isApplet=false;
+        ae.init();
+        f.add(ae);
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                f.setVisible(true);
+            }
+        });
+        ae.start();
+
+
+    }
+
+    @Override
+    public void start() {
+        final AppletErrorTest aSelf = this;
+        final JPanel self = new JPanel();
+        aSelf.setLayout(new BorderLayout());
+        aSelf.add(self);
+        self.setLayout(new GridLayout(0, 4));
+        final Random r = new Random();
+        new Thread(new Runnable() {
+
+            @Override
+            public void run() {
+                new Colorer(self, r).run();
+            }
+        }).start();
+
+
+        System.out.println("Error applet was started");
+        killer.start();
+        System.out.println("killer was started");
+        if (levelOfDeath.equals(IN_GUI_THREAD) || levelOfDeath.equals(IN_GUI) || levelOfDeath.equals(BEHIND_GUI_THREAD)) {
+            new Thread(new Runnable() {
+
+                @Override
+                public void run() {
+                    try {
+
+                        for (int i = 0; i < 15; i++) {
+                            try {
+                                System.out.println("Rainbow is shining");
+                                new GuiRainbow(self, r, i).run();
+                                if (levelOfDeath.equals(BEHIND_GUI_THREAD) && i >= 12) {
+                                    throw new RuntimeException("Intentional error from start (gui is running)- " + levelOfDeath);
+                                }
+                                Thread.sleep(200);
+                            } catch (InterruptedException ex) {
+                                throw new RuntimeException(ex);
+                            }
+                        }
+                    } finally {
+                        waiting = false;
+                    }
+
+
+
+                }
+            }).start();
+        }
+        if (!isApplet) {
+            if (levelOfDeath.equals(IN_GUI)) {
+                while (waiting) {
+                    try {
+                        Thread.sleep(100);
+                        SwingUtilities.invokeLater(new Runnable() {
+
+                            public void run() {
+                                aSelf.repaint();
+                                aSelf.validate();
+                                aSelf.repaint();
+                            }
+                        });
+
+                    } catch (InterruptedException ex) {
+                        throw new RuntimeException(ex);
+                    }
+                }
+                throw new RuntimeException("Intentional error from start (gui was running)- " + levelOfDeath);
+            }
+        }
+        if (levelOfDeath.equals(IN_START)) {
+            throw new RuntimeException("Intentional error from start (gui was not running)- " + levelOfDeath);
+        }
+    }
+
+    @Override
+    public void stop() {
+        System.out.println("Error applet was stopped");
+        if (levelOfDeath.equals(IN_STOP)) {
+            throw new RuntimeException("Intentional exception from stop" + levelOfDeath);
+        }
+    }
+
+    @Override
+    public void destroy() {
+        System.out.println("Error applet will be destroyed");
+        if (levelOfDeath.equals(IN_DESTROY)) {
+            throw new RuntimeException("Intentional exception from destroy" + levelOfDeath);
+        }
+    }
+
+    private class GuiRainbow implements Runnable {
+
+        private final JComponent self;
+        private final Random r;
+        private final int i;
+
+        public GuiRainbow(JComponent self, Random r, int i) {
+            this.self = self;
+            this.r = r;
+            this.i = i;
+        }
+
+        @Override
+        public void run() {
+            if (self.getComponentCount() > 1 && r.nextInt(2) == 0) {
+                int x = r.nextInt(self.getComponentCount());
+                self.remove(x);
+                self.validate();
+            } else {
+                JLabel ll=new JLabel("Hi, its error applet here " + i);
+                self.add(ll);
+                self.validate();
+                ll.addMouseListener(new MouseAdapter() {
+
+                    @Override
+                    public void mouseClicked(MouseEvent e) {
+                        throw new RuntimeException("Intentional exception by click to "+i);
+                    }
+                });
+            }
+            System.out.println("Components are handled");
+            if (levelOfDeath.equals(IN_GUI_THREAD) && i >= 8) {
+                throw new RuntimeException("Intentional error from swing thread (gui is running)- " + levelOfDeath);
+            }
+
+        }
+    }
+
+    class Colorer implements Runnable {
+
+        private final JComponent self;
+        private final Random r;
+
+        public Colorer(JComponent self, Random r) {
+            this.self = self;
+            this.r = r;
+        }
+
+        @Override
+        public void run() {
+            int i = 0;
+            while (true) {
+                i++;
+                try {
+                    self.setBackground(new Color(r.nextInt()));
+                    System.out.println("Applet is coloring " + i);
+                    Thread.sleep(200);
+                } catch (Exception ex) {
+                    //intentionally silenced
+                }
+            }
+        }
+    }
+}
diff -r a1112e2c3bc6 -r 054a17dd19f6 tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java
--- a/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java	Fri Nov 23 11:31:19 2012 +0100
+++ b/tests/test-extensions/net/sourceforge/jnlp/browsertesting/browsers/Epiphany.java	Tue Nov 27 09:20:50 2012 +0100
@@ -42,7 +42,7 @@
 
 public class Epiphany extends MozillaFamilyLinuxBrowser {
 
-    String[] cs = {"-new-tab"};
+    String[] cs = {"--new-tab"};
 
     public Epiphany(String bin) {
         super(bin);



More information about the distro-pkg-dev mailing list