OLD | NEW |
---|---|
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="profiler-test.js"></script> | 4 <script src="profiler-test.js"></script> |
5 <script> | 5 <script> |
6 | 6 |
7 function test() | 7 function test() |
8 { | 8 { |
9 var profileAndExpectations = { | 9 var profileAndExpectations = { |
10 _profile: { | 10 _profile: { |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
802 "id": 1 | 802 "id": 1 |
803 }, | 803 }, |
804 "startTime": 1384977392.3568, | 804 "startTime": 1384977392.3568, |
805 "endTime": 1384977392.5345, | 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] | 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] |
807 } | 807 } |
808 }; | 808 }; |
809 var profile = profileAndExpectations._profile; | 809 var profile = profileAndExpectations._profile; |
810 var startTime = profile.startTime * 1000; | 810 var startTime = profile.startTime * 1000; |
811 var endTime = profile.endTime * 1000; | 811 var endTime = profile.endTime * 1000; |
812 profile.startTime /= 1000; | |
813 profile.endTime /= 1000; | |
812 var samplingInterval = (endTime - startTime) / (profile.samples.length - 1); | 814 var samplingInterval = (endTime - startTime) / (profile.samples.length - 1); |
813 profile.timestamps = []; | 815 profile.timestamps = []; |
814 for (var i = 0; i < profile.samples.length; ++i) | 816 for (var i = 0; i < profile.samples.length; ++i) |
815 profile.timestamps.push(startTime + i * samplingInterval); | 817 profile.timestamps.push(startTime + i * samplingInterval); |
816 profileAndExpectations.target = function() {}; | 818 profileAndExpectations.target = function() {}; |
817 profileAndExpectations.weakTarget = function() { return new WeakReference(nu ll);}; | 819 profileAndExpectations.weakTarget = function() { return new WeakReference(nu ll);}; |
818 var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations) ; | 820 var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations) ; |
819 cpuProfileView.viewSelectComboBox.setSelectedIndex(0); | 821 cpuProfileView.viewSelectComboBox.setSelectedIndex(0); |
820 cpuProfileView._changeView(); | 822 cpuProfileView._changeView(); |
821 var overviewPane = cpuProfileView._flameChart._overviewPane; | 823 var overviewPane = cpuProfileView._flameChart._overviewPane; |
822 console.log(Object.values(overviewPane._calculateDrawData(16))); | 824 console.log(Object.values(overviewPane._calculateDrawData(16))); |
823 console.log(Object.values(overviewPane._calculateDrawData(8))); | 825 console.log(Object.values(overviewPane._calculateDrawData(8))); |
824 console.log(Object.values(overviewPane._calculateDrawData(4))); | 826 console.log(Object.values(overviewPane._calculateDrawData(4))); |
825 console.log(Object.values(overviewPane._calculateDrawData(2))); | 827 console.log(Object.values(overviewPane._calculateDrawData(2))); |
826 console.log(Object.values(overviewPane._calculateDrawData(1))); | 828 console.log(Object.values(overviewPane._calculateDrawData(1))); |
827 InspectorTest.completeTest(); | 829 InspectorTest.completeTest(); |
828 } | 830 } |
829 | 831 |
830 </script> | 832 </script> |
831 </head> | 833 </head> |
832 <body onload="runTest()"> | 834 <body onload="runTest()"> |
833 <p> | 835 <p> |
834 Tests Overview pane calculation in FlameChart for different width = 2^n with n i n range 4 - 0. | 836 Tests Overview pane calculation in FlameChart for different width = 2^n with n i n range 4 - 0. |
835 | 837 |
836 </p> | 838 </p> |
837 </body> | 839 </body> |
838 </html> | 840 </html> |
OLD | NEW |