Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.js

Issue 2952023003: [DevTools] Migrate inspector-protocol/{console,cpu-profiler} to new harness (Closed)
Patch Set: rebased Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..fb650b9f4f99d6930ba06c74247a9b6eb0d6bca7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/console/console-let-const-with-api.js
@@ -0,0 +1,34 @@
+(async function(testRunner) {
+ let {page, session, dp} = await testRunner.startBlank('');
+
+ var response = await dp.Runtime.evaluate({expression: 'let a = 42;'});
+ failIfError(response);
+ testRunner.log(`first 'let a = 1;' result: wasThrown = ${!!response.result.exceptionDetails}`);
+
+ response = await dp.Runtime.evaluate({expression: 'let a = 239;'});
+ failIfError(response);
+ testRunner.log(`second 'let a = 1;' result: wasThrown = ${!!response.result.exceptionDetails}`);
+ if (response.result.exceptionDetails)
+ testRunner.log('exception message: ' + response.result.exceptionDetails.text + ' ' + response.result.exceptionDetails.exception.description);
+
+ response = await dp.Runtime.evaluate({expression: 'a'});
+ failIfError(response);
+ testRunner.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 dp.Runtime.evaluate({expression: method, includeCommandLineAPI: true});
+ failIfError(response);
+ testRunner.log(response.result.result.description);
+ }
+ testRunner.completeTest();
+
+ function failIfError(response) {
+ if (response && response.error) {
+ testRunner.log('FAIL: ' + JSON.stringify(response.error));
+ testRunner.completeTest();
+ }
+ }
+})

Powered by Google App Engine
This is Rietveld 408576698