| OLD | NEW |
| 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
g/TR/html4/loose.dtd"> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../http/tests/inspector/inspector-test.js"></script> | 4 <script src="../http/tests/inspector/inspector-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 Protocol.InspectorBackend.Options.suppressRequestErrors = false; | 8 Protocol.InspectorBackend.Options.suppressRequestErrors = false; |
| 9 function dumpArgument(name, value) | 9 function dumpArgument(name, value) |
| 10 { | 10 { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 [{"name": "arg1", "type": "object", "optional": false}, {"name": "arg2",
"type": "number", "optional": true}, {"name": "arg3", "type": "string", "option
al": true}], ["arg1", "arg2", "arg3"], false); | 74 [{"name": "arg1", "type": "object", "optional": false}, {"name": "arg2",
"type": "number", "optional": true}, {"name": "arg3", "type": "string", "option
al": true}], ["arg1", "arg2", "arg3"], false); |
| 75 Protocol.inspectorBackend.registerCommand("Profiler.commandError", [{"name":
"error", "type": "object", "optional": false}], [], false); | 75 Protocol.inspectorBackend.registerCommand("Profiler.commandError", [{"name":
"error", "type": "object", "optional": false}], [], false); |
| 76 | 76 |
| 77 var sendMessageToBackendOriginal = InspectorFrontendHost.sendMessageToBacken
d; | 77 var sendMessageToBackendOriginal = InspectorFrontendHost.sendMessageToBacken
d; |
| 78 InspectorFrontendHost.sendMessageToBackend = sendMessageToBackendLoopback; | 78 InspectorFrontendHost.sendMessageToBackend = sendMessageToBackendLoopback; |
| 79 | 79 |
| 80 function defaultHandler() { | 80 function defaultHandler() { |
| 81 return Array.prototype.slice.call(arguments); | 81 return Array.prototype.slice.call(arguments); |
| 82 } | 82 } |
| 83 | 83 |
| 84 var agent = SDK.targetManager.mainTarget().profilerAgent(); | 84 var agent = SDK.targetManager.mainTarget()._dispatcher.profilerAgent(); |
| 85 Promise.resolve() | 85 Promise.resolve() |
| 86 .then(function() { return processResult("commandError", agent.commandErr
or({"message": "this is the error message"}, defaultHandler)); }) // Error: erro
r in the protocol response | 86 .then(function() { return processResult("commandError", agent.commandErr
or({"message": "this is the error message"}, defaultHandler)); }) // Error: erro
r in the protocol response |
| 87 .then(function() { return processResult("commandArgs0", agent.commandArg
s0(defaultHandler)); }) | 87 .then(function() { return processResult("commandArgs0", agent.commandArg
s0(defaultHandler)); }) |
| 88 .then(function() { return processResult("commandArgs0", agent.commandArg
s0(1, defaultHandler)); }) // Error: extra arg | 88 .then(function() { return processResult("commandArgs0", agent.commandArg
s0(1, defaultHandler)); }) // Error: extra arg |
| 89 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0(123, defaultHandler)); }) | 89 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0(123, defaultHandler)); }) |
| 90 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0(123, 456, defaultHandler)); }) // Error: extra arg | 90 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0(123, 456, defaultHandler)); }) // Error: extra arg |
| 91 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0("abc", defaultHandler)); }) // Error: wrong type | 91 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0("abc", defaultHandler)); }) // Error: wrong type |
| 92 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0(defaultHandler)); }) // Error: missing arg | 92 .then(function() { return processResult("commandArgs1Rets0", agent.comma
ndArgs1Rets0(defaultHandler)); }) // Error: missing arg |
| 93 .then(function() { return processResult("commandArgs1Rets1", agent.comma
ndArgs1Rets1({"value1": 234}, defaultHandler)); }) | 93 .then(function() { return processResult("commandArgs1Rets1", agent.comma
ndArgs1Rets1({"value1": 234}, defaultHandler)); }) |
| 94 .then(function() { return processResult("commandArgs1Rets1", agent.comma
ndArgs1Rets1({"value1": 234}, defaultHandler)); }) | 94 .then(function() { return processResult("commandArgs1Rets1", agent.comma
ndArgs1Rets1({"value1": 234}, defaultHandler)); }) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 107 InspectorFrontendHost.sendMessageToBackend = sendMessageToBackendOrigina
l; | 107 InspectorFrontendHost.sendMessageToBackend = sendMessageToBackendOrigina
l; |
| 108 InspectorTest.completeTest(); | 108 InspectorTest.completeTest(); |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 </script> | 111 </script> |
| 112 </head> | 112 </head> |
| 113 <body onload="runTest()"> | 113 <body onload="runTest()"> |
| 114 <p>Tests correctness of promisified protocol commands.</p> | 114 <p>Tests correctness of promisified protocol commands.</p> |
| 115 </body> | 115 </body> |
| 116 </html> | 116 </html> |
| OLD | NEW |