| Index: third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.js
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.js b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f1dd2dc40ffa89ae9c44a1841338fe45198e7c22
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.js
|
| @@ -0,0 +1,38 @@
|
| +(async function() {
|
| + // <a href='https://bugs.webkit.org/show_bug.cgi?id=105759'>Bug 105759.</a>
|
| + let {page, session, Protocol} = await InspectorTest.startBlank('Tests that "console.profileEnd()" does not cause crash.\nBug 105759.');
|
| +
|
| + function fail(message) {
|
| + InspectorTest.log('FAIL: ' + message);
|
| + InspectorTest.completeTest();
|
| + }
|
| +
|
| + var headers = [];
|
| + Protocol.Profiler.onConsoleProfileFinished(messageObject => {
|
| + headers.push({title: messageObject['params']['title']});
|
| + });
|
| +
|
| + Protocol.Profiler.enable();
|
| + await session.evaluate(`
|
| + (function collectProfiles() {
|
| + console.profile();
|
| + console.profile('titled');
|
| + console.profileEnd();
|
| + console.profileEnd();
|
| + })();
|
| + `);
|
| +
|
| +
|
| + if (headers.length !== 2)
|
| + return fail('Cannot retrive headers: ' + JSON.stringify(messageObject, null, 4));
|
| +
|
| + InspectorTest.log('SUCCESS: found 2 profile headers');
|
| + for (var i = 0; i < headers.length; i++) {
|
| + if (headers[i].title === 'titled') {
|
| + InspectorTest.log('SUCCESS: titled profile found');
|
| + InspectorTest.completeTest();
|
| + return;
|
| + }
|
| + }
|
| + fail('Cannot find titled profile');
|
| +})();
|
|
|