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

Unified 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 side-by-side diff with in-line comments
Download patch
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..232732952eed8244f8bba15306ad5e86372b8b0c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.js
@@ -0,0 +1,38 @@
+(async function(testRunner) {
+ // <a href='https://bugs.webkit.org/show_bug.cgi?id=105759'>Bug 105759.</a>
+ let {page, session, dp} = await testRunner.startBlank('Tests that "console.profileEnd()" does not cause crash.\nBug 105759.');
+
+ function fail(message) {
+ testRunner.log('FAIL: ' + message);
+ testRunner.completeTest();
+ }
+
+ var headers = [];
+ dp.Profiler.onConsoleProfileFinished(messageObject => {
+ headers.push({title: messageObject['params']['title']});
+ });
+
+ dp.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));
+
+ testRunner.log('SUCCESS: found 2 profile headers');
+ for (var i = 0; i < headers.length; i++) {
+ if (headers[i].title === 'titled') {
+ testRunner.log('SUCCESS: titled profile found');
+ testRunner.completeTest();
+ return;
+ }
+ }
+ fail('Cannot find titled profile');
+})

Powered by Google App Engine
This is Rietveld 408576698