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

Unified Diff: LayoutTests/inspector/profiler/cpu-profiler-profiling.html

Issue 458963002: DevTools: Fix anonymous function names in CPU profile tree view. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/cpu-profiler-profiling-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/inspector/profiler/cpu-profiler-profiling.html
diff --git a/LayoutTests/inspector/profiler/cpu-profiler-profiling.html b/LayoutTests/inspector/profiler/cpu-profiler-profiling.html
index 1cec4b665c6861488acac9db4eb3ad910c76729c..619fa48b15a4c521c2379a7b22b9e000b7298ec1 100644
--- a/LayoutTests/inspector/profiler/cpu-profiler-profiling.html
+++ b/LayoutTests/inspector/profiler/cpu-profiler-profiling.html
@@ -5,12 +5,29 @@
<script>
function pageFunction() {
- console.profile("profile");
- console.profileEnd("profile");
+ (function () {
+ console.profile("profile");
+ console.profileEnd("profile");
+ })();
}
function test()
{
+ function checkFunction(name, tree)
+ {
+ var node = tree.children[0];
+ if (!node)
+ InspectorTest.addResult("no node");
+ while (node) {
+ if (node.functionName === name) {
+ InspectorTest.addResult("found " + name);
+ return;
+ }
+ node = node.traverseNextNode(true, null, true);
+ }
+ InspectorTest.addResult(name + " not found");
+ }
+
InspectorTest.runProfilerTestSuite([
function testProfiling(next)
{
@@ -19,16 +36,8 @@ function test()
var tree = view.profileDataGridTree;
if (!tree)
InspectorTest.addResult("no tree");
- var node = tree.children[0];
- if (!node)
- InspectorTest.addResult("no node");
- while (node) {
- if (node.functionName.indexOf("pageFunction") !== -1) {
- InspectorTest.addResult("found pageFunction");
- break;
- }
- node = node.traverseNextNode(true, null, true);
- }
+ checkFunction("pageFunction", tree);
+ checkFunction("(anonymous function)", tree);
next();
}
InspectorTest.showProfileWhenAdded("profile");
« no previous file with comments | « no previous file | LayoutTests/inspector/profiler/cpu-profiler-profiling-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698