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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
925 }, | 925 }, |
926 "startTime": 1384977392.3568, | 926 "startTime": 1384977392.3568, |
927 "endTime": 1384977392.5345, | 927 "endTime": 1384977392.5345, |
928 "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] | 928 "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] |
929 } | 929 } |
930 }; | 930 }; |
931 var profile = profileAndExpectations._profile; | 931 var profile = profileAndExpectations._profile; |
932 profile.startTime *= 1000; | 932 profile.startTime *= 1000; |
933 profile.endTime *= 1000; | 933 profile.endTime *= 1000; |
934 var samplingInterval = (profile.endTime - profile.startTime) / (profile.samp les.length - 1); | 934 var samplingInterval = (profile.endTime - profile.startTime) / (profile.samp les.length - 1); |
935 profile.timestampDeltas = Array.from(new Array(profile.samples.length), (x, i) => i ? samplingInterval : 0); | 935 profile.timeDeltas = [0, ...new Array(profile.samples.length - 1).fill(sampl ingInterval)]; |
936 profileAndExpectations.target = () => {}; | 936 profileAndExpectations.target = () => {}; |
937 profileAndExpectations.weakTarget = () => new WeakReference(null); | 937 profileAndExpectations.weakTarget = () => new WeakReference(null); |
938 var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations) ; | 938 var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations) ; |
939 cpuProfileView.viewSelectComboBox.setSelectedIndex(0); | 939 cpuProfileView.viewSelectComboBox.setSelectedIndex(0); |
940 cpuProfileView._changeView(); | 940 cpuProfileView._changeView(); |
941 var overviewPane = cpuProfileView._flameChart._overviewPane; | 941 var overviewPane = cpuProfileView._flameChart._overviewPane; |
942 console.log(Object.values(overviewPane._calculateDrawData(16))); | 942 console.log(Object.values(overviewPane._calculateDrawData(16))); |
943 console.log(Object.values(overviewPane._calculateDrawData(8))); | 943 console.log(Object.values(overviewPane._calculateDrawData(8))); |
944 console.log(Object.values(overviewPane._calculateDrawData(4))); | 944 console.log(Object.values(overviewPane._calculateDrawData(4))); |
945 console.log(Object.values(overviewPane._calculateDrawData(2))); | 945 console.log(Object.values(overviewPane._calculateDrawData(2))); |
946 console.log(Object.values(overviewPane._calculateDrawData(1))); | 946 console.log(Object.values(overviewPane._calculateDrawData(1))); |
947 InspectorTest.completeTest(); | 947 InspectorTest.completeTest(); |
948 } | 948 } |
949 | 949 |
950 </script> | 950 </script> |
951 </head> | 951 </head> |
952 <body onload="runTest()"> | 952 <body onload="runTest()"> |
953 <p> | 953 <p> |
954 Tests Overview pane calculation in FlameChart for different width = 2^n with n i n range 4 - 0.<br/> | 954 Tests Overview pane calculation in FlameChart for different width = 2^n with n i n range 4 - 0.<br/> |
955 Also tests loading of a legacy nodes format, where nodes were represented as a t ree. | 955 Also tests loading of a legacy nodes format, where nodes were represented as a t ree. |
956 | 956 |
957 </p> | 957 </p> |
958 </body> | 958 </body> |
959 </html> | 959 </html> |
OLD | NEW |