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

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

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: Protocol -> dp 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 unified diff | Download patch
OLDNEW
(Empty)
1 (async function(testRunner) {
2 let {page, session, dp} = await testRunner.startBlank('');
3
4 var response = await dp.Runtime.evaluate({expression: 'let a = 42;'});
5 failIfError(response);
6 testRunner.log('first \'let a = 1;\' result: wasThrown = ' + !!response.result .exceptionDetails);
7
8 response = await dp.Runtime.evaluate({expression: 'let a = 239;'});
9 failIfError(response);
10 testRunner.log('second \'let a = 1;\' result: wasThrown = ' + !!response.resul t.exceptionDetails);
11 if (response.result.exceptionDetails)
12 testRunner.log('exception message: ' + response.result.exceptionDetails.text + ' ' + response.result.exceptionDetails.exception.description);
13
14 response = await dp.Runtime.evaluate({expression: 'a'});
15 failIfError(response);
16 testRunner.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 dp.Runtime.evaluate({expression: method, includeCommandLine API: true});
23 failIfError(response);
24 testRunner.log(response.result.result.description);
25 }
26 testRunner.completeTest();
27
28 function failIfError(response) {
29 if (response && response.error) {
30 testRunner.log('FAIL: ' + JSON.stringify(response.error));
31 testRunner.completeTest();
32 }
33 }
34 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698