2018-05-31 20:42:07 +00:00
|
|
|
Test for Runtime.addBinding.
|
|
|
|
|
|
|
|
Running test: testBasic
|
|
|
|
|
|
|
|
Add binding inside session1..
|
|
|
|
Call binding..
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Add binding inside session2..
|
|
|
|
Call binding..
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
binding called in session2
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Disable agent inside session1..
|
|
|
|
Call binding..
|
2020-09-30 22:20:01 +00:00
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
2018-05-31 20:42:07 +00:00
|
|
|
binding called in session2
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Disable agent inside session2..
|
|
|
|
Call binding..
|
2020-09-30 22:20:01 +00:00
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
binding called in session2
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
2018-05-31 20:42:07 +00:00
|
|
|
|
|
|
|
Enable agent inside session1..
|
|
|
|
Call binding..
|
2020-09-30 22:20:01 +00:00
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
binding called in session2
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
2018-05-31 20:42:07 +00:00
|
|
|
|
|
|
|
Running test: testReconnect
|
|
|
|
|
|
|
|
Add binding inside session..
|
|
|
|
Reconnect..
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Running test: testBindingOverrides
|
|
|
|
|
|
|
|
Add send function on global object..
|
|
|
|
Add binding inside session..
|
|
|
|
Call binding..
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Running test: testRemoveBinding
|
|
|
|
|
|
|
|
Add binding inside session..
|
|
|
|
Call binding..
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : send
|
|
|
|
payload : payload
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Remove binding inside session..
|
|
|
|
Call binding..
|
2020-09-30 22:20:01 +00:00
|
|
|
|
|
|
|
Running test: testAddBindingToContextById
|
|
|
|
Call binding in default context (binding should NOT be exposed)
|
|
|
|
Call binding in target context (binding should be exposed)
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : frobnicate
|
|
|
|
payload : message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Call binding in newly created context (binding should NOT be exposed)
|
2020-09-30 22:27:32 +00:00
|
|
|
|
|
|
|
Running test: testAddBindingToContextByName
|
|
|
|
Call binding in default context (binding should NOT be exposed)
|
|
|
|
Call binding in Foo (binding should be exposed)
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : frobnicate
|
|
|
|
payload : message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Call binding in Bar (binding should NOT be exposed)
|
|
|
|
Call binding in newly-created Foo (binding should be exposed)
|
|
|
|
binding called in session1
|
|
|
|
{
|
|
|
|
method : Runtime.bindingCalled
|
|
|
|
params : {
|
|
|
|
executionContextId : <executionContextId>
|
|
|
|
name : frobnicate
|
|
|
|
payload : message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Call binding in newly-created Bazz (binding should NOT be exposed)
|
|
|
|
|
|
|
|
Running test: testErrors
|
|
|
|
{
|
|
|
|
error : {
|
|
|
|
code : -32602
|
|
|
|
message : Invalid executionContextName
|
|
|
|
}
|
|
|
|
id : <messageId>
|
|
|
|
}
|
|
|
|
{
|
|
|
|
error : {
|
|
|
|
code : -32602
|
|
|
|
message : executionContextName is mutually exclusive with executionContextId
|
|
|
|
}
|
|
|
|
id : <messageId>
|
|
|
|
}
|
|
|
|
{
|
|
|
|
error : {
|
|
|
|
code : -32602
|
|
|
|
message : Cannot find execution context with given executionContextId
|
|
|
|
}
|
|
|
|
id : <messageId>
|
|
|
|
}
|