提交 e2c163dc 编写于 作者: K kohsuke

added support for interactive JavaScript debugger

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@20647 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f49f68b2
......@@ -129,14 +129,19 @@ THE SOFTWARE.
<artifactId>xml-apis</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependency>
<dependency><!-- temporary, until we bump to new htmlunit -->
<groupId>org.jvnet.hudson</groupId>
<artifactId>htmlunit-core-js</artifactId>
<version>2.2-hudson-2</version>
</dependency>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>embedded-rhino-debugger</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<!-- for testing JNLP launch. -->
<groupId>org.jvnet.hudson</groupId>
......
......@@ -120,6 +120,7 @@ import org.mortbay.jetty.webapp.WebAppContext;
import org.mortbay.jetty.webapp.WebXmlConfiguration;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.ContextFactory;
import org.mozilla.javascript.tools.shell.JSConsole;
import org.w3c.css.sac.CSSException;
import org.w3c.css.sac.CSSParseException;
import org.w3c.css.sac.ErrorHandler;
......@@ -480,6 +481,22 @@ public abstract class HudsonTestCase extends TestCase {
new BufferedReader(new InputStreamReader(System.in)).readLine();
}
/**
* Starts an interactive JavaScript debugger, and break at the next JavaScript execution.
*
* <p>
* This is useful during debugging a test so that you can step execute and inspect state of JavaScript.
* This will launch a Swing GUI, and the method returns immediately.
*
* <p>
* Note that installing a debugger appears to make an execution of JavaScript substantially slower.
*/
public void interactiveJavaScriptDebugger() {
org.mozilla.javascript.tools.debugger.Main.mainEmbedded("Rhino debugger: "+getName());
// this can be too late, depending on when this method is invoked.
Functions.DEBUG_YUI = true;
}
/**
* Returns the last item in the list.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册