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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.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 // <a href='https://bugs.webkit.org/show_bug.cgi?id=105759'>Bug 105759.</a>
3 let {page, session, dp} = await testRunner.startBlank('Tests that "console.pro fileEnd()" does not cause crash.\nBug 105759.');
4
5 function fail(message) {
6 testRunner.log('FAIL: ' + message);
7 testRunner.completeTest();
8 }
9
10 var headers = [];
11 dp.Profiler.onConsoleProfileFinished(messageObject => {
12 headers.push({title: messageObject['params']['title']});
13 });
14
15 dp.Profiler.enable();
16 await session.evaluate(`
17 (function collectProfiles() {
18 console.profile();
19 console.profile('titled');
20 console.profileEnd();
21 console.profileEnd();
22 })();
23 `);
24
25
26 if (headers.length !== 2)
27 return fail('Cannot retrive headers: ' + JSON.stringify(messageObject, null, 4));
28
29 testRunner.log('SUCCESS: found 2 profile headers');
30 for (var i = 0; i < headers.length; i++) {
31 if (headers[i].title === 'titled') {
32 testRunner.log('SUCCESS: titled profile found');
33 testRunner.completeTest();
34 return;
35 }
36 }
37 fail('Cannot find titled profile');
38 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698