Index: third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.js |
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.js b/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..732b39a67f3329261395d49a02d349c693b91daf |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.js |
@@ -0,0 +1,34 @@ |
+(async function() { |
+ 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.
|
+ |
+ var response = await Protocol.Runtime.evaluate({expression: 'let a = 42;'}); |
+ failIfError(response); |
+ InspectorTest.log('first \'let a = 1;\' result: wasThrown = ' + !!response.result.exceptionDetails); |
+ |
+ response = await Protocol.Runtime.evaluate({expression: 'let a = 239;'}); |
+ failIfError(response); |
+ InspectorTest.log('second \'let a = 1;\' result: wasThrown = ' + !!response.result.exceptionDetails); |
+ if (response.result.exceptionDetails) |
+ InspectorTest.log('exception message: ' + response.result.exceptionDetails.text + ' ' + response.result.exceptionDetails.exception.description); |
+ |
+ response = await Protocol.Runtime.evaluate({expression: 'a'}); |
+ failIfError(response); |
+ InspectorTest.log(JSON.stringify(response.result)); |
+ |
+ var methods = [ '$', '$$', '$x', 'dir', 'dirxml', 'keys', 'values', 'profile', 'profileEnd', |
+ 'monitorEvents', 'unmonitorEvents', 'inspect', 'copy', 'clear', 'getEventListeners', |
+ 'debug', 'undebug', 'monitor', 'unmonitor', 'table' ]; |
+ for (var method of methods) { |
+ response = await Protocol.Runtime.evaluate({expression: method, includeCommandLineAPI: true}); |
+ failIfError(response); |
+ InspectorTest.log(response.result.result.description); |
+ } |
+ InspectorTest.completeTest(); |
+ |
+ function failIfError(response) { |
+ if (response && response.error) { |
+ InspectorTest.log('FAIL: ' + JSON.stringify(response.error)); |
+ InspectorTest.completeTest(); |
+ } |
+ } |
+})(); |