| Constructor and Description |
|---|
MockEcmascriptDebugger() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRuntime(Esdbg6Protos.RuntimeInfo info) |
void |
addRuntime(EsdbgProtos.RuntimeInfo info)
Adds a runtime to the list of runtimes maintained in the service (STP/1 only)
|
String |
callFunctionOnObject(String using,
int objectId)
The script to be executed on/using an object
|
Object |
callFunctionOnObject(String using,
int objectId,
boolean responseExpected) |
void |
changeRuntime(int index)
Changes the frame by index
|
void |
changeRuntime(String framePath)
Changes the frame by frame name address nested frames by dot (first.second)
|
void |
cleanUpRuntimes()
Cleanup runtimes with the active window id
|
void |
cleanUpRuntimes(int windowId)
Cleanup possible dead/suspended runtimes on runtime-started or window-closed
|
List<Integer> |
examineObjects(Integer id)
Request additional information about an object, such as its prototype or its properties.
|
Object |
examineScriptResult(Integer id)
Recursively iterates through the property hierarchies of underneath the given object and
unwraps the node elements into suitable types.
|
String |
executeJavascript(String using)
Execute a script and wait for response
|
String |
executeJavascript(String using,
boolean responseExpected)
Execute a script, this method allows fine tuning of responses, we are not interested in return
value in some injections
|
String |
executeJavascript(String using,
Integer windowId)
Executes an arbitrary block of JavaScript on a given window, and returns the result of the
evaluation.
|
Object |
executeScript(String using,
boolean responseExpected)
Executes a script and returns the response (based on responseExpected)
|
Integer |
executeScriptOnObject(String using,
int objectId) |
Integer |
getObject(String using)
Gets the object id using a script
|
int |
getRuntimeId()
Get the current runtime ID.
|
String |
getServiceName()
Gets the name of the service as represented in Opera.
|
String |
getServiceVersion()
Gets the current version of the service.
|
void |
init()
Initialize the service.
|
boolean |
isScriptInjectable()
Queries the current runtime to see if it's script injectable.
|
List<String> |
listFramePaths()
Lists the frame paths of available runtimes
|
void |
readyStateChanged(EcmascriptProtos.ReadyStateChange change)
Triggered on the ecmascript service when the state of a runtime changes
|
void |
releaseObject(int objectId)
Releases a specific object
|
void |
releaseObjects()
Makes objects available to gc, this doesn't free the objects immediately
|
void |
removeRuntime(int runtimeId)
Removes a runtime from the list, doesnt get called often due to runtime-stopped being sent late
(runtimes get suspended)
|
void |
resetFramePath()
Resets the frame path context to the top level frame and reinitializes the debugger runtime.
|
void |
resetRuntimesList()
Resets the list of runtimes and fetches a fresh list from Opera, this can be used to recover in
cases where runtimes go out of sync
|
Object |
scriptExecutor(String script,
Object... params)
Executes the given javascript via eval call
|
void |
setDriver(OperaDriver driver)
Set the driver this service belongs to.
|
void |
setFormElementValue(int objectId,
String value)
Set value of a form element.
|
void |
setRuntime(EsdbgProtos.RuntimeInfo runtime)
Sets the runtime to be used in injection required for event handler (STP/1 only)
|
boolean |
updateRuntime()
Finds a valid runtime and updates the runtime reference (active runtime)
|
public void init()
Servicepublic String getServiceName()
ServicegetServiceName in interface Servicepublic String getServiceVersion()
ServicegetServiceVersion in interface Servicepublic Object scriptExecutor(String script, Object... params)
DebuggerscriptExecutor in interface Debuggerscript - the script to be executed on hostparams - array of params, can be string, long or web element(s)public void removeRuntime(int runtimeId)
DebuggerremoveRuntime in interface Debuggerpublic void addRuntime(EsdbgProtos.RuntimeInfo info)
DebuggeraddRuntime in interface Debuggerpublic List<String> listFramePaths()
DebuggerlistFramePaths in interface DebuggerList of String framepathspublic int getRuntimeId()
DebuggergetRuntimeId in interface Debuggerpublic void setRuntime(EsdbgProtos.RuntimeInfo runtime)
DebuggersetRuntime in interface Debuggerpublic Integer getObject(String using)
Debuggerpublic Integer executeScriptOnObject(String using, int objectId)
executeScriptOnObject in interface Debuggerpublic Object executeScript(String using, boolean responseExpected)
DebuggerexecuteScript in interface Debuggerusing - the script to be injectedresponseExpected - the flag to enable/disable parsing responsenull otherwisepublic String executeJavascript(String using, boolean responseExpected)
DebuggerexecuteJavascript in interface Debuggerusing - script to executeresponseExpected - if true parse the responsepublic String executeJavascript(String using)
DebuggerexecuteJavascript in interface Debuggerusing - script to executepublic List<Integer> examineObjects(Integer id)
DebuggerexamineObjects in interface Debuggerid - object ID previously returned from an eval call to the debuggerpublic void cleanUpRuntimes()
DebuggercleanUpRuntimes in interface Debuggerpublic void cleanUpRuntimes(int windowId)
DebuggercleanUpRuntimes in interface Debuggerpublic void changeRuntime(String framePath)
DebuggerchangeRuntime in interface Debuggerpublic Object callFunctionOnObject(String using, int objectId, boolean responseExpected)
callFunctionOnObject in interface Debuggerpublic String callFunctionOnObject(String using, int objectId)
DebuggercallFunctionOnObject in interface Debuggerusing - script with reference to the object "locator"objectId - the object to be used for injectionpublic void addRuntime(Esdbg6Protos.RuntimeInfo info)
public void releaseObjects()
DebuggerreleaseObjects in interface Debuggerpublic boolean updateRuntime()
DebuggerupdateRuntime in interface Debuggerpublic void resetRuntimesList()
DebuggerresetRuntimesList in interface Debuggerpublic void readyStateChanged(EcmascriptProtos.ReadyStateChange change)
DebuggerreadyStateChanged in interface Debuggerchange - EcmascriptProtos.ReadyStateChange
object with runtime infopublic void releaseObject(int objectId)
DebuggerreleaseObject in interface DebuggerobjectId - Id of the object to be releasedpublic void resetFramePath()
DebuggerresetFramePath in interface Debuggerpublic void changeRuntime(int index)
DebuggerchangeRuntime in interface Debuggerpublic String executeJavascript(String using, Integer windowId)
DebuggerexecuteJavascript in interface Debuggerusing - the code to evaluatewindowId - the runtime ID, previously retrieved from the WindowManagerpublic Object examineScriptResult(Integer id)
DebuggerOperaWebElement's, arrays into
Java List's, hashes into Map's, numbers into Integer's, and
the remaining properties into String's.examineScriptResult in interface Debuggerid - the object to examine the hierarchy ofpublic void setFormElementValue(int objectId,
String value)
DebuggersetFormElementValue in interface DebuggerobjectId - the ID of the object to set valuevalue - the value to setpublic void setDriver(OperaDriver driver)
Debuggerpublic boolean isScriptInjectable()
DebuggerisScriptInjectable in interface DebuggerCopyright © 2012. All Rights Reserved.