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

Unified Diff: LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.html

Issue 15816002: Remove console.profiles from window.console API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 7 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: LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.html
diff --git a/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.html b/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..a1d8e8d93e0569bb9f6cc613de1a2e7cc50c15e2
--- /dev/null
+++ b/LayoutTests/inspector-protocol/cpu-profiler/console-profileEnd-parameterless-crash.html
@@ -0,0 +1,59 @@
+<html>
+<head>
+<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/protocol-test.js"></script>
+<script>
+function collectProfiles()
+{
+ console.profile();
+ console.profile("titled");
+ console.profileEnd();
+ console.profileEnd();
+}
+
+function test()
+{
+ InspectorTest.fail = function(message)
+ {
+ InspectorTest.log("FAIL: " + message);
+ InspectorTest.completeTest();
+ }
+
+ InspectorTest.sendCommand("Profiler.enable", {});
+ InspectorTest.sendCommand("Runtime.evaluate", { expression: "collectProfiles()"}, didCollectProfiles);
+
+ InspectorTest.eventHandler["Profiler.addProfileHeader"] = function(messageObject)
+ {
+ InspectorTest.log("FAIL: unexpected header = " + JSON.stringify(messageObject, null, 4));
+ }
+
+ function didCollectProfiles(messageObject)
+ {
+ InspectorTest.sendCommand("Profiler.getProfileHeaders", {}, didReceiveProfileHeaders);
+ }
+
+ function didReceiveProfileHeaders(messageObject)
+ {
+ var headers = messageObject["result"]["headers"];
+ if (!headers || headers.length !== 2)
+ return InspectorTest.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.sendCommand("Profiler.clearProfiles", {});
+ InspectorTest.completeTest();
+ return;
+ }
+ }
+ InspectorTest.fail("Cannot find titled profile");
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+Tests that "console.profileEnd()" does not cause crash.<br>
+<a href="https://bugs.webkit.org/show_bug.cgi?id=105759">Bug 105759.</a><br>
+</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698