v8/test/inspector/runtime/add-binding-expected.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

251 lines
5.4 KiB
Plaintext
Raw Normal View History

Reland "[inspector] added Runtime.installBinding method" This is a reland of 49c4ac7753de637d2baba09811bd7fbbcb01fe7c Original change's description: > [inspector] added Runtime.installBinding method > > A lot of different clients use console.debug as a message channel from > page to protocol client. console.debug is a little slow and not > designed for this use case. > > This CL introduces new method: Runtime.installBinding. This method > installs binding function by given name on global object on each > inspected context including any context created later. > Binding function takes exactly one string argument. Each time when > binding function is called, Runtime.bindingCalled notification is > triggered and includes passed payload. > > Binding function survives page reload and reinstalled right after > console object is setup. So installed binding can be used inside > script added by Page.addScriptToEvaluateOnNewDocument so client may do > something like: > Runtime.installBinding({name: 'send'}); > Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'}); > .. navigate page .. > > In microbenchmark this function is ~4.6 times faster then > console.debug. > > R=lushnikov@chromium.org,pfeldman@chromium.org > > Bug: none > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel > Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3 > Reviewed-on: https://chromium-review.googlesource.com/1077662 > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> > Reviewed-by: Dmitry Gozman <dgozman@chromium.org> > Cr-Commit-Position: refs/heads/master@{#53462} TBR=dgozman@chromium.org Bug: none Change-Id: I58d053581a86f15338dea621498058b7b75c7c85 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Reviewed-on: https://chromium-review.googlesource.com/1081833 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#53479}
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..
binding called in session1
{
method : Runtime.bindingCalled
params : {
executionContextId : <executionContextId>
name : send
payload : payload
}
}
Reland "[inspector] added Runtime.installBinding method" This is a reland of 49c4ac7753de637d2baba09811bd7fbbcb01fe7c Original change's description: > [inspector] added Runtime.installBinding method > > A lot of different clients use console.debug as a message channel from > page to protocol client. console.debug is a little slow and not > designed for this use case. > > This CL introduces new method: Runtime.installBinding. This method > installs binding function by given name on global object on each > inspected context including any context created later. > Binding function takes exactly one string argument. Each time when > binding function is called, Runtime.bindingCalled notification is > triggered and includes passed payload. > > Binding function survives page reload and reinstalled right after > console object is setup. So installed binding can be used inside > script added by Page.addScriptToEvaluateOnNewDocument so client may do > something like: > Runtime.installBinding({name: 'send'}); > Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'}); > .. navigate page .. > > In microbenchmark this function is ~4.6 times faster then > console.debug. > > R=lushnikov@chromium.org,pfeldman@chromium.org > > Bug: none > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel > Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3 > Reviewed-on: https://chromium-review.googlesource.com/1077662 > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> > Reviewed-by: Dmitry Gozman <dgozman@chromium.org> > Cr-Commit-Position: refs/heads/master@{#53462} TBR=dgozman@chromium.org Bug: none Change-Id: I58d053581a86f15338dea621498058b7b75c7c85 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Reviewed-on: https://chromium-review.googlesource.com/1081833 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#53479}
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..
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
}
}
Reland "[inspector] added Runtime.installBinding method" This is a reland of 49c4ac7753de637d2baba09811bd7fbbcb01fe7c Original change's description: > [inspector] added Runtime.installBinding method > > A lot of different clients use console.debug as a message channel from > page to protocol client. console.debug is a little slow and not > designed for this use case. > > This CL introduces new method: Runtime.installBinding. This method > installs binding function by given name on global object on each > inspected context including any context created later. > Binding function takes exactly one string argument. Each time when > binding function is called, Runtime.bindingCalled notification is > triggered and includes passed payload. > > Binding function survives page reload and reinstalled right after > console object is setup. So installed binding can be used inside > script added by Page.addScriptToEvaluateOnNewDocument so client may do > something like: > Runtime.installBinding({name: 'send'}); > Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'}); > .. navigate page .. > > In microbenchmark this function is ~4.6 times faster then > console.debug. > > R=lushnikov@chromium.org,pfeldman@chromium.org > > Bug: none > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel > Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3 > Reviewed-on: https://chromium-review.googlesource.com/1077662 > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> > Reviewed-by: Dmitry Gozman <dgozman@chromium.org> > Cr-Commit-Position: refs/heads/master@{#53462} TBR=dgozman@chromium.org Bug: none Change-Id: I58d053581a86f15338dea621498058b7b75c7c85 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Reviewed-on: https://chromium-review.googlesource.com/1081833 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#53479}
2018-05-31 20:42:07 +00:00
Enable agent inside session1..
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
}
}
Reland "[inspector] added Runtime.installBinding method" This is a reland of 49c4ac7753de637d2baba09811bd7fbbcb01fe7c Original change's description: > [inspector] added Runtime.installBinding method > > A lot of different clients use console.debug as a message channel from > page to protocol client. console.debug is a little slow and not > designed for this use case. > > This CL introduces new method: Runtime.installBinding. This method > installs binding function by given name on global object on each > inspected context including any context created later. > Binding function takes exactly one string argument. Each time when > binding function is called, Runtime.bindingCalled notification is > triggered and includes passed payload. > > Binding function survives page reload and reinstalled right after > console object is setup. So installed binding can be used inside > script added by Page.addScriptToEvaluateOnNewDocument so client may do > something like: > Runtime.installBinding({name: 'send'}); > Page.addScriptToEvaluateOnNewDocument({source: 'console.debug = send'}); > .. navigate page .. > > In microbenchmark this function is ~4.6 times faster then > console.debug. > > R=lushnikov@chromium.org,pfeldman@chromium.org > > Bug: none > Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel > Change-Id: I3e0e231dde9d45116709d248f6e9e7ec7037e8e3 > Reviewed-on: https://chromium-review.googlesource.com/1077662 > Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> > Reviewed-by: Dmitry Gozman <dgozman@chromium.org> > Cr-Commit-Position: refs/heads/master@{#53462} TBR=dgozman@chromium.org Bug: none Change-Id: I58d053581a86f15338dea621498058b7b75c7c85 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Reviewed-on: https://chromium-review.googlesource.com/1081833 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#53479}
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..
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)
Running test: testAddBindingToMultipleContextsById
Call binding in default context (binding should be exposed)
binding called in session1
{
method : Runtime.bindingCalled
params : {
executionContextId : <executionContextId>
name : frobnicate
payload : message
}
}
Call binding in target context (binding should be exposed)
binding called in session1
{
method : Runtime.bindingCalled
params : {
executionContextId : <executionContextId>
name : frobnicate
payload : message
}
}
Running test: testAddBindingToMultipleContextsInDifferentContextGroups
Call binding in default context (binding should be exposed)
binding called in group1/session1
{
method : Runtime.bindingCalled
params : {
executionContextId : <executionContextId>
name : frobnicate
payload : message
}
}
Call binding in target context (binding should be exposed)
binding called in group2/session1
{
method : Runtime.bindingCalled
params : {
executionContextId : <executionContextId>
name : frobnicate
payload : message
}
}
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>
}