aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2013-10-01 11:51:00 -0400
committerOmair Majid <[email protected]>2013-10-01 11:51:00 -0400
commit4ab697ce4173547f73e52c0526ac21e3b23053c7 (patch)
tree9351c7602b10436d9b78bd9b991f86b4194a6eff /plugin
parentc824b24b3c7656e6230b6c1d398a927b1225f0c2 (diff)
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.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/icedteanp/java/sun/applet/PluginProxySelector.java7
1 files changed, 6 insertions, 1 deletions
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.
*