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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
922 ], | 922 ], |
923 "deoptReason": "", | 923 "deoptReason": "", |
924 "id": 1 | 924 "id": 1 |
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 var startTime = profile.startTime * 1000; | 932 profile.startTime *= 1000; |
933 var endTime = profile.endTime * 1000; | 933 profile.endTime *= 1000; |
934 profile.startTime /= 1000; | 934 var samplingInterval = (profile.endTime - profile.startTime) / (profile.samp les.length - 1); |
935 profile.endTime /= 1000; | 935 profile.timestampDeltas = Array.from(new Array(profile.samples.length), (x, i) => i ? samplingInterval : 0); |
936 var samplingInterval = (endTime - startTime) / (profile.samples.length - 1); | 936 profileAndExpectations.target = () => {}; |
937 profile.timestamps = []; | 937 profileAndExpectations.weakTarget = () => new WeakReference(null); |
938 for (var i = 0; i < profile.samples.length; ++i) | |
939 profile.timestamps.push(startTime + i * samplingInterval); | |
940 profileAndExpectations.target = function() {}; | |
941 profileAndExpectations.weakTarget = function() { return new WeakReference(nu ll);}; | |
942 var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations) ; | 938 var cpuProfileView = new WebInspector.CPUProfileView(profileAndExpectations) ; |
943 cpuProfileView.viewSelectComboBox.setSelectedIndex(0); | 939 cpuProfileView.viewSelectComboBox.setSelectedIndex(0); |
944 cpuProfileView._changeView(); | 940 cpuProfileView._changeView(); |
945 var overviewPane = cpuProfileView._flameChart._overviewPane; | 941 var overviewPane = cpuProfileView._flameChart._overviewPane; |
946 console.log(Object.values(overviewPane._calculateDrawData(16))); | 942 console.log(Object.values(overviewPane._calculateDrawData(16))); |
947 console.log(Object.values(overviewPane._calculateDrawData(8))); | 943 console.log(Object.values(overviewPane._calculateDrawData(8))); |
948 console.log(Object.values(overviewPane._calculateDrawData(4))); | 944 console.log(Object.values(overviewPane._calculateDrawData(4))); |
949 console.log(Object.values(overviewPane._calculateDrawData(2))); | 945 console.log(Object.values(overviewPane._calculateDrawData(2))); |
950 console.log(Object.values(overviewPane._calculateDrawData(1))); | 946 console.log(Object.values(overviewPane._calculateDrawData(1))); |
951 InspectorTest.completeTest(); | 947 InspectorTest.completeTest(); |
952 } | 948 } |
953 | 949 |
954 </script> | 950 </script> |
955 </head> | 951 </head> |
956 <body onload="runTest()"> | 952 <body onload="runTest()"> |
957 <p> | 953 <p> |
958 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/> |
959 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. |
960 | 956 |
961 </p> | 957 </p> |
962 </body> | 958 </body> |
963 </html> | 959 </html> |
OLD | NEW |