[Httpunit-commit] SF.net SVN: httpunit:[1022] trunk/httpunit/src/com/meterware/httpunit
Brought to you by:
russgold
|
From: <rus...@us...> - 2009-03-29 13:20:48
|
Revision: 1022
http://httpunit.svn.sourceforge.net/httpunit/?rev=1022&view=rev
Author: russgold
Date: 2009-03-29 13:20:36 +0000 (Sun, 29 Mar 2009)
Log Message:
-----------
patch 1152036: don't request javascript when not enabled
Modified Paths:
--------------
trunk/httpunit/src/com/meterware/httpunit/ParsedHTML.java
trunk/httpunit/src/com/meterware/httpunit/WebConversation.java
trunk/httpunit/src/com/meterware/httpunit/parsing/ScriptFilter.java
Modified: trunk/httpunit/src/com/meterware/httpunit/ParsedHTML.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/ParsedHTML.java 2009-03-16 15:31:41 UTC (rev 1021)
+++ trunk/httpunit/src/com/meterware/httpunit/ParsedHTML.java 2009-03-29 13:20:36 UTC (rev 1022)
@@ -348,12 +348,11 @@
* @param element
*/
void interpretScriptElement( Element element ) {
- // proposed patch 1152036
- // not enabled by wf...@bi... since it would brake
- // com.meterware.httpunit.javascript.NekoEnhancedScriptingTest - testNoScriptSections
- //if (!HttpUnitOptions.isScriptingEnabled()) {
- // return;
- //}
+ if (!HttpUnitOptions.isScriptingEnabled()) {
+ _enableNoScriptNodes = true;
+ return;
+ }
+
String script = getScript( element );
if (script != null) {
try {
Modified: trunk/httpunit/src/com/meterware/httpunit/WebConversation.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/WebConversation.java 2009-03-16 15:31:41 UTC (rev 1021)
+++ trunk/httpunit/src/com/meterware/httpunit/WebConversation.java 2009-03-29 13:20:36 UTC (rev 1022)
@@ -175,7 +175,7 @@
* @param headers
*/
private void sendHeaders( URLConnection connection, Dictionary headers ) {
- boolean sendReferer = getClientProperties().isSendReferer();
+ boolean sendReferer = getClientProperties().isSendReferer();
for (Enumeration e = headers.keys(); e.hasMoreElements();) {
String key = (String) e.nextElement();
if ( sendReferer || !"referer".equalsIgnoreCase( key ) ) {
Modified: trunk/httpunit/src/com/meterware/httpunit/parsing/ScriptFilter.java
===================================================================
--- trunk/httpunit/src/com/meterware/httpunit/parsing/ScriptFilter.java 2009-03-16 15:31:41 UTC (rev 1021)
+++ trunk/httpunit/src/com/meterware/httpunit/parsing/ScriptFilter.java 2009-03-29 13:20:36 UTC (rev 1022)
@@ -19,20 +19,16 @@
* DEALINGS IN THE SOFTWARE.
*
*******************************************************************************************************************/
-import java.io.IOException;
-import java.io.StringReader;
-import org.apache.xerces.xni.Augmentations;
-import org.apache.xerces.xni.QName;
-import org.apache.xerces.xni.XMLAttributes;
-import org.apache.xerces.xni.XMLLocator;
-import org.apache.xerces.xni.XMLString;
-import org.apache.xerces.xni.XNIException;
+import com.meterware.httpunit.HttpUnitOptions;
+import org.apache.xerces.xni.*;
import org.apache.xerces.xni.parser.XMLInputSource;
-
import org.cyberneko.html.HTMLConfiguration;
import org.cyberneko.html.filters.DefaultFilter;
+import java.io.IOException;
+import java.io.StringReader;
+
/**
* A filter to interpret JavaScript script blocks, based on the sample Scripts program provided by NekoHTML.
*
@@ -97,7 +93,7 @@
private boolean isSupportedScript( QName element, XMLAttributes attrs ) {
if (!element.rawname.equalsIgnoreCase( "script" ) || attrs == null) return false;
String value = getScriptLanguage( attrs );
- return _scriptHandler.supportsScriptLanguage( value );
+ return HttpUnitOptions.isScriptingEnabled() && _scriptHandler.supportsScriptLanguage( value );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|