Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / inspector / profiler / cpu-profiler-bottom-up-times.html
1 <html>
2 <head>
3   <script src="../../http/tests/inspector/inspector-test.js"></script>
4   <script src="profiler-test.js"></script>
5 <script>
6
7 function test()
8 {
9     var profileAndExpectations = {
10         "title": "profile1",
11         "_profile": {
12             "head": {
13                 "functionName": "(root)",
14                 "scriptId": "0",
15                 "url": "",
16                 "lineNumber": 0,
17                 "hitCount": 50,
18                 "callUID": 1000,
19                 "children": [
20                 {
21                     "functionName": "(idle)",
22                     "scriptId": "40",
23                     "url": "",
24                     "lineNumber": 1,
25                     "hitCount": 300,
26                     "callUID": 2,
27                     "children": []
28                 },
29                 {
30                     "functionName": "A",
31                     "scriptId": "40",
32                     "url": "",
33                     "lineNumber": 4642,
34                     "hitCount": 250,
35                     "callUID": 1001,
36                     "children": [
37                     {
38                         "functionName": "C",
39                         "scriptId": "40",
40                         "url": "",
41                         "lineNumber": 525,
42                         "hitCount": 100,
43                         "callUID": 2000,
44                         "children": [
45                         {
46                             "functionName": "D",
47                             "scriptId": "40",
48                             "url": "",
49                             "lineNumber": 425,
50                             "hitCount": 20,
51                             "callUID": 3000,
52                             "children": []
53                         }
54                         ]
55                     }
56                     ]
57                 },
58                 {
59                     "functionName": "B",
60                     "scriptId": "40",
61                     "url": "",
62                     "lineNumber": 4662,
63                     "hitCount": 150,
64                     "callUID": 1002,
65                     "children": [
66                     {
67                         "functionName": "C",
68                         "scriptId": "40",
69                         "url": "",
70                         "lineNumber": 525,
71                         "hitCount": 100,
72                         "callUID": 2000,
73                         "children": [
74                         {
75                             "functionName": "D",
76                             "scriptId": "40",
77                             "url": "",
78                             "lineNumber": 425,
79                             "hitCount": 30,
80                             "callUID": 3000,
81                             "children": []
82                         }
83                         ]
84                     }
85                     ]
86                 }
87                 ]
88             },
89             "idleTime": 0.300,
90             "startTime": 0,
91             "endTime": 1.000
92         }
93     };
94     WebInspector.inspectorView.showPanel("profiles");
95     var view = new WebInspector.CPUProfileView(profileAndExpectations);
96     view.viewSelectComboBox.setSelectedIndex(1);
97     view._changeView();
98     var tree = view.profileDataGridTree;
99     if (!tree)
100          InspectorTest.addResult("no tree");
101     var node = tree.children[0];
102     if (!node)
103          InspectorTest.addResult("no node");
104     while (node) {
105         InspectorTest.addResult(node.callUID + ": " + node.functionName + " " + node.selfTime + " " + node.totalTime + " " + JSON.stringify(node.data));
106         node = node.traverseNextNode(true, null, true);
107     }
108     InspectorTest.completeProfilerTest();
109 }
110
111 </script>
112 </head>
113 <body onload="runTest()">
114 <p>
115 Tests bottom-up view self and total time calculation in CPU profiler.
116 </p>
117 </body>
118 </html>