From 4ab697ce4173547f73e52c0526ac21e3b23053c7 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Tue, 1 Oct 2013 11:51:00 -0400 Subject: Add unit tests for PluginProxySelector There are no functional changes to PluginProxySelector itself. Refactor minimial code to make it possible to unit test. Mark suspicious behaviour with a FIXME or TODO. --- plugin/icedteanp/java/sun/applet/PluginProxySelector.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugin') diff --git a/plugin/icedteanp/java/sun/applet/PluginProxySelector.java b/plugin/icedteanp/java/sun/applet/PluginProxySelector.java index 4a1ce33..c863fb9 100644 --- a/plugin/icedteanp/java/sun/applet/PluginProxySelector.java +++ b/plugin/icedteanp/java/sun/applet/PluginProxySelector.java @@ -85,7 +85,7 @@ public class PluginProxySelector extends JNLPProxySelector { // Nothing usable in cache. Fetch info from browser Proxy proxy = Proxy.NO_PROXY; - Object o = PluginAppletViewer.requestPluginProxyInfo(uri); + Object o = getProxyFromRemoteCallToBrowser(uri); // If the browser returned anything, try to parse it. If anything in the try block fails, the fallback is direct connection try { @@ -118,6 +118,11 @@ public class PluginProxySelector extends JNLPProxySelector { return proxyList; } + /** For tests to override */ + protected Object getProxyFromRemoteCallToBrowser(URI uri) { + return PluginAppletViewer.requestPluginProxyInfo(uri); + } + /** * Checks to see if proxy information is already cached. * -- cgit v1.2.3