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

Unified Diff: LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.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/profiler/cpu-profiler-profiling-without-inspector.html
diff --git a/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.html b/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.html
deleted file mode 100644
index 22e3a997d7a698fd960e2cca56c711efff9ec879..0000000000000000000000000000000000000000
--- a/LayoutTests/inspector/profiler/cpu-profiler-profiling-without-inspector.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<html>
-<head>
-<script>
-
-if (window.testRunner)
- testRunner.dumpAsText();
-if (window.internals)
- internals.setJavaScriptProfilingEnabled(true);
-
-function pageFunction()
-{
- console.profile("outer");
- console.profile("inner"); // [Chromium] Make sure we capture the current callstack.
- console.profileEnd("outer");
- console.profileEnd("inner");
-}
-
-function startTest()
-{
- pageFunction();
- printResult();
- if (window.testRunner)
- testRunner.notifyDone();
-}
-
-function printResult()
-{
- var preElement = document.createElement("pre");
- preElement.appendChild(document.createTextNode("\n"));
-
- var profiles = console.profiles;
- for (var i = 0; i < profiles.length; ++i) {
- var profile = profiles[i];
- if (profile.title !== "inner")
- continue;
- var functionName = "pageFunction";
- if (findFunctionInProfile(profile.head, functionName))
- preElement.appendChild(document.createTextNode("Found " + functionName));
- else {
- preElement.appendChild(document.createTextNode("!!! Not found " + functionName));
- preElement.appendChild(document.createTextNode("\n\n"));
- printProfileNodeWithoutTime(preElement, profile.head, "");
- }
- preElement.appendChild(document.createTextNode("\n"));
- }
-
- document.getElementById("output").appendChild(preElement);
-}
-
-function printProfileNodeWithoutTime(preElement, node, space)
-{
- if (!node.visible)
- return;
-
- var line = space + node.functionName + " (line " + node.lineNumber + ")\n";
- preElement.appendChild(document.createTextNode(line));
-
- var children = node.children();
- for (var i = 0; i < children.length; ++i)
- printProfileNodeWithoutTime(preElement, children[i], space + " ");
-}
-
-function findFunctionInProfile(node, functionName)
-{
- if (node.functionName === functionName)
- return true;
- var children = node.children();
- for (var i = 0; i < children.length; ++i)
- if (findFunctionInProfile(children[i], functionName))
- return true;
- return false;
-}
-
-</script>
-</head>
-<body onload="startTest()">
-<p>
-Tests that CPU profiling works.<br>
-Doesn't open Inspector, uses <b>console.profile...</b>.
-
-<div id="output"></div>
-</p>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698