webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | List of all members
com.netscape.javascript.qa.drivers.RhinoEnv Class Reference
Inheritance diagram for com.netscape.javascript.qa.drivers.RhinoEnv:
com.netscape.javascript.qa.drivers.TestEnvironment

Public Member Functions

 RhinoEnv (TestFile f, TestSuite s, TestDriver d)
 
synchronized void runTest ()
 
Object createContext ()
 
Object executeTestFile ()
 
Object executeTestFile (String s)
 
boolean parseResult ()
 
void close ()
 
String getString (Object object)
 

Public Attributes

Global global
 

Detailed Description

This class creates a javax.javascript.Context, which evaluates the helper and RhinoFile and returns a result.

If the test throws a Java exception or JavaScript runtime or compilation error, the RhinoFile fails, and the exception is stored in that RhinoFile's exception variable.

If the test succeeds, the result is parsed and the RhinoFile's test result variables are populated.

Author
chris.nosp@m.tine.nosp@m.@nets.nosp@m.cape.nosp@m..com

Constructor & Destructor Documentation

◆ RhinoEnv()

com.netscape.javascript.qa.drivers.RhinoEnv.RhinoEnv ( TestFile  f,
TestSuite  s,
TestDriver  d 
)
inline
Parameters
fRhinoFile that will be executed in this RhinoEnv
sthe RhinoFile's test suite
dthe RhinoDrv applet that created this RhinoEnv

Member Function Documentation

◆ close()

void com.netscape.javascript.qa.drivers.RhinoEnv.close ( )
inline

◆ createContext()

Object com.netscape.javascript.qa.drivers.RhinoEnv.createContext ( )
inline

Create a new com.netscape.javascript.Context.

Returns
the newly instantiated Context

Implements com.netscape.javascript.qa.drivers.TestEnvironment.

◆ executeTestFile() [1/2]

Object com.netscape.javascript.qa.drivers.RhinoEnv.executeTestFile ( )
inline

Given a filename, evaluate the file's contents as a JavaScript program.

Returns
the return value of the JavaScript program. If the test throws a Java exception or JavaScript runtime or compilation error, return the string value of the error message.

Implements com.netscape.javascript.qa.drivers.TestEnvironment.

◆ executeTestFile() [2/2]

Object com.netscape.javascript.qa.drivers.RhinoEnv.executeTestFile ( String  s)
inline

Given a filename, evaluate the file's contents as a JavaScript program. Return the value of the program. If the test throws a Java exception or JavaScript runtime or compilation error, return the string value of the error message.

Parameters
sfull path to the file that will be exectued.
Returns
test result object. If the test is positive, result should be an instance of Scriptable. if the test is negative, the result should be a String, whose value is the message in the JavaScript error or Java exception.

◆ getString()

String com.netscape.javascript.qa.drivers.RhinoEnv.getString ( Object  object)
inline

Get the JavaScript string associated with a JavaScript object.

Parameters
objecta Java identifier for a JavaScript object
Returns
the JavaScript string representation of the object

◆ parseResult()

boolean com.netscape.javascript.qa.drivers.RhinoEnv.parseResult ( )
inline

Evaluates the RhinoFile result. If the result is an instance of javax.javascript.Scriptable, assume it is a JavaScript Array of TestCase objects, as described in RhinoDrv.java. For each test case in the array, add an element to the RhinoFile's test case vector. If all test cases passed, set the RhinoFile's passed value to true; else set its passed value to false.

If the result is not a Scriptable object, the test failed. Set the the RhinoFile's exception property to the string value of the result. However, negative tests, which should have a "-n.js" extension, are expected to fail.

Implements com.netscape.javascript.qa.drivers.TestEnvironment.

◆ runTest()

synchronized void com.netscape.javascript.qa.drivers.RhinoEnv.runTest ( )
inline

Creates the JavaScript Context, which evaluates the contents of a RhinoFile and returns a result. The RhinoEnv parses the test result, and sets values of the RhinoFile test result properties.

See also
com.netscape.javascript.Context::setOptimizationLevel
com.netscape.javascript.Context::setDebugLevel

Implements com.netscape.javascript.qa.drivers.TestEnvironment.

Member Data Documentation

◆ global

Global com.netscape.javascript.qa.drivers.RhinoEnv.global

The documentation for this class was generated from the following file: