3 <script src=
"../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"profiler-test.js"></script>
9 var profileAndExpectations
= {
12 "functionName": "(root)",
18 "callUID": 1017737175,
21 "functionName": "(program)",
27 "callUID": 3228965662,
34 "functionName": "goog.ui.HoverCard.maybeShow",
36 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/hovercard.js",
40 "callUID": 2979117654,
43 "functionName": "goog.ui.Tooltip.maybeShow",
45 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/tooltip.js",
49 "callUID": 4025562866,
52 "functionName": "goog.ui.Tooltip.positionAndShow_",
54 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/tooltip.js",
58 "callUID": 3670406757,
61 "functionName": "goog.ui.PopupBase.setVisible",
63 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
67 "callUID": 1027332454,
70 "functionName": "goog.ui.PopupBase.show_",
72 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
76 "callUID": 1243771321,
79 "functionName": "goog.ui.Tooltip.onBeforeShow",
81 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/tooltip.js",
88 "functionName": "goog.ui.PopupBase.onBeforeShow",
90 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
94 "callUID": 3156514871,
97 "functionName": "goog.events.EventTarget.dispatchEvent",
99 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
103 "callUID": 175902988,
106 "functionName": "goog.events.EventTarget.dispatchEventInternal_",
108 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
112 "callUID": 1027992353,
115 "functionName": "goog.events.EventTarget.fireListeners",
117 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
121 "callUID": 3839384186,
124 "functionName": "logEvent",
126 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/demos\/hovercard.html",
130 "callUID": 3948503588,
133 "functionName": "goog.log.info",
135 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/log\/log.js",
139 "callUID": 2719274562,
142 "functionName": "goog.debug.DivConsole.addLogRecord",
144 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/debug\/divconsole.js",
148 "callUID": 3436172789,
151 "functionName": "appendChild",
157 "callUID": 2375967960,
164 "deoptReason": "no reason",
168 "deoptReason": "no reason",
172 "deoptReason": "no reason",
176 "deoptReason": "no reason",
180 "deoptReason": "no reason",
184 "deoptReason": "no reason",
188 "deoptReason": "no reason",
192 "deoptReason": "no reason",
196 "functionName": "goog.ui.Popup.reposition",
198 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popup.js",
202 "callUID": 994036427,
205 "functionName": "goog.positioning.AnchoredPosition.reposition",
207 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/positioning\/anchoredposition.js",
211 "callUID": 3611579388,
214 "functionName": "goog.positioning.positionAtAnchor",
216 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/positioning\/positioning.js",
220 "callUID": 2475480533,
223 "functionName": "goog.positioning.getOffsetParentPageOffset",
225 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/positioning\/positioning.js",
229 "callUID": 726686371,
232 "functionName": "get offsetParent",
238 "callUID": 165569179,
245 "deoptReason": "no reason",
249 "functionName": "goog.positioning.getVisiblePart_",
251 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/positioning\/positioning.js",
255 "callUID": 832563978,
258 "functionName": "goog.style.getBounds",
260 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/style\/style.js",
264 "callUID": 1735066671,
267 "functionName": "goog.style.getPageOffset",
269 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/style\/style.js",
273 "callUID": 3913614204,
276 "functionName": "goog.style.getStyle_",
278 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/style\/style.js",
282 "callUID": 1778778665,
285 "functionName": "get ownerDocument",
291 "callUID": 2871300201,
298 "deoptReason": "no reason",
302 "deoptReason": "no reason",
306 "deoptReason": "no reason",
310 "deoptReason": "no reason",
314 "deoptReason": "no reason",
318 "deoptReason": "no reason",
322 "deoptReason": "no reason",
326 "functionName": "goog.ui.AdvancedTooltip.onShow_",
328 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/advancedtooltip.js",
332 "callUID": 1438523729,
335 "functionName": "goog.ui.PopupBase.onShow_",
337 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
341 "callUID": 3641174553,
344 "functionName": "goog.events.EventTarget.dispatchEvent",
346 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
350 "callUID": 175902988,
353 "functionName": "goog.events.EventTarget.dispatchEventInternal_",
355 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
359 "callUID": 1027992353,
362 "functionName": "goog.events.EventTarget.fireListeners",
364 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
368 "callUID": 3839384186,
371 "functionName": "logEvent",
373 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/demos\/hovercard.html",
377 "callUID": 3948503588,
380 "functionName": "goog.log.info",
382 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/log\/log.js",
386 "callUID": 2719274562,
389 "functionName": "goog.debug.DivConsole.addLogRecord",
391 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/debug\/divconsole.js",
395 "callUID": 3436172789,
398 "functionName": "get scrollHeight",
404 "callUID": 1630838451,
411 "functionName": "appendChild",
417 "callUID": 2375967960,
424 "deoptReason": "no reason",
428 "deoptReason": "no reason",
432 "deoptReason": "no reason",
436 "deoptReason": "no reason",
440 "deoptReason": "no reason",
444 "deoptReason": "no reason",
448 "deoptReason": "no reason",
452 "deoptReason": "no reason",
456 "deoptReason": "TryCatchStatement",
460 "deoptReason": "no reason",
464 "deoptReason": "no reason",
468 "deoptReason": "no reason",
472 "deoptReason": "no reason",
476 "functionName": "(idle)",
482 "callUID": 316851070,
489 "functionName": "goog.ui.AdvancedTooltip.maybeHide",
491 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/advancedtooltip.js",
495 "callUID": 762635884,
498 "functionName": "goog.ui.PopupBase.setVisible",
500 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
504 "callUID": 1027332454,
507 "functionName": "goog.ui.PopupBase.hide_",
509 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
513 "callUID": 1192193890,
516 "functionName": "goog.ui.PopupBase.onBeforeHide_",
518 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
522 "callUID": 3604239577,
525 "functionName": "goog.events.EventTarget.dispatchEvent",
527 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
531 "callUID": 175902988,
534 "functionName": "goog.events.EventTarget.dispatchEventInternal_",
536 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
540 "callUID": 1027992353,
543 "functionName": "goog.events.EventTarget.fireListeners",
545 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
549 "callUID": 3839384186,
552 "functionName": "logEvent",
554 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/demos\/hovercard.html",
558 "callUID": 3948503588,
561 "functionName": "goog.log.info",
563 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/log\/log.js",
567 "callUID": 2719274562,
570 "functionName": "goog.debug.DivConsole.addLogRecord",
572 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/debug\/divconsole.js",
576 "callUID": 3436172789,
579 "functionName": "set innerHTML",
585 "callUID": 707509894,
592 "deoptReason": "no reason",
596 "deoptReason": "no reason",
600 "deoptReason": "no reason",
604 "deoptReason": "no reason",
608 "deoptReason": "no reason",
612 "deoptReason": "no reason",
616 "deoptReason": "no reason",
620 "functionName": "goog.ui.PopupBase.continueHidingPopup_",
622 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
626 "callUID": 2093833058,
629 "functionName": "goog.ui.HoverCard.onHide_",
631 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/hovercard.js",
635 "callUID": 654814745,
638 "functionName": "goog.ui.AdvancedTooltip.onHide_",
640 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/advancedtooltip.js",
644 "callUID": 1821323492,
647 "functionName": "goog.events.unlisten",
649 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/events.js",
653 "callUID": 250969654,
656 "deoptReason": "no reason",
660 "functionName": "goog.ui.Tooltip.onHide_",
662 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/tooltip.js",
666 "callUID": 985322188,
669 "functionName": "goog.ui.PopupBase.onHide_",
671 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/ui\/popupbase.js",
675 "callUID": 4290498223,
678 "functionName": "goog.events.EventTarget.dispatchEvent",
680 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
684 "callUID": 175902988,
687 "functionName": "goog.events.EventTarget.dispatchEventInternal_",
689 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
693 "callUID": 1027992353,
696 "functionName": "goog.events.EventTarget.fireListeners",
698 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/events\/eventtarget.js",
702 "callUID": 3839384186,
705 "functionName": "logEvent",
707 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/demos\/hovercard.html",
711 "callUID": 3948503588,
714 "functionName": "goog.log.info",
716 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/log\/log.js",
720 "callUID": 2719274562,
723 "functionName": "goog.debug.DivConsole.addLogRecord",
725 "url": "http:\/\/closure-library.googlecode.com\/git\/closure\/goog\/debug\/divconsole.js",
729 "callUID": 3436172789,
732 "functionName": "appendChild",
738 "callUID": 2375967960,
745 "deoptReason": "no reason",
749 "deoptReason": "no reason",
753 "deoptReason": "no reason",
757 "deoptReason": "no reason",
761 "deoptReason": "no reason",
765 "deoptReason": "no reason",
769 "deoptReason": "no reason",
773 "deoptReason": "no reason",
777 "deoptReason": "no reason",
781 "deoptReason": "no reason",
785 "deoptReason": "no reason",
789 "deoptReason": "no reason",
793 "deoptReason": "no reason",
797 "deoptReason": "no reason",
804 "startTime": 1384977392.3568,
805 "endTime": 1384977392.5345,
806 "samples": [2,16,21,26,35,36,37,2,2,2,2,2,2,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,48,52,52,61,2,37,37,37,37,37,37,37]
809 var profile
= profileAndExpectations
._profile
;
810 var startTime
= profile
.startTime
* 1000;
811 var endTime
= profile
.endTime
* 1000;
812 var samplingInterval
= (endTime
- startTime
) / (profile
.samples
.length
- 1);
813 profile
.timestamps
= [];
814 for (var i
= 0; i
< profile
.samples
.length
; ++i
)
815 profile
.timestamps
.push(startTime
+ i
* samplingInterval
);
816 profileAndExpectations
.target = function() {};
817 profileAndExpectations
.weakTarget = function() { return new WeakReference(null);};
818 var cpuProfileView
= new WebInspector
.CPUProfileView(profileAndExpectations
);
819 cpuProfileView
.viewSelectComboBox
.setSelectedIndex(0);
820 cpuProfileView
._changeView();
821 var overviewPane
= cpuProfileView
._flameChart
._overviewPane
;
822 console
.log(Object
.values(overviewPane
._calculateDrawData(16)));
823 console
.log(Object
.values(overviewPane
._calculateDrawData(8)));
824 console
.log(Object
.values(overviewPane
._calculateDrawData(4)));
825 console
.log(Object
.values(overviewPane
._calculateDrawData(2)));
826 console
.log(Object
.values(overviewPane
._calculateDrawData(1)));
827 InspectorTest
.completeTest();
832 <body onload=
"runTest()">
834 Tests Overview pane calculation in FlameChart for different width =
2^n with n in range
4 -
0.