| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 InspectorTest.log('Checks command line API.'); | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Checks command line
API.'); |
| 6 | 6 |
| 7 InspectorTest.runAsyncTestSuite([ | 7 InspectorTest.runAsyncTestSuite([ |
| 8 async function testKeys() { | 8 async function testKeys() { |
| 9 InspectorTest.logMessage(await Protocol.Runtime.evaluate({ | 9 InspectorTest.logMessage(await Protocol.Runtime.evaluate({ |
| 10 expression: 'keys', includeCommandLineAPI: true})); | 10 expression: 'keys', includeCommandLineAPI: true})); |
| 11 InspectorTest.logMessage(await Protocol.Runtime.evaluate({ | 11 InspectorTest.logMessage(await Protocol.Runtime.evaluate({ |
| 12 expression: 'keys({a : 1})', includeCommandLineAPI: true, returnByValue: t
rue})); | 12 expression: 'keys({a : 1})', includeCommandLineAPI: true, returnByValue: t
rue})); |
| 13 | 13 |
| 14 Protocol.Runtime.evaluate({expression: 'this.keys = keys', includeCommandLin
eAPI: true}); | 14 Protocol.Runtime.evaluate({expression: 'this.keys = keys', includeCommandLin
eAPI: true}); |
| 15 InspectorTest.logMessage(await Protocol.Runtime.evaluate({ | 15 InspectorTest.logMessage(await Protocol.Runtime.evaluate({ |
| (...skipping 23 matching lines...) Expand all Loading... |
| 39 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true})); | 39 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true})); |
| 40 await Protocol.Runtime.evaluate({expression: '239', includeCommandLineAPI: t
rue}); | 40 await Protocol.Runtime.evaluate({expression: '239', includeCommandLineAPI: t
rue}); |
| 41 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true})); | 41 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true})); |
| 42 await Protocol.Runtime.evaluate({expression: '-0', objectGroup: 'console', i
ncludeCommandLineAPI: true}); | 42 await Protocol.Runtime.evaluate({expression: '-0', objectGroup: 'console', i
ncludeCommandLineAPI: true}); |
| 43 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true})); | 43 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true})); |
| 44 await Protocol.Runtime.evaluate({expression: '({})', objectGroup: 'console',
includeCommandLineAPI: true}); | 44 await Protocol.Runtime.evaluate({expression: '({})', objectGroup: 'console',
includeCommandLineAPI: true}); |
| 45 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true, returnByValue: true})); | 45 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: '$_',
includeCommandLineAPI: true, returnByValue: true})); |
| 46 }, | 46 }, |
| 47 | 47 |
| 48 async function testDebug() { | 48 async function testDebug() { |
| 49 InspectorTest.setupScriptMap(); | 49 session.setupScriptMap(); |
| 50 await Protocol.Debugger.enable(); | 50 await Protocol.Debugger.enable(); |
| 51 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: 'debug
', includeCommandLineAPI: true})); | 51 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: 'debug
', includeCommandLineAPI: true})); |
| 52 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: 'undeb
ug', includeCommandLineAPI: true})); | 52 InspectorTest.logMessage(await Protocol.Runtime.evaluate({expression: 'undeb
ug', includeCommandLineAPI: true})); |
| 53 await Protocol.Runtime.evaluate({expression: 'function foo() {}'}); | 53 await Protocol.Runtime.evaluate({expression: 'function foo() {}'}); |
| 54 await Protocol.Runtime.evaluate({expression: 'debug(foo)', includeCommandLin
eAPI: true}); | 54 await Protocol.Runtime.evaluate({expression: 'debug(foo)', includeCommandLin
eAPI: true}); |
| 55 Protocol.Runtime.evaluate({ expression: 'foo()'}); | 55 Protocol.Runtime.evaluate({ expression: 'foo()'}); |
| 56 let message = await Protocol.Debugger.oncePaused(); | 56 let message = await Protocol.Debugger.oncePaused(); |
| 57 InspectorTest.logCallFrames(message.params.callFrames); | 57 session.logCallFrames(message.params.callFrames); |
| 58 InspectorTest.logMessage(message.params.hitBreakpoints); | 58 InspectorTest.logMessage(message.params.hitBreakpoints); |
| 59 await Protocol.Debugger.resume(); | 59 await Protocol.Debugger.resume(); |
| 60 await Protocol.Runtime.evaluate({expression: 'undebug(foo)', includeCommandL
ineAPI: true}); | 60 await Protocol.Runtime.evaluate({expression: 'undebug(foo)', includeCommandL
ineAPI: true}); |
| 61 await Protocol.Runtime.evaluate({ expression: 'foo()'}); | 61 await Protocol.Runtime.evaluate({ expression: 'foo()'}); |
| 62 | 62 |
| 63 Protocol.Runtime.evaluate({ | 63 Protocol.Runtime.evaluate({ |
| 64 expression: 'this.debug = debug; this.undebug = undebug;', includeCommandL
ineAPI: true}); | 64 expression: 'this.debug = debug; this.undebug = undebug;', includeCommandL
ineAPI: true}); |
| 65 await Protocol.Runtime.evaluate({expression: 'this.debug(foo)'}); | 65 await Protocol.Runtime.evaluate({expression: 'this.debug(foo)'}); |
| 66 Protocol.Runtime.evaluate({ expression: 'foo()'}); | 66 Protocol.Runtime.evaluate({ expression: 'foo()'}); |
| 67 message = await Protocol.Debugger.oncePaused(); | 67 message = await Protocol.Debugger.oncePaused(); |
| 68 InspectorTest.logCallFrames(message.params.callFrames); | 68 session.logCallFrames(message.params.callFrames); |
| 69 InspectorTest.logMessage(message.params.hitBreakpoints); | 69 InspectorTest.logMessage(message.params.hitBreakpoints); |
| 70 await Protocol.Debugger.resume(); | 70 await Protocol.Debugger.resume(); |
| 71 await Protocol.Runtime.evaluate({expression: 'this.undebug(foo)'}); | 71 await Protocol.Runtime.evaluate({expression: 'this.undebug(foo)'}); |
| 72 await Protocol.Runtime.evaluate({expression: 'foo()'}); | 72 await Protocol.Runtime.evaluate({expression: 'foo()'}); |
| 73 | 73 |
| 74 await Protocol.Debugger.disable(); | 74 await Protocol.Debugger.disable(); |
| 75 }, | 75 }, |
| 76 | 76 |
| 77 async function testMonitor() { | 77 async function testMonitor() { |
| 78 await Protocol.Debugger.enable(); | 78 await Protocol.Debugger.enable(); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 await Protocol.Runtime.enable(); | 166 await Protocol.Runtime.enable(); |
| 167 Protocol.Runtime.evaluate({expression: 'clear()', includeCommandLineAPI: tru
e}); | 167 Protocol.Runtime.evaluate({expression: 'clear()', includeCommandLineAPI: tru
e}); |
| 168 InspectorTest.logMessage(await Protocol.Runtime.onceConsoleAPICalled()); | 168 InspectorTest.logMessage(await Protocol.Runtime.onceConsoleAPICalled()); |
| 169 | 169 |
| 170 Protocol.Runtime.evaluate({expression: 'this.clear = clear', includeCommandL
ineAPI: true}); | 170 Protocol.Runtime.evaluate({expression: 'this.clear = clear', includeCommandL
ineAPI: true}); |
| 171 Protocol.Runtime.evaluate({expression: 'this.clear()'}); | 171 Protocol.Runtime.evaluate({expression: 'this.clear()'}); |
| 172 InspectorTest.logMessage(await Protocol.Runtime.onceConsoleAPICalled()); | 172 InspectorTest.logMessage(await Protocol.Runtime.onceConsoleAPICalled()); |
| 173 await Protocol.Runtime.disable(); | 173 await Protocol.Runtime.disable(); |
| 174 } | 174 } |
| 175 ]); | 175 ]); |
| OLD | NEW |