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