Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 (async function() { | |
| 2 let {page, session, Protocol} = await InspectorTest.startBlank(''); | |
|
pfeldman
2017/06/19 18:44:52
s/Protocol/dp/
dgozman
2017/06/19 21:49:21
Done.
| |
| 3 | |
| 4 var response = await Protocol.Runtime.evaluate({expression: 'let a = 42;'}); | |
| 5 failIfError(response); | |
| 6 InspectorTest.log('first \'let a = 1;\' result: wasThrown = ' + !!response.res ult.exceptionDetails); | |
| 7 | |
| 8 response = await Protocol.Runtime.evaluate({expression: 'let a = 239;'}); | |
| 9 failIfError(response); | |
| 10 InspectorTest.log('second \'let a = 1;\' result: wasThrown = ' + !!response.re sult.exceptionDetails); | |
| 11 if (response.result.exceptionDetails) | |
| 12 InspectorTest.log('exception message: ' + response.result.exceptionDetails.t ext + ' ' + response.result.exceptionDetails.exception.description); | |
| 13 | |
| 14 response = await Protocol.Runtime.evaluate({expression: 'a'}); | |
| 15 failIfError(response); | |
| 16 InspectorTest.log(JSON.stringify(response.result)); | |
| 17 | |
| 18 var methods = [ '$', '$$', '$x', 'dir', 'dirxml', 'keys', 'values', 'profile', 'profileEnd', | |
| 19 'monitorEvents', 'unmonitorEvents', 'inspect', 'copy', 'clear', 'getEventL isteners', | |
| 20 'debug', 'undebug', 'monitor', 'unmonitor', 'table' ]; | |
| 21 for (var method of methods) { | |
| 22 response = await Protocol.Runtime.evaluate({expression: method, includeComma ndLineAPI: true}); | |
| 23 failIfError(response); | |
| 24 InspectorTest.log(response.result.result.description); | |
| 25 } | |
| 26 InspectorTest.completeTest(); | |
| 27 | |
| 28 function failIfError(response) { | |
| 29 if (response && response.error) { | |
| 30 InspectorTest.log('FAIL: ' + JSON.stringify(response.error)); | |
| 31 InspectorTest.completeTest(); | |
| 32 } | |
| 33 } | |
| 34 })(); | |
| OLD | NEW |